geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r825529 - /geronimo/sandbox/djencks/osgi/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/osgi/BundleClassLoader.java
Date Thu, 15 Oct 2009 15:46:08 GMT
Author: gawor
Date: Thu Oct 15 15:46:08 2009
New Revision: 825529

URL: http://svn.apache.org/viewvc?rev=825529&view=rev
Log:
must return an empty enumeration if resources are not found

Modified:
    geronimo/sandbox/djencks/osgi/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/osgi/BundleClassLoader.java

Modified: geronimo/sandbox/djencks/osgi/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/osgi/BundleClassLoader.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/djencks/osgi/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/osgi/BundleClassLoader.java?rev=825529&r1=825528&r2=825529&view=diff
==============================================================================
--- geronimo/sandbox/djencks/osgi/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/osgi/BundleClassLoader.java
(original)
+++ geronimo/sandbox/djencks/osgi/framework/modules/geronimo-kernel/src/main/java/org/apache/geronimo/kernel/osgi/BundleClassLoader.java
Thu Oct 15 15:46:08 2009
@@ -22,6 +22,7 @@
 
 import java.io.IOException;
 import java.net.URL;
+import java.util.Collections;
 import java.util.Enumeration;
 
 import org.osgi.framework.Bundle;
@@ -56,6 +57,11 @@
 	@SuppressWarnings("unchecked")
     @Override
 	public Enumeration<URL> getResources(String name) throws IOException {
-        return bundle.getResources(name);
+	    Enumeration<URL> e = (Enumeration<URL>)bundle.getResources(name);
+	    if (e == null) {
+	        return Collections.enumeration(Collections.EMPTY_LIST);
+	    } else {
+	        return e;
+	    }	    
 	}
 }



Mime
View raw message