diff options
Diffstat (limited to 'src/main/javassist/util')
-rw-r--r-- | src/main/javassist/util/proxy/ProxyFactory.java | 14 |
1 files changed, 10 insertions, 4 deletions
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; } /** |