You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by ri...@apache.org on 2007/01/18 22:41:46 UTC
svn commit: r497586 -
/incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicyCore.java
Author: rickhall
Date: Thu Jan 18 13:41:45 2007
New Revision: 497586
URL: http://svn.apache.org/viewvc?view=rev&rev=497586
Log:
After the module loader layer was re-engineered, the check to determine
when to delegate to the parent class loader when a class cannot be found
was never updated to take into account that other classes could be
present on the call stack. Karl Pauls uncovered this issue. This is a
fix for it, but I think a better more general approach is needed.
Modified:
incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicyCore.java
Modified: incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicyCore.java
URL: http://svn.apache.org/viewvc/incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicyCore.java?view=diff&rev=497586&r1=497585&r2=497586
==============================================================================
--- incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicyCore.java (original)
+++ incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicyCore.java Thu Jan 18 13:41:45 2007
@@ -23,6 +23,7 @@
import java.security.ProtectionDomain;
import java.util.*;
+import org.apache.felix.framework.Felix;
import org.apache.felix.framework.Logger;
import org.apache.felix.framework.util.*;
import org.apache.felix.framework.util.manifestparser.*;
@@ -451,10 +452,15 @@
// of the R4 search policy classes, nor a class loader or
// class itself, because we want to ignore the calls to
// ClassLoader.loadClass() and Class.forName().
- if (!R4SearchPolicyCore.class.equals(classes[i])
- && !R4SearchPolicy.class.equals(classes[i])
- && !ClassLoader.class.isAssignableFrom(classes[i])
- && !Class.class.isAssignableFrom(classes[i]))
+// TODO: FRAMEWORK - This check is a hack and we should see if we can think
+// of another way to do it, since it won't necessarily work in all situations.
+ if (!R4SearchPolicyCore.class.equals(classes[i])
+ && !R4SearchPolicy.class.equals(classes[i])
+ && !IModule.class.isAssignableFrom(classes[i])
+ && !Felix.class.equals(classes[i])
+ && !Bundle.class.isAssignableFrom(classes[i])
+ && !ClassLoader.class.isAssignableFrom(classes[i])
+ && !Class.class.isAssignableFrom(classes[i]))
{
// If the instigating class was not from a bundle, then
// delegate to the parent class loader. Otherwise, break
@@ -1900,4 +1906,4 @@
return sb.toString();
}
-}
\ No newline at end of file
+}