You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Andy Seaborne (JIRA)" <ji...@apache.org> on 2012/09/19 18:49:07 UTC
[jira] [Closed] (JENA-323) ModelCom: difference NullPointerExeption
swallows the original cause
[ https://issues.apache.org/jira/browse/JENA-323?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andy Seaborne closed JENA-323.
------------------------------
> ModelCom: difference NullPointerExeption swallows the original cause
> --------------------------------------------------------------------
>
> Key: JENA-323
> URL: https://issues.apache.org/jira/browse/JENA-323
> Project: Apache Jena
> Issue Type: Bug
> Components: Jena
> Affects Versions: Jena 2.7.3
> Reporter: Martin W.
> Assignee: Stephen Allen
> Priority: Minor
>
> I'm getting NullPointerException at com.hp.hpl.jena.rdf.model.impl.ModelCom.difference(ModelCom.java:1440)
> Currently the source code reads as follows:
> @Override
> public Model difference(Model model) {
> Model resultModel = createWorkModel();
> StmtIterator iter = null;
> Statement stmt;
> try {
> iter = listStatements();
> while (iter.hasNext()) {
> stmt = iter.nextStatement();
> if (! model.contains(stmt)) {
> resultModel.add(stmt);
> }
> }
> return resultModel;
> } finally {
> iter.close();
> }
> }
> Probably, the finally section should be:
> } finally {
> if (iter != null) {
> iter.close();
> }
> }
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira