Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Watson2012-08-24 16:48:01 +0000
committerIan Bull2012-08-24 16:48:01 +0000
commit1717985563f49ce879441bb65d6eae80adef64e9 (patch)
tree60bd0c94a020ae1ff621f14edb515d8ba3748365
parentbf5fa3b9da8e61a0447155239eeb23c209ab4190 (diff)
downloadrt.equinox.p2-1717985563f49ce879441bb65d6eae80adef64e9.tar.gz
rt.equinox.p2-1717985563f49ce879441bb65d6eae80adef64e9.tar.xz
rt.equinox.p2-1717985563f49ce879441bb65d6eae80adef64e9.zip
bug 387611: We were comparing a String to a version.
We were using the String representation of a version and comparing it to the version to see if they were equal. This fixes this by properly constructing a 'version' object from the string first. When installing new bundles p2 always immediately updates the bundle https://bugs.eclipse.org/bugs/show_bug.cgi?id=387611
-rw-r--r--bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/ConfigApplier.java21
1 files changed, 17 insertions, 4 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 06e259597..dc3ca9693 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
@@ -195,10 +195,21 @@ class ConfigApplier {
if (current == null) {
try {
current = manipulatingContext.installBundle(bundleLocation);
- if (!version.equals(current.getVersion()) || !symbolicName.equals(current.getSymbolicName()))
- // can happen if, for example, the new version of the bundle is installed
- // to the same bundle location as the old version
- current.update();
+ if (symbolicName != null && version != null) {
+ Version v;
+ try {
+ v = new Version(version);
+ if (!symbolicName.equals(current.getSymbolicName()) || !v.equals(current.getVersion())) {
+ // can happen if, for example, the new version of the bundle is installed
+ // to the same bundle location as the old version
+ current.update();
+ }
+ } catch (IllegalArgumentException e) {
+ // invalid version string; should log
+ if (Activator.DEBUG)
+ e.printStackTrace();
+ }
+ }
if (Activator.DEBUG)
System.out.println("installed bundle:" + finalList[i]); //$NON-NLS-1$
@@ -307,6 +318,8 @@ class ConfigApplier {
continue;
if (packageAdminService.getBundleType(bundle) == PackageAdmin.BUNDLE_TYPE_FRAGMENT)
continue;
+ if (bundle.getBundleId() == 0)
+ continue;
try {
bundle.start();

Back to the top