]> source.dussan.org Git - javassist.git/commitdiff
fixed JASSIST-18.
authorchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>
Tue, 9 May 2006 17:18:31 +0000 (17:18 +0000)
committerchiba <chiba@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>
Tue, 9 May 2006 17:18:31 +0000 (17:18 +0000)
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@269 30ef5769-5b8d-40dd-aea6-55b5d6557bb3

src/main/javassist/util/proxy/ProxyFactory.java

index 47b25950e2f2b10e72d9337ee8c8b00749ddf30b..63088940d60c3f9c435e6d3b58faf804d0a25b97 100644 (file)
@@ -177,13 +177,19 @@ public class ProxyFactory {
     }
 
     protected ClassLoader getClassLoader() {
+        // return Thread.currentThread().getContextClassLoader();
+        ClassLoader loader;
         if (superClass != null && !superClass.getName().equals("java.lang.Object"))
-            return superClass.getClassLoader();
+            loader = superClass.getClassLoader();
         else if (interfaces != null && interfaces.length > 0)
-            return interfaces[0].getClassLoader();
+            loader = interfaces[0].getClassLoader();
         else
-            return this.getClass().getClassLoader();
-            // return Thread.currentThread().getContextClassLoader();
+            loader = this.getClass().getClassLoader();
+
+        if (loader == null)
+            loader = ClassLoader.getSystemClassLoader();
+
+        return loader;
     }
 
     /**