[ https://issues.apache.org/jira/browse/JENA-323?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Stephen Allen resolved JENA-323. -------------------------------- Resolution: Fixed Assignee: Stephen Allen Fix applied in revision 1387351. Thanks! > 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