From 5a318e3e74ea36bedfb0f5b86c3eca4294d3d34d Mon Sep 17 00:00:00 2001 From: chiba Date: Tue, 9 May 2006 17:18:31 +0000 Subject: [PATCH] fixed JASSIST-18. git-svn-id: http://anonsvn.jboss.org/repos/javassist/trunk@269 30ef5769-5b8d-40dd-aea6-55b5d6557bb3 --- src/main/javassist/util/proxy/ProxyFactory.java | 14 ++++++++++---- 1 file 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; } /** -- 2.39.5