db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r366226 - /db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/BaseMonitor.java
Date Thu, 05 Jan 2006 17:38:02 GMT
Author: djd
Date: Thu Jan  5 09:38:00 2006
New Revision: 366226

URL: http://svn.apache.org/viewcvs?rev=366226&view=rev
Log:
DERBY-798 Fix NullPointerException when Derby is loaded by the bootstrap
class loader in a jvm which returns null on Class.getClassLoader().
Fix suggested by Timothy Luksha (RIT Student).

Modified:
    db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/BaseMonitor.java

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/BaseMonitor.java
URL: http://svn.apache.org/viewcvs/db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/BaseMonitor.java?rev=366226&r1=366225&r2=366226&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/BaseMonitor.java
(original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/BaseMonitor.java
Thu Jan  5 09:38:00 2006
@@ -1275,8 +1275,10 @@
 
         ClassLoader cl = getClass().getClassLoader();
         try {
-            for( Enumeration e = cl.getResources("org/apache/derby/modules.properties");
-                 e.hasMoreElements() ;) {
+        	Enumeration e = cl == null ?
+        		ClassLoader.getSystemResources("org/apache/derby/modules.properties") :
+        		cl.getResources("org/apache/derby/modules.properties");
+            while (e.hasMoreElements()) {
                 URL modulesPropertiesURL = (URL) e.nextElement();
                 InputStream is = null;
                 try {



Mime
View raw message