diff options
author | starksm <starksm@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2006-05-09 22:14:14 +0000 |
---|---|---|
committer | starksm <starksm@30ef5769-5b8d-40dd-aea6-55b5d6557bb3> | 2006-05-09 22:14:14 +0000 |
commit | 6fa9509fd0dcdb631c0f38365095759a1a670656 (patch) | |
tree | 8c620ca94aecaf53c510c45b45e9257e4a9e1a67 /src | |
parent | 5a318e3e74ea36bedfb0f5b86c3eca4294d3d34d (diff) | |
download | javassist-6fa9509fd0dcdb631c0f38365095759a1a670656.tar.gz javassist-6fa9509fd0dcdb631c0f38365095759a1a670656.zip |
JASSIST-18, Use of the system classloader for the case of a superclass with a null classloader was too restrictive in that it required javassist to be loaded by the system classloader. Instead use the javassist ProxyFactory.class classloader.
git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@270 30ef5769-5b8d-40dd-aea6-55b5d6557bb3
Diffstat (limited to 'src')
-rw-r--r-- | src/main/javassist/util/proxy/ProxyFactory.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/main/javassist/util/proxy/ProxyFactory.java b/src/main/javassist/util/proxy/ProxyFactory.java index 63088940..00778d7f 100644 --- a/src/main/javassist/util/proxy/ProxyFactory.java +++ b/src/main/javassist/util/proxy/ProxyFactory.java @@ -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; } |