You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by ri...@apache.org on 2006/10/11 15:48:42 UTC

svn commit: r462805 - /incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/FindEntriesEnumeration.java

Author: rickhall
Date: Wed Oct 11 06:48:42 2006
New Revision: 462805

URL: http://svn.apache.org/viewvc?view=rev&rev=462805
Log:
Fixed a bug (FELIX-143) that was causing an NPE due to the fact that the
findEntries() code was assuming that all bundles have content, but the
system bundle does not.

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

Modified: incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/FindEntriesEnumeration.java
URL: http://svn.apache.org/viewvc/incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/FindEntriesEnumeration.java?view=diff&rev=462805&r1=462804&r2=462805
==============================================================================
--- incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/FindEntriesEnumeration.java (original)
+++ incubator/felix/trunk/framework/src/main/java/org/apache/felix/framework/FindEntriesEnumeration.java Wed Oct 11 06:48:42 2006
@@ -36,8 +36,8 @@
     {
         m_bundle = bundle;
         m_path = path;
-        m_enumeration = m_bundle.getInfo().getCurrentModule()
-            .getContentLoader().getContent().getEntries();
+        m_enumeration = (m_bundle.getInfo().getCurrentModule().getContentLoader().getContent() == null)
+            ? null : m_bundle.getInfo().getCurrentModule().getContentLoader().getContent().getEntries();
         m_recurse = recurse;
 
         // Sanity check the parameters.
@@ -86,7 +86,7 @@
         // it only displays the contents of the directory specified by
         // the path argument either recursively or not; much like using
         // "ls -R" or "ls" to list the contents of a directory, respectively.
-        while (m_enumeration.hasMoreElements())
+        while ((m_enumeration != null) && m_enumeration.hasMoreElements())
         {
             // Get the next entry name.
             String entryName = (String) m_enumeration.nextElement();