]> source.dussan.org Git - javassist.git/commitdiff
JASSIST-18, Use of the system classloader for the case of a superclass with a null...
authorstarksm <starksm@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>
Tue, 9 May 2006 22:14:14 +0000 (22:14 +0000)
committerstarksm <starksm@30ef5769-5b8d-40dd-aea6-55b5d6557bb3>
Tue, 9 May 2006 22:14:14 +0000 (22:14 +0000)
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@270 30ef5769-5b8d-40dd-aea6-55b5d6557bb3

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

index 63088940d60c3f9c435e6d3b58faf804d0a25b97..00778d7f62ea1f89f2db91e332d68c0b570fac40 100644 (file)
@@ -178,16 +178,19 @@ public class ProxyFactory {
 
     protected ClassLoader getClassLoader() {
         // return Thread.currentThread().getContextClassLoader();
-        ClassLoader loader;
+        ClassLoader loader = null;
         if (superClass != null && !superClass.getName().equals("java.lang.Object"))
             loader = superClass.getClassLoader();
         else if (interfaces != null && interfaces.length > 0)
             loader = interfaces[0].getClassLoader();
-        else
-            loader = this.getClass().getClassLoader();
 
         if (loader == null)
-            loader = ClassLoader.getSystemClassLoader();
+        {
+            loader = getClass().getClassLoader();
+            // In case javassist is in the endorsed dir
+            if (loader == null)
+               loader = ClassLoader.getSystemClassLoader();
+        }
 
         return loader;
     }