Fixed Felix' delegation hack so that it correctly delegates to the parent
class loader for resources as appropriate; previously it was always delegating
for class loading, which was incorrect. (FELIX-808)


git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@712403 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/framework/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicyCore.java b/framework/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicyCore.java
index 82f6bed..8bca02a 100755
--- a/framework/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicyCore.java
+++ b/framework/src/main/java/org/apache/felix/framework/searchpolicy/R4SearchPolicyCore.java
@@ -605,7 +605,10 @@
                 {
                     try
                     {
-                        return this.getClass().getClassLoader().loadClass(name);
+                        // Return the class or resource from the parent class loader.
+                        return (isClass)
+                            ? (Object) this.getClass().getClassLoader().loadClass(name)
+                            : (Object) this.getClass().getClassLoader().getResource(name);
                     }
                     catch (NoClassDefFoundError ex)
                     {