You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by dj...@apache.org on 2008/02/29 18:27:26 UTC

svn commit: r632398 - /db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/monitor/Monitor.java

Author: djd
Date: Fri Feb 29 09:27:14 2008
New Revision: 632398

URL: http://svn.apache.org/viewvc?rev=632398&view=rev
Log:
DERBY-3424 Change getSystemModule() to return null if the monitor is not booted, rather than a NullPointerException

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/monitor/Monitor.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/monitor/Monitor.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/monitor/Monitor.java?rev=632398&r1=632397&r2=632398&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/monitor/Monitor.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/monitor/Monitor.java Fri Feb 29 09:27:14 2008
@@ -387,9 +387,17 @@
 		return module;
 	}
 
-	public static Object getSystemModule(String factoryInterface)
-	{
-		Object module = getMonitor().findModule((Object) null,
+    /**
+     * Return a system module. If it cannot be found or the monitor is
+     * not running then null is returned.
+     */
+    public static Object getSystemModule(String factoryInterface)
+    {
+        ModuleFactory monitor = getMonitor();
+        if (monitor == null)
+            return null;
+        
+		Object module = monitor.findModule((Object) null,
 									  factoryInterface, (String) null);
 		return module;
 	}