db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r632398 - /db/derby/code/trunk/java/engine/org/apache/derby/iapi/services/monitor/Monitor.java
Date Fri, 29 Feb 2008 17:27:26 GMT
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;
 	}



Mime
View raw message