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 2008/08/24 19:01:14 UTC

svn commit: r688528 - /felix/trunk/framework/src/main/java/org/apache/felix/framework/searchpolicy/ContentLoaderImpl.java

Author: rickhall
Date: Sun Aug 24 10:01:13 2008
New Revision: 688528

URL: http://svn.apache.org/viewvc?rev=688528&view=rev
Log:
There was a bug when calculating a bundle's class path for fragments, it
should have been calculating the list locally first for each fragment then
adding it to the overall bundle class path.

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

Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/searchpolicy/ContentLoaderImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/searchpolicy/ContentLoaderImpl.java?rev=688528&r1=688527&r2=688528&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/searchpolicy/ContentLoaderImpl.java (original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/searchpolicy/ContentLoaderImpl.java Sun Aug 24 10:01:13 2008
@@ -324,6 +324,9 @@
         // is on the bundle's class path and then creating content
         // objects for everything on the class path.
 
+        // Create a list to contain the content path for the specified content.
+        List localContentList = new ArrayList();
+
         // Get the bundle's manifest header.
         InputStream is = null;
         Map headers = null;
@@ -361,7 +364,7 @@
             // Check for the bundle itself on the class path.
             if (classPathStrings[i].equals(FelixConstants.CLASS_PATH_DOT))
             {
-                contentList.add(content);
+                localContentList.add(content);
             }
             else
             {
@@ -382,7 +385,7 @@
                 // class path content list.
                 if (embeddedContent != null)
                 {
-                    contentList.add(embeddedContent);
+                    localContentList.add(embeddedContent);
                 }
                 else
                 {
@@ -397,11 +400,13 @@
 
         // If there is nothing on the class path, then include
         // "." by default, as per the spec.
-        if (contentList.size() == 0)
+        if (localContentList.size() == 0)
         {
-            contentList.add(content);
+            localContentList.add(content);
         }
 
+        // Now add the local contents to the global content list and return it.
+        contentList.addAll(localContentList);
         return contentList;
     }
 }
\ No newline at end of file