Unlike ClassLoader.getResources(), Bundle.getResources() should return null.
(FELIX-2629)


git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1004388 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/framework/src/main/java/org/apache/felix/framework/BundleImpl.java b/framework/src/main/java/org/apache/felix/framework/BundleImpl.java
index dfef85f..4a6afb0 100644
--- a/framework/src/main/java/org/apache/felix/framework/BundleImpl.java
+++ b/framework/src/main/java/org/apache/felix/framework/BundleImpl.java
@@ -623,7 +623,10 @@
             }
         }
 
-        return getFramework().getBundleResources(this, name);
+        // Spec says we should return null when resources not found,
+        // even though ClassLoader.getResources() returns empty enumeration.
+        Enumeration e = getFramework().getBundleResources(this, name);
+        return ((e == null) || !e.hasMoreElements()) ? null : e;
     }
 
     /**