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 2011/09/20 22:14:49 UTC
svn commit: r1173329 -
/felix/trunk/framework/src/main/java/org/apache/felix/framework/BundleImpl.java
Author: rickhall
Date: Tue Sep 20 20:14:48 2011
New Revision: 1173329
URL: http://svn.apache.org/viewvc?rev=1173329&view=rev
Log:
Implement support for allowing duplicate BSN/version pairs. (FELIX-3124)
Modified:
felix/trunk/framework/src/main/java/org/apache/felix/framework/BundleImpl.java
Modified: felix/trunk/framework/src/main/java/org/apache/felix/framework/BundleImpl.java
URL: http://svn.apache.org/viewvc/felix/trunk/framework/src/main/java/org/apache/felix/framework/BundleImpl.java?rev=1173329&r1=1173328&r2=1173329&view=diff
==============================================================================
--- felix/trunk/framework/src/main/java/org/apache/felix/framework/BundleImpl.java (original)
+++ felix/trunk/framework/src/main/java/org/apache/felix/framework/BundleImpl.java Tue Sep 20 20:14:48 2011
@@ -1198,8 +1198,15 @@ class BundleImpl implements Bundle, Bund
headerMap,
m_archive.getCurrentRevision().getContent());
- // Verify that the bundle symbolic name + version is unique.
- if (revision.getManifestVersion().equals("2"))
+ // For R4 bundles, verify that the bundle symbolic name + version
+ // is unique unless this check has been disabled.
+ String allowMultiple =
+ (String) getFramework().getConfig().get(Constants.FRAMEWORK_BSNVERSION);
+ allowMultiple = (allowMultiple == null)
+ ? Constants.FRAMEWORK_BSNVERSION_SINGLE
+ : allowMultiple;
+ if (revision.getManifestVersion().equals("2")
+ && !allowMultiple.equals(Constants.FRAMEWORK_BSNVERSION_MULTIPLE))
{
Version bundleVersion = revision.getVersion();
bundleVersion = (bundleVersion == null) ? Version.emptyVersion : bundleVersion;