Author: pauls
Date: Thu Jun 17 20:43:55 2010
New Revision: 955734

URL: http://svn.apache.org/viewvc?rev=955734&view=rev
Log:
Ignore classloaders which are inner classes when doing implicit bootdelegation 
(FELIX-2421).

Modified:
    
felix/trunk/framework/src/main/java/org/apache/felix/framework/ModuleImpl.java

Modified: 
felix/trunk/framework/src/main/java/org/apache/felix/framework/ModuleImpl.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/ModuleImpl.java?rev=955734&r1=955733&r2=955734&view=diff
==============================================================================
--- 
felix/trunk/framework/src/main/java/org/apache/felix/framework/ModuleImpl.java 
(original)
+++ 
felix/trunk/framework/src/main/java/org/apache/felix/framework/ModuleImpl.java 
Thu Jun 17 20:43:55 2010
@@ -1517,8 +1517,13 @@ public class ModuleImpl implements Modul
         // If this is an inner class, try to get the enclosing class
         // because we can assume that inner classes of class loaders
         // are really just the class loader and we should ignore them.
-        clazz = getEnclosingClass(clazz);
-        return (this.getClass().getClassLoader() != clazz.getClassLoader())
+        Class enclosing = getEnclosingClass(clazz);
+        return (this.getClass().getClassLoader() != enclosing.getClassLoader())
+            // Do the test on the enclosing class
+            && !ClassLoader.class.isAssignableFrom(enclosing)
+            && !Class.class.equals(enclosing)
+            && !Proxy.class.equals(enclosing)
+            // Do the test on the class itself
             && !ClassLoader.class.isAssignableFrom(clazz)
             && !Class.class.equals(clazz)
             && !Proxy.class.equals(clazz);


Reply via email to