You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by ma...@apache.org on 2009/08/11 14:51:19 UTC
svn commit: r803096 -
/felix/trunk/deploymentadmin/service/src/main/java/org/apache/felix/deploymentadmin/BundleInfoImpl.java
Author: marrs
Date: Tue Aug 11 12:51:18 2009
New Revision: 803096
URL: http://svn.apache.org/viewvc?rev=803096&view=rev
Log:
FELIX-1305 applied the supplied fix
Modified:
felix/trunk/deploymentadmin/service/src/main/java/org/apache/felix/deploymentadmin/BundleInfoImpl.java
Modified: felix/trunk/deploymentadmin/service/src/main/java/org/apache/felix/deploymentadmin/BundleInfoImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/deploymentadmin/service/src/main/java/org/apache/felix/deploymentadmin/BundleInfoImpl.java?rev=803096&r1=803095&r2=803096&view=diff
==============================================================================
--- felix/trunk/deploymentadmin/service/src/main/java/org/apache/felix/deploymentadmin/BundleInfoImpl.java (original)
+++ felix/trunk/deploymentadmin/service/src/main/java/org/apache/felix/deploymentadmin/BundleInfoImpl.java Tue Aug 11 12:51:18 2009
@@ -18,6 +18,7 @@
*/
package org.apache.felix.deploymentadmin;
+import java.util.StringTokenizer;
import java.util.jar.Attributes;
import org.osgi.framework.Version;
@@ -49,7 +50,7 @@
} else if (bundleSymbolicName.trim().equals("")) {
throw new DeploymentException(DeploymentException.CODE_BAD_HEADER, "Invalid '" + org.osgi.framework.Constants.BUNDLE_SYMBOLICNAME + "' header for manifest entry '" + getPath() + "'");
} else {
- m_symbolicName = bundleSymbolicName;
+ m_symbolicName = parseSymbolicName(bundleSymbolicName);
}
String version = attributes.getValue(org.osgi.framework.Constants.BUNDLE_VERSION);
@@ -64,6 +65,19 @@
m_customizer = parseBooleanHeader(attributes, Constants.DEPLOYMENTPACKAGE_CUSTOMIZER);
}
+
+ /**
+ * Strips parameters from the bundle symbolic name such as "foo;singleton:=true".
+ *
+ * @param name full name as found in the manifest of the deployment package
+ * @return name without parameters
+ */
+ private String parseSymbolicName(String name) {
+ // note that we don't explicitly check if there are tokens, because that
+ // check has already been made before we are invoked here
+ StringTokenizer st = new StringTokenizer(name, ";");
+ return st.nextToken();
+ }
public String getSymbolicName() {
return m_symbolicName;