summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault2013-01-18 21:06:23 (EST)
committerPascal Rapicault2013-01-18 21:06:23 (EST)
commit7008623c6ce66cc8d552b263d9c0f9c0815f5436 (patch)
treeda3391e358023719839857b2044d68acb07de71e
parentdf783ddd2a409f741110210442cfcf0867e23e71 (diff)
downloadrt.equinox.p2-7008623c6ce66cc8d552b263d9c0f9c0815f5436.zip
rt.equinox.p2-7008623c6ce66cc8d552b263d9c0f9c0815f5436.tar.gz
rt.equinox.p2-7008623c6ce66cc8d552b263d9c0f9c0815f5436.tar.bz2
Bug 363590 - sort entries of the bundles.info in decreasing versionv20130119-020623
order
-rw-r--r--bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/equinox/internal/simpleconfigurator/manipulator/SimpleConfiguratorManipulatorUtils.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/equinox/internal/simpleconfigurator/manipulator/SimpleConfiguratorManipulatorUtils.java b/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/equinox/internal/simpleconfigurator/manipulator/SimpleConfiguratorManipulatorUtils.java
index 9e2ab18..c72ef35 100644
--- a/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/equinox/internal/simpleconfigurator/manipulator/SimpleConfiguratorManipulatorUtils.java
+++ b/bundles/org.eclipse.equinox.simpleconfigurator.manipulator/src/org/eclipse/equinox/internal/simpleconfigurator/manipulator/SimpleConfiguratorManipulatorUtils.java
@@ -63,7 +63,13 @@ public class SimpleConfiguratorManipulatorUtils {
Arrays.sort(simpleInfos, new Comparator() {
public int compare(Object o1, Object o2) {
if (o1 instanceof BundleInfo && o2 instanceof BundleInfo) {
- return ((BundleInfo) o1).getSymbolicName().compareTo(((BundleInfo) o2).getSymbolicName());
+ BundleInfo b1 = (BundleInfo) o1;
+ BundleInfo b2 = (BundleInfo) o2;
+ int bsnComparison = b1.getSymbolicName().compareTo(b2.getSymbolicName());
+ if (bsnComparison != 0)
+ return bsnComparison;
+ // prefer latest version, see https://bugs.eclipse.org/363590
+ return new Version(b2.getVersion()).compareTo(new Version(b1.getVersion()));
}
return 0;
}