From: chiba Date: Tue, 9 May 2006 17:18:31 +0000 (+0000) Subject: fixed JASSIST-18. X-Git-Tag: rel_3_17_1_ga~360 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5a318e3e74ea36bedfb0f5b86c3eca4294d3d34d;p=javassist.git fixed JASSIST-18. git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@269 30ef5769-5b8d-40dd-aea6-55b5d6557bb3 --- diff --git a/src/main/javassist/util/proxy/ProxyFactory.java b/src/main/javassist/util/proxy/ProxyFactory.java index 47b25950..63088940 100644 --- a/src/main/javassist/util/proxy/ProxyFactory.java +++ b/src/main/javassist/util/proxy/ProxyFactory.java @@ -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; } /**