Author: pauls
Date: Mon Oct 22 11:27:35 2007
New Revision: 587183

URL: http://svn.apache.org/viewvc?rev=587183&view=rev
Log:
Fix a NPE when getEntryPaths is called on the system bundle (FELIX-394).

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

Modified: 
felix/trunk/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java
URL: 
http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java?rev=587183&r1=587182&r2=587183&view=diff
==============================================================================
--- 
felix/trunk/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java
 (original)
+++ 
felix/trunk/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java
 Mon Oct 22 11:27:35 2007
@@ -33,6 +33,7 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.NoSuchElementException;
 import java.util.Set;
 
 import org.apache.felix.framework.util.FelixConstants;
@@ -78,7 +79,7 @@
 // with the parent classloader and one instance per framework instance that
 // keeps track of extension bundles and systembundle exports for that framework
 // instance.
-class ExtensionManager extends URLStreamHandler implements IModuleDefinition, 
IContentLoader
+class ExtensionManager extends URLStreamHandler implements IModuleDefinition, 
IContentLoader, IContent
 {
     // The private instance that is added to Felix.class.getClassLoader() -
     // will be null if extension bundles are not supported (i.e., we are not 
@@ -414,7 +415,7 @@
 
     public IContent getContent()
     {
-        return null;
+        return this;
     }
 
     public ISearchPolicy getSearchPolicy()
@@ -572,5 +573,35 @@
             m_names.add(name);
             m_extensions.add(extension);
         }
+    }
+
+    public Enumeration getEntries() 
+    {
+        return new Enumeration()
+        {
+            public boolean hasMoreElements() 
+            {
+                return false;
+            }
+
+            public Object nextElement() throws NoSuchElementException 
+            {
+                throw new NoSuchElementException();
+            }
+        };
+    }
+
+    public byte[] getEntry(String name) 
+    {
+        return null;
+    }
+
+    public InputStream getEntryAsStream(String name) throws IOException 
+    {
+        return null;
+    }
+
+    public boolean hasEntry(String name) {
+        return false;
     }
 }


Reply via email to