Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2013-11-19 03:22:45 -0500
committerGerrit Code Review @ Eclipse.org2013-11-19 04:08:59 -0500
commit1eece4f1366d56ff50e5b41df6c2845fef0214ad (patch)
tree99856307405eefe819f385375658141a2e6a17ca /bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2
parente193ccd994def3fd574aee5335e8cf8a1c610ae4 (diff)
downloadrt.equinox.p2-1eece4f1366d56ff50e5b41df6c2845fef0214ad.tar.gz
rt.equinox.p2-1eece4f1366d56ff50e5b41df6c2845fef0214ad.tar.xz
rt.equinox.p2-1eece4f1366d56ff50e5b41df6c2845fef0214ad.zip
Bug 422026 - Get rid of ColletionUtils.empty[Set|List|Map]
Now that p2 has Java 1.5 as a minimum there is no reason to not use the JVM methods. Change-Id: I89444e8d1e174c316e2b17fb4f53bc7b1d097c0a Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2')
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/OptimizationFunction.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/ProfileChangeRequest.java11
-rw-r--r--bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/Projector.java5
3 files changed, 9 insertions, 12 deletions
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 fb939a8eb..215c737b6 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
@@ -13,7 +13,6 @@ import java.math.BigInteger;
import java.util.*;
import java.util.Map.Entry;
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils;
import org.eclipse.equinox.internal.p2.director.Projector.AbstractVariable;
import org.eclipse.equinox.p2.metadata.*;
import org.eclipse.equinox.p2.query.*;
@@ -43,11 +42,11 @@ public class OptimizationFunction {
Set<IInstallableUnit> transitiveClosure; //The transitive closure of the IUs we are adding (this also means updating)
if (newRoots.isEmpty()) {
- transitiveClosure = CollectionUtils.emptySet();
+ transitiveClosure = Collections.<IInstallableUnit> emptySet();
} else {
IQueryable<IInstallableUnit> queryable = new Slicer(picker, selectionContext, false).slice(newRoots.toArray(new IInstallableUnit[newRoots.size()]), new NullProgressMonitor());
if (queryable == null) {
- transitiveClosure = CollectionUtils.emptySet();
+ transitiveClosure = Collections.<IInstallableUnit> emptySet();
} else {
transitiveClosure = queryable.query(QueryUtil.ALL_UNITS, new NullProgressMonitor()).toSet();
}
diff --git a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/ProfileChangeRequest.java b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/ProfileChangeRequest.java
index 4621b5d74..e20b755d8 100644
--- a/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/ProfileChangeRequest.java
+++ b/bundles/org.eclipse.equinox.p2.director/src/org/eclipse/equinox/internal/p2/director/ProfileChangeRequest.java
@@ -12,7 +12,6 @@
package org.eclipse.equinox.internal.p2.director;
import java.util.*;
-import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils;
import org.eclipse.equinox.p2.core.IProvisioningAgent;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProfileRegistry;
@@ -168,7 +167,7 @@ public class ProfileChangeRequest implements Cloneable, IProfileChangeRequest {
public Collection<IInstallableUnit> getRemovals() {
if (iusToRemove == null)
- return CollectionUtils.emptyList();
+ return Collections.<IInstallableUnit> emptyList();
return Collections.unmodifiableList(iusToRemove);
}
@@ -177,7 +176,7 @@ public class ProfileChangeRequest implements Cloneable, IProfileChangeRequest {
*/
public Collection<IInstallableUnit> getAdditions() {
if (iusToAdd == null)
- return CollectionUtils.emptyList();
+ return Collections.<IInstallableUnit> emptyList();
return Collections.unmodifiableList(iusToAdd);
}
@@ -191,14 +190,14 @@ public class ProfileChangeRequest implements Cloneable, IProfileChangeRequest {
// map of key value pairs
public Map<String, String> getPropertiesToAdd() {
if (propertiesToAdd == null)
- return CollectionUtils.emptyMap();
+ return Collections.<String, String> emptyMap();
return propertiesToAdd;
}
// map of iu->list of property keys to be removed for an iu
public Map<IInstallableUnit, List<String>> getInstallableUnitProfilePropertiesToRemove() {
if (iuPropertiesToRemove == null)
- return CollectionUtils.emptyMap();
+ return Collections.<IInstallableUnit, List<String>> emptyMap();
return iuPropertiesToRemove;
}
@@ -206,7 +205,7 @@ public class ProfileChangeRequest implements Cloneable, IProfileChangeRequest {
// map iu->map of key->value pairs for properties to be added for an iu
public Map<IInstallableUnit, Map<String, String>> getInstallableUnitProfilePropertiesToAdd() {
if (iuPropertiesToAdd == null)
- return CollectionUtils.emptyMap();
+ return Collections.<IInstallableUnit, Map<String, String>> emptyMap();
return iuPropertiesToAdd;
}
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 48c3871a1..a52c57ee5 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
@@ -19,7 +19,6 @@ import java.util.*;
import java.util.Map.Entry;
import org.eclipse.core.runtime.*;
import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils;
import org.eclipse.equinox.internal.p2.core.helpers.Tracing;
import org.eclipse.equinox.internal.p2.director.Explanation.NotInstallableRoot;
import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability;
@@ -147,7 +146,7 @@ public class Projector {
} finally {
//must never have a null result, because caller is waiting on result to be non-null
if (explanation == null)
- explanation = CollectionUtils.emptySet();
+ explanation = Collections.<Explanation> emptySet();
}
synchronized (this) {
ExplanationJob.this.notify();
@@ -812,7 +811,7 @@ public class Projector {
IRequirement req = patch.getLifeCycle();
if (req == null)
return;
- expandRequirement(req, iu, CollectionUtils.<AbstractVariable> emptyList(), isRootIu);
+ expandRequirement(req, iu, Collections.<AbstractVariable> emptyList(), isRootIu);
}
private void missingRequirement(IInstallableUnit iu, IRequirement req) throws ContradictionException {

Back to the top