activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jstrac...@apache.org
Subject svn commit: r546485 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/FactoryFinder.java
Date Tue, 12 Jun 2007 13:53:38 GMT
Author: jstrachan
Date: Tue Jun 12 06:53:37 2007
New Revision: 546485

URL: http://svn.apache.org/viewvc?view=rev&rev=546485
Log:
applied patch for AMQ-1229 with thanks!

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/FactoryFinder.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/FactoryFinder.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/FactoryFinder.java?view=diff&rev=546485&r1=546484&r2=546485
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/FactoryFinder.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/util/FactoryFinder.java
Tue Jun 12 06:53:37 2007
@@ -67,10 +67,17 @@
         if (className == null) {
             throw new IOException("Expected property is missing: " + propertyPrefix + "class");
         }
-        Class clazz;
-        try {
-            clazz = Thread.currentThread().getContextClassLoader().loadClass(className);
-        } catch (ClassNotFoundException e) {
+        Class clazz = null;
+        ClassLoader loader = Thread.currentThread().getContextClassLoader();
+        if (loader != null) {
+            try {
+                clazz = loader.loadClass(className);
+            }
+            catch (ClassNotFoundException e) {
+                // ignore
+            }
+        }
+        if (clazz == null) {
             clazz = FactoryFinder.class.getClassLoader().loadClass(className);
         }
 



Mime
View raw message