Fixed a bug that was incorrectly calculating the the system bundle export
package header.
git-svn-id: https://svn.apache.org/repos/asf/incubator/felix/trunk@377400 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/org.apache.felix.framework/src/main/java/org/apache/felix/framework/SystemBundle.java b/org.apache.felix.framework/src/main/java/org/apache/felix/framework/SystemBundle.java
index b089de8..2028751 100644
--- a/org.apache.felix.framework/src/main/java/org/apache/felix/framework/SystemBundle.java
+++ b/org.apache.felix.framework/src/main/java/org/apache/felix/framework/SystemBundle.java
@@ -109,22 +109,18 @@
m_contentLoader = new SystemBundleContentLoader(getFelix().getLogger());
- String exportString = "";
+ StringBuffer exportSB = new StringBuffer("");
for (int i = 0; i < m_exports.length; i++)
{
- exportString = exportString +
- m_exports[i].getName()
- + "; specification-version=\""
- + m_exports[i].getVersion().toString() + "\"";
-
- if (i < (m_exports.length - 1))
+ if (i > 0)
{
- exportString = exportString + ", ";
- exportString = exportString +
- m_exports[i].getName()
- + "; specification-version=\""
- + m_exports[i].getVersion().toString() + "\", ";
+ exportSB.append(", ");
}
+
+ exportSB.append(m_exports[i].getName());
+ exportSB.append("; specification-version=\"");
+ exportSB.append(m_exports[i].getVersion().toString());
+ exportSB.append("\"");
}
// Initialize header map as a case insensitive map.
@@ -133,7 +129,7 @@
map.put(FelixConstants.BUNDLE_NAME, "System Bundle");
map.put(FelixConstants.BUNDLE_DESCRIPTION,
"This bundle is system specific; it implements various system services.");
- map.put(FelixConstants.EXPORT_PACKAGE, exportString);
+ map.put(FelixConstants.EXPORT_PACKAGE, exportSB.toString());
((SystemBundleArchive) getInfo().getArchive()).setManifestHeader(map);
}