jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1492376 - /jena/trunk/jena-core/src/main/java/com/hp/hpl/jena/ontology/impl/OntResourceImpl.java
Date Wed, 12 Jun 2013 19:08:07 GMT
Author: andy
Date: Wed Jun 12 19:08:06 2013
New Revision: 1492376

URL: http://svn.apache.org/r1492376
Log:
JENA-468 : Protect close of iterator in case an exception happened, leaving the iterator variable
null.

Modified:
    jena/trunk/jena-core/src/main/java/com/hp/hpl/jena/ontology/impl/OntResourceImpl.java

Modified: jena/trunk/jena-core/src/main/java/com/hp/hpl/jena/ontology/impl/OntResourceImpl.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-core/src/main/java/com/hp/hpl/jena/ontology/impl/OntResourceImpl.java?rev=1492376&r1=1492375&r2=1492376&view=diff
==============================================================================
--- jena/trunk/jena-core/src/main/java/com/hp/hpl/jena/ontology/impl/OntResourceImpl.java
(original)
+++ jena/trunk/jena-core/src/main/java/com/hp/hpl/jena/ontology/impl/OntResourceImpl.java
Wed Jun 12 19:08:06 2013
@@ -830,7 +830,7 @@ public class OntResourceImpl
             return i.hasNext() ? i.next(): null;
         }
         finally {
-            i.close();
+            if ( i != null ) i.close();
         }
     }
 
@@ -918,7 +918,7 @@ public class OntResourceImpl
                 return false;
             }
             finally {
-                i.close();
+                if ( i != null ) i.close();
             }
         }
     }



Mime
View raw message