db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1394883 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java
Date Sat, 06 Oct 2012 01:10:58 GMT
Author: mamta
Date: Sat Oct  6 01:10:58 2012
New Revision: 1394883

URL: http://svn.apache.org/viewvc?rev=1394883&view=rev
Log:
DERBY-5916 (java.lang.NullPointerException org.apache.derby.impl.store.raw.data.BaseDataFileFactory.stop()
connecting to network server)

Check for the nullability of storageFactory before using it in shutdown code


Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java?rev=1394883&r1=1394882&r2=1394883&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/store/raw/data/BaseDataFileFactory.java
Sat Oct  6 01:10:58 2012
@@ -526,7 +526,8 @@ public class BaseDataFileFactory
 
 		if (isReadOnly())		// do enough to close all files, then return 
         {
-            storageFactory.shutdown();
+			if (storageFactory != null)
+				storageFactory.shutdown();
 			return;
         }
 
@@ -1583,15 +1584,18 @@ public class BaseDataFileFactory
 	*/
 	private synchronized void removeStubs()
 	{
-        actionCode = REMOVE_STUBS_ACTION;
-        try
+        if( storageFactory != null) 
         {
-            AccessController.doPrivileged( this);
+            actionCode = REMOVE_STUBS_ACTION;
+            try
+            {
+                AccessController.doPrivileged( this);
+            }
+            catch (PrivilegedActionException pae)
+            {
+                // removeStubs does not throw an exception
+            } 
         }
-        catch (PrivilegedActionException pae)
-        {
-            // removeStubs does not throw an exception
-        } 
 	}
 
 	/**



Mime
View raw message