You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Martin W. (JIRA)" <ji...@apache.org> on 2012/09/17 16:04:07 UTC

[jira] [Created] (JENA-323) ModelCom: difference NullPointerExeption swallows the original cause

Martin W. created JENA-323:
------------------------------

             Summary: 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.
            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

[jira] [Closed] (JENA-323) ModelCom: difference NullPointerExeption swallows the original cause

Posted by "Andy Seaborne (JIRA)" <ji...@apache.org>.
     [ 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

[jira] [Resolved] (JENA-323) ModelCom: difference NullPointerExeption swallows the original cause

Posted by "Stephen Allen (JIRA)" <ji...@apache.org>.
     [ 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