Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Watson2016-04-22 20:07:56 +0000
committerThomas Watson2016-04-22 20:07:56 +0000
commit9f601c61e10aa2c996240b63f34d18dc2a1cc41f (patch)
tree1fdd64b3551ede00ab4b6020c782eb811cea3638
parentae7c096597eaaed93d9832a41f3065792f9b41c5 (diff)
downloadrt.equinox.p2-9f601c61e10aa2c996240b63f34d18dc2a1cc41f.tar.gz
rt.equinox.p2-9f601c61e10aa2c996240b63f34d18dc2a1cc41f.tar.xz
rt.equinox.p2-9f601c61e10aa2c996240b63f34d18dc2a1cc41f.zip
Bug 449365 - Refresh all bundles of the same symbolic name whenI20160425-0800I20160424-2245
installing new versions Change-Id: I31aef843db00a7b7cd6204edbf0568a66304b816 Signed-off-by: Thomas Watson <tjwatson@us.ibm.com>
-rw-r--r--bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/ConfigApplier.java19
1 files changed, 17 insertions, 2 deletions
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/ConfigApplier.java b/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/ConfigApplier.java
index 94355c254..32d079256 100644
--- a/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/ConfigApplier.java
+++ b/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/ConfigApplier.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2015 IBM Corporation and others. All rights reserved.
+ * Copyright (c) 2007, 2016 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 which accompanies this distribution,
* and is available at http://www.eclipse.org/legal/epl-v10.html
@@ -390,6 +390,21 @@ class ConfigApplier {
if (bundles.length == 0 || packageAdminService == null)
return;
+ // Prior to Luna the Equinox framework would refresh all bundles with the same
+ // BSN automatically. This is no longer the case for Luna or other framework
+ // implementations. Here we want to make sure all existing bundles with the
+ // same BSN are refreshed also.
+ Set<Bundle> allSameBSNs = new LinkedHashSet<Bundle>(); // maintain order and avoid duplicates
+ for (Bundle bundle : bundles) {
+ allSameBSNs.add(bundle);
+ // look for others with same BSN
+ Bundle[] sameBSNs = packageAdminService.getBundles(bundle.getSymbolicName(), null);
+ if (sameBSNs != null) {
+ // likely contains the bundle we just added above but a set is used
+ allSameBSNs.addAll(Arrays.asList(sameBSNs));
+ }
+ }
+
final boolean[] flag = new boolean[] {false};
FrameworkListener listener = new FrameworkListener() {
public void frameworkEvent(FrameworkEvent event) {
@@ -402,7 +417,7 @@ class ConfigApplier {
}
};
context.addFrameworkListener(listener);
- packageAdminService.refreshPackages(bundles);
+ packageAdminService.refreshPackages(allSameBSNs.toArray(new Bundle[0]));
synchronized (flag) {
while (!flag[0]) {
try {

Back to the top