felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rickh...@apache.org
Subject svn commit: r691770 - /felix/trunk/framework/src/main/java/org/apache/felix/framework/ExtensionManager.java
Date Wed, 03 Sep 2008 21:00:25 GMT
Author: rickhall
Date: Wed Sep  3 14:00:25 2008
New Revision: 691770

URL: http://svn.apache.org/viewvc?rev=691770&view=rev
Log:
Fixed a bug in calculating the system bundle's exported packages; it was
not ignoring non-package capabilities and was ending up with a null exported
package.

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=691770&r1=691769&r2=691770&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 Wed
Sep  3 14:00:25 2008
@@ -442,17 +442,23 @@
 
         for (int i = 0; (m_capabilities != null) && (i < m_capabilities.length);
i++)
         {
-            if (i > 0)
+            if (m_capabilities[i].getNamespace().equals(ICapability.PACKAGE_NAMESPACE))
             {
-                exportSB.append(", ");
-            }
-
-            exportSB.append(((Capability) m_capabilities[i]).getPackageName());
-            exportSB.append("; version=\"");
-            exportSB.append(((Capability) m_capabilities[i]).getPackageVersion().toString());
-            exportSB.append("\"");
+                // Add a comma separate if there is an existing package.
+                if (exportSB.length() > 0)
+                {
+                    exportSB.append(", ");
+                }
+
+                // Append exported package information.
+                exportSB.append(((Capability) m_capabilities[i]).getPackageName());
+                exportSB.append("; version=\"");
+                exportSB.append(((Capability) m_capabilities[i]).getPackageVersion().toString());
+                exportSB.append("\"");
 
-            exportNames.add(((Capability) m_capabilities[i]).getPackageName());
+                // Remember exported packages.
+                exportNames.add(((Capability) m_capabilities[i]).getPackageName());
+            }
         }
 
         m_exportNames = exportNames;



Mime
View raw message