jena-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject svn commit: r1620704 - /jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/TDB.java
Date Tue, 26 Aug 2014 19:27:33 GMT
Author: andy
Date: Tue Aug 26 19:27:32 2014
New Revision: 1620704

URL: http://svn.apache.org/r1620704
Log:
Protect against being passed null pionters.

Modified:
    jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/TDB.java

Modified: jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/TDB.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/TDB.java?rev=1620704&r1=1620703&r2=1620704&view=diff
==============================================================================
--- jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/TDB.java (original)
+++ jena/trunk/jena-tdb/src/main/java/com/hp/hpl/jena/tdb/TDB.java Tue Aug 26 19:27:32 2014
@@ -147,6 +147,9 @@ public class TDB {
 
     /** Sync a TDB-backed Graph. Do nothing if not TDB-backed. */
     public static void sync(Graph graph) {
+        if ( graph == null )
+            return ;
+
         if ( graph instanceof InfGraph ) {
             InfGraph infGraph = (InfGraph)graph ;
             sync(infGraph.getRawGraph()) ;
@@ -157,12 +160,17 @@ public class TDB {
 
     /** Sync a TDB-backed Dataset. Do nothing if not TDB-backed. */
     public static void sync(Dataset dataset) {
+        if ( dataset == null )
+            return ;
         DatasetGraph ds = dataset.asDatasetGraph() ;
         sync(ds) ;
     }
 
     /** Sync a TDB-backed DatasetGraph. Do nothing if not TDB-backed. */
     public static void sync(DatasetGraph dataset) {
+        if ( dataset == null )
+            return ;
+        
         // Should be: SystemARQ.sync(dataset) ;
         if ( dataset instanceof DatasetGraphTDB ) {
             syncObject(dataset) ;
@@ -195,6 +203,8 @@ public class TDB {
      * Do nothing otherwise
      */
     private static void syncObject(Object object) {
+        if ( object == null )
+            return ;
         if ( object instanceof Sync )
             ((Sync)object).sync() ;
     }



Mime
View raw message