Bug 497094 - Check for no symbolic name before calling PackageAdmin
Change-Id: I18e56f297188c32a412127da36d4917bf1cc9944
Signed-off-by: Thomas Watson <tjwatson@us.ibm.com>
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 32d0792..84352f7 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
@@ -397,11 +397,14 @@
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));
+ String bsn = bundle.getLocation();
+ if (bsn != null) {
+ // look for others with same BSN
+ Bundle[] sameBSNs = packageAdminService.getBundles(bsn, null);
+ if (sameBSNs != null) {
+ // likely contains the bundle we just added above but a set is used
+ allSameBSNs.addAll(Arrays.asList(sameBSNs));
+ }
}
}