Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault (Ericsson)2013-04-29 20:18:10 +0000
committerPascal Rapicault2013-04-29 20:18:10 +0000
commitd287d7ac898af36e2e4aba587218528b5956ca80 (patch)
tree51a369fc03023120aa6690d249bf8650dd92b01e
parentd4d2021e730b888556662d304bda7fbaa798faed (diff)
downloadrt.equinox.p2-d287d7ac898af36e2e4aba587218528b5956ca80.tar.gz
rt.equinox.p2-d287d7ac898af36e2e4aba587218528b5956ca80.tar.xz
rt.equinox.p2-d287d7ac898af36e2e4aba587218528b5956ca80.zip
Bug 406377 - [shared] previous configuration finder does not always find
highest version
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/PreviousConfigurationFinderTest.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/PreviousConfigurationFinder.java6
2 files changed, 5 insertions, 3 deletions
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/PreviousConfigurationFinderTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/PreviousConfigurationFinderTest.java
index e7f97b8ad..1d3c18327 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/PreviousConfigurationFinderTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/sharedinstall/PreviousConfigurationFinderTest.java
@@ -102,7 +102,7 @@ public class PreviousConfigurationFinderTest extends AbstractProvisioningTest {
List<ConfigurationDescriptor> configs = new PreviousConfigurationFinder(configFolder).readPreviousConfigurations(configFolder);
ConfigurationDescriptor match = new PreviousConfigurationFinder(configFolder).findMostRelevantConfigurationFromProductId(configs, referenceConfiguration);
assertEquals("org.eclipse.platform", match.getProductId());
- assertEquals(new Identifier(3, 8, 0), match.getVersion());
+ assertEquals(new Identifier(3, 8, 1), match.getVersion());
assertNull(match.getPlatformConfig());
}
diff --git a/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/PreviousConfigurationFinder.java b/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/PreviousConfigurationFinder.java
index a948163d9..b798159de 100644
--- a/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/PreviousConfigurationFinder.java
+++ b/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/PreviousConfigurationFinder.java
@@ -195,7 +195,8 @@ public class PreviousConfigurationFinder {
bestMatch = candidate;
}
} else {
- bestMatch = candidate;
+ if (candidate.getVersion().isGreaterEqualTo(bestMatch.getVersion()))
+ bestMatch = candidate;
}
}
}
@@ -229,7 +230,8 @@ public class PreviousConfigurationFinder {
bestMatch = candidate;
}
} else {
- bestMatch = candidate;
+ if (candidate.getVersion().isGreaterEqualTo(bestMatch.getVersion()))
+ bestMatch = candidate;
}
}
}

Back to the top