Author: pauls
Date: Fri Apr  4 14:30:02 2008
New Revision: 644939

URL: http://svn.apache.org/viewvc?rev=644939&view=rev
Log:
Make sure to catch NoClassDefFoundError when trying to query the framework 
classloader for whether a class is available or not. Previously, it was 
possible that this query was leaked to bundles because of the error propagate 
all the way to the bundle that instigated the classload.

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

Modified: 
felix/trunk/framework/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicyCore.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicyCore.java?rev=644939&r1=644938&r2=644939&view=diff
==============================================================================
--- 
felix/trunk/framework/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicyCore.java
 (original)
+++ 
felix/trunk/framework/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicyCore.java
 Fri Apr  4 14:30:02 2008
@@ -599,7 +599,14 @@
                 }
                 if (delegate)
                 {
-                    return this.getClass().getClassLoader().loadClass(name);
+                    try
+                    {
+                        return 
this.getClass().getClassLoader().loadClass(name);
+                    }
+                    catch (NoClassDefFoundError ex)
+                    {
+                        // Ignore, will return null
+                    }
                 }
                 break;
             }
@@ -3187,6 +3194,10 @@
             {
                 getClass().getClassLoader().loadClass(name);
                 classpath = true;
+            }
+            catch (NoClassDefFoundError err)
+            {
+                // Ignore
             }
             catch (Exception ex)
             {


Reply via email to