diff options
author | Alexander Kurtakov | 2020-05-11 05:18:14 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2020-05-11 15:30:19 +0000 |
commit | 0def880e929be4b7c72c38b34aa8554a94614bfd (patch) | |
tree | 9ceff5846edf5dc98bb1c77fdf569cccbc71e1eb /bundles/org.eclipse.equinox.p2.director/src | |
parent | a07f3fa8e690b3539d951d4841d9f7c60f27ce92 (diff) | |
download | rt.equinox.p2-0def880e929be4b7c72c38b34aa8554a94614bfd.tar.gz rt.equinox.p2-0def880e929be4b7c72c38b34aa8554a94614bfd.tar.xz rt.equinox.p2-0def880e929be4b7c72c38b34aa8554a94614bfd.zip |
Use List.sort directly.S4_16_0_M3I20200521-1000I20200520-1800I20200520-0600I20200519-1800I20200519-1130I20200519-1010I20200518-2220I20200518-1800I20200516-0600I20200515-1930I20200514-1800I20200513-1800I20200512-1800I20200511-1800
Rather than Collections.sort(list)
Change-Id: Idbc2a436629107cd5a5143d41965e282813ebad5
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.director/src')
4 files changed, 10 insertions, 10 deletions
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/OperationGenerator.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/OperationGenerator.java index e7334a627..1929396c0 100644 --- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/OperationGenerator.java +++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/OperationGenerator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2017 IBM Corporation and others. + * Copyright (c) 2007, 2020 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -36,10 +36,10 @@ public class OperationGenerator { tmpTo.removeAll(intersection); List<IInstallableUnit> from = new ArrayList<>(tmpFrom); - Collections.sort(from); + from.sort(null); List<IInstallableUnit> to = new ArrayList<>(tmpTo); - Collections.sort(to); + to.sort(null); generateUpdates(from, to); generateInstallUninstall(from, to); diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/OptimizationFunction.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/OptimizationFunction.java index 51050fb7c..1d3cc1e80 100644 --- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/OptimizationFunction.java +++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/OptimizationFunction.java @@ -73,7 +73,7 @@ public class OptimizationFunction { } // Set the weight such that things that are already installed are not updated - Collections.sort(conflictingEntries, Collections.reverseOrder()); + conflictingEntries.sort(Collections.reverseOrder()); BigInteger weight = POWER; // have we already found a version that is already installed? boolean foundInstalled = false; diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Projector.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Projector.java index 36b0e7122..808c70e83 100644 --- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Projector.java +++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Projector.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2018 IBM Corporation and others. + * Copyright (c) 2007, 2020 IBM Corporation and others. * * This * program and the accompanying materials are made available under the terms of @@ -232,7 +232,7 @@ public class Projector { dependencyHelper = new DependencyHelper<>(solver); } List<IInstallableUnit> iusToOrder = new ArrayList<>(queryResult.toSet()); - Collections.sort(iusToOrder); + iusToOrder.sort(null); for (IInstallableUnit iu : iusToOrder) { if (monitor.isCanceled()) { result.merge(Status.CANCEL_STATUS); @@ -1009,7 +1009,7 @@ public class Projector { private void printSolution(Collection<IInstallableUnit> state) { ArrayList<IInstallableUnit> l = new ArrayList<>(state); - Collections.sort(l); + l.sort(null); Tracing.debug("Solution:"); //$NON-NLS-1$ Tracing.debug("Numbers of IUs selected: " + l.size()); //$NON-NLS-1$ for (IInstallableUnit s : l) { diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/UserDefinedOptimizationFunction.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/UserDefinedOptimizationFunction.java index 4f699cf25..f5cd7da1d 100644 --- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/UserDefinedOptimizationFunction.java +++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/UserDefinedOptimizationFunction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2017 Daniel Le Berre and others. + * Copyright (c) 2009, 2020 Daniel Le Berre and others. * * This * program and the accompanying materials are made available under the terms of @@ -152,8 +152,8 @@ public class UserDefinedOptimizationFunction extends OptimizationFunction { IQuery<IInstallableUnit> query = QueryUtil.createMatchQuery(req.getMatches()); IQueryResult<IInstallableUnit> matches = picker.query(query, null); List<IInstallableUnit> toSort = new ArrayList<>(matches.toUnmodifiableSet()); - Collections.sort(toSort, Collections.reverseOrder()); - if (toSort.size() == 0) + toSort.sort(Collections.reverseOrder()); + if (toSort.isEmpty()) continue; Projector.AbstractVariable abs = new Projector.AbstractVariable(); |