diff options
author | Alexander Kurtakov | 2013-11-19 08:22:45 +0000 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org | 2013-11-19 09:08:59 +0000 |
commit | 1eece4f1366d56ff50e5b41df6c2845fef0214ad (patch) | |
tree | 99856307405eefe819f385375658141a2e6a17ca | |
parent | e193ccd994def3fd574aee5335e8cf8a1c610ae4 (diff) | |
download | rt.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>
44 files changed, 84 insertions, 154 deletions
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/KeyIndex.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/KeyIndex.java index 445543289..24c42743c 100644 --- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/KeyIndex.java +++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/KeyIndex.java @@ -69,11 +69,11 @@ public class KeyIndex extends Index<IArtifactKey> { } } if (collector == null) - collector = CollectionUtils.emptySet(); + collector = Collections.<IArtifactKey> emptySet(); } else { Object v = artifactMap.get(queriedKeys); if (v == null) - collector = CollectionUtils.emptySet(); + collector = Collections.<IArtifactKey> emptySet(); else if (v instanceof IArtifactKey) collector = Collections.singleton((IArtifactKey) v); else diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/CollectionUtils.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/CollectionUtils.java index 5bea8c961..edbf40ab5 100644 --- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/CollectionUtils.java +++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/CollectionUtils.java @@ -166,47 +166,13 @@ public class CollectionUtils { } /** - * The emptyList() method was introduced in Java 1.5 so we need this here to be able to - * down compile to 1.4. - * @param <T> The type of the elements - * @return An empty list - */ - @SuppressWarnings("unchecked") - public static <T> List<T> emptyList() { - return Collections.EMPTY_LIST; - } - - /** - * The emptySet() method was introduced in Java 1.5 so we need this here to be able to - * down compile to 1.4. - * @param <T> The type of the elements - * @return An empty set - */ - @SuppressWarnings("unchecked") - public static <T> Set<T> emptySet() { - return Collections.EMPTY_SET; - } - - /** - * The emptyMap() method was introduced in Java 1.5 so we need this here to be able to - * down compile to 1.4. - * @param <K> The type of the map keys - * @param <V> The type of the map values - * @return An empty set - */ - @SuppressWarnings("unchecked") - public static <K, V> Map<K, V> emptyMap() { - return Collections.EMPTY_MAP; - } - - /** * Returns an unmodifiable list that is backed by the <code>array</code>. * @param <T> The list element type * @param array The array of elements * @return The unmodifiable list */ public static <T> List<T> unmodifiableList(T[] array) { - return array == null || array.length == 0 ? CollectionUtils.<T> emptyList() : new UnmodifiableArrayList<T>(array); + return array == null || array.length == 0 ? Collections.<T> emptyList() : new UnmodifiableArrayList<T>(array); } /** @@ -229,7 +195,7 @@ public class CollectionUtils { */ public static Map<String, String> toMap(Properties properties) { if (properties == null || properties.isEmpty()) - return emptyMap(); + return Collections.<String, String> emptyMap(); Map<String, String> props = new HashMap<String, String>(properties.size()); putAll(properties, props); diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/OrderedProperties.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/OrderedProperties.java index cf20a741e..45676cb57 100644 --- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/OrderedProperties.java +++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/helpers/OrderedProperties.java @@ -109,7 +109,7 @@ public class OrderedProperties extends Dictionary<String, String> implements Map } public Set<Map.Entry<String, String>> entrySet() { - return propertyMap != null ? propertyMap.entrySet() : CollectionUtils.<Map.Entry<String, String>> emptySet(); + return propertyMap != null ? propertyMap.entrySet() : Collections.<Map.Entry<String, String>> emptySet(); } public String get(Object key) { @@ -117,7 +117,7 @@ public class OrderedProperties extends Dictionary<String, String> implements Map } public Set<String> keySet() { - return propertyMap != null ? propertyMap.keySet() : CollectionUtils.<String> emptySet(); + return propertyMap != null ? propertyMap.keySet() : Collections.<String> emptySet(); } public void putAll(Map<? extends String, ? extends String> arg0) { @@ -130,7 +130,7 @@ public class OrderedProperties extends Dictionary<String, String> implements Map } public Collection<String> values() { - return propertyMap != null ? propertyMap.values() : CollectionUtils.<String> emptyList(); + return propertyMap != null ? propertyMap.values() : Collections.<String> emptyList(); } public boolean equals(Object o) { 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 { diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/InstallableUnitPhase.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/InstallableUnitPhase.java index d2ec31645..0045d8c79 100644 --- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/InstallableUnitPhase.java +++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/InstallableUnitPhase.java @@ -13,7 +13,6 @@ package org.eclipse.equinox.internal.p2.engine; import java.util.*; import org.eclipse.core.runtime.*; -import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils; import org.eclipse.equinox.p2.engine.IProfile; import org.eclipse.equinox.p2.engine.spi.ProvisioningAction; import org.eclipse.equinox.p2.engine.spi.Touchpoint; @@ -109,7 +108,7 @@ public abstract class InstallableUnitPhase extends Phase { Collection<ITouchpointData> data = unit.getTouchpointData(); int dataSize = data.size(); if (dataSize == 0) - return CollectionUtils.emptyList(); + return Collections.<ITouchpointInstruction> emptyList(); ArrayList<ITouchpointInstruction> matches = new ArrayList<ITouchpointInstruction>(dataSize); for (ITouchpointData td : data) { diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/InstructionParser.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/InstructionParser.java index f2de40a53..31a77f98a 100644 --- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/InstructionParser.java +++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/InstructionParser.java @@ -12,7 +12,6 @@ package org.eclipse.equinox.internal.p2.engine; import java.util.*; import org.eclipse.core.runtime.Assert; -import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils; import org.eclipse.equinox.p2.engine.spi.ProvisioningAction; import org.eclipse.equinox.p2.metadata.*; import org.eclipse.osgi.util.NLS; @@ -50,7 +49,7 @@ public class InstructionParser { private Map<String, ActionEntry> parseImportAttribute(String importAttribute) { if (importAttribute == null) - return CollectionUtils.emptyMap(); + return Collections.<String, ActionEntry> emptyMap(); Map<String, ActionEntry> result = new HashMap<String, ActionEntry>(); StringTokenizer tokenizer = new StringTokenizer(importAttribute, ","); //$NON-NLS-1$ @@ -83,7 +82,7 @@ public class InstructionParser { String nameValuePairs = statement.substring(openBracket + 1, closeBracket); if (nameValuePairs.length() == 0) - return new ParameterizedProvisioningAction(action, CollectionUtils.<String, String> emptyMap(), statement); + return new ParameterizedProvisioningAction(action, Collections.<String, String> emptyMap(), statement); StringTokenizer tokenizer = new StringTokenizer(nameValuePairs, ","); //$NON-NLS-1$ Map<String, String> parameters = new HashMap<String, String>(); diff --git a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/Profile.java b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/Profile.java index a5c19951f..1572bf9ee 100644 --- a/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/Profile.java +++ b/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/Profile.java @@ -15,7 +15,6 @@ import java.util.*; import java.util.Map.Entry; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils; import org.eclipse.equinox.internal.p2.core.helpers.OrderedProperties; import org.eclipse.equinox.internal.p2.metadata.*; import org.eclipse.equinox.internal.p2.metadata.index.*; @@ -149,7 +148,7 @@ public class Profile extends IndexProvider<IInstallableUnit> implements IProfile */ public List<String> getSubProfileIds() { if (subProfileIds == null) - return CollectionUtils.emptyList(); + return Collections.<String> emptyList(); return Collections.unmodifiableList(subProfileIds); } diff --git a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepository.java b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepository.java index 02b39a477..271a9a17d 100644 --- a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepository.java +++ b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepository.java @@ -16,7 +16,6 @@ import java.io.FilenameFilter; import java.net.URI; import java.util.*; import org.eclipse.core.runtime.*; -import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils; import org.eclipse.equinox.p2.core.IProvisioningAgent; import org.eclipse.equinox.p2.core.ProvisionException; import org.eclipse.equinox.p2.metadata.IInstallableUnit; @@ -88,7 +87,7 @@ public class ExtensionLocationMetadataRepository extends AbstractMetadataReposit * @see org.eclipse.equinox.p2.repository.metadata.IMetadataRepository#getReferences() */ public Collection<IRepositoryReference> getReferences() { - return CollectionUtils.emptyList(); + return Collections.emptyList(); } /* (non-Javadoc) diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/LocalMetadataRepository.java b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/LocalMetadataRepository.java index 45a196a07..671a3245d 100644 --- a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/LocalMetadataRepository.java +++ b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/LocalMetadataRepository.java @@ -17,7 +17,6 @@ import java.util.*; import java.util.jar.JarEntry; import java.util.jar.JarOutputStream; import org.eclipse.core.runtime.*; -import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils; import org.eclipse.equinox.internal.p2.core.helpers.LogHelper; import org.eclipse.equinox.internal.p2.metadata.*; import org.eclipse.equinox.internal.p2.metadata.index.*; @@ -197,7 +196,7 @@ public class LocalMetadataRepository extends AbstractMetadataRepository implemen private synchronized List<IRepositoryReference> createRepositoriesSnapshot() { if (repositories.isEmpty()) - return CollectionUtils.emptyList(); + return Collections.<IRepositoryReference> emptyList(); return new ArrayList<IRepositoryReference>(repositories); } diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/IUMap.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/IUMap.java index 674387912..bc2f95c30 100644 --- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/IUMap.java +++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/IUMap.java @@ -162,7 +162,7 @@ public class IUMap implements Cloneable { public Collection<IInstallableUnit> getUnits(String id) { Object bucket = units.get(id); if (bucket == null) - return CollectionUtils.emptyList(); + return Collections.<IInstallableUnit> emptyList(); return bucket.getClass().isArray() ? CollectionUtils.unmodifiableList((IInstallableUnit[]) bucket) : Collections.<IInstallableUnit> singletonList((IInstallableUnit) bucket); } diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/InstallableUnit.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/InstallableUnit.java index 8248f16a9..48dcf2344 100644 --- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/InstallableUnit.java +++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/InstallableUnit.java @@ -131,7 +131,7 @@ public class InstallableUnit implements IInstallableUnit, IMemberProvider { } public Collection<IInstallableUnitFragment> getFragments() { - return CollectionUtils.emptyList(); + return Collections.<IInstallableUnitFragment> emptyList(); } public String getId() { diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/ResolvedInstallableUnit.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/ResolvedInstallableUnit.java index f9d98b4f9..7e036b69e 100644 --- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/ResolvedInstallableUnit.java +++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/ResolvedInstallableUnit.java @@ -12,7 +12,6 @@ package org.eclipse.equinox.internal.p2.metadata; import java.util.*; -import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils; import org.eclipse.equinox.p2.metadata.*; import org.eclipse.equinox.p2.metadata.expression.IMatchExpression; import org.eclipse.equinox.p2.metadata.expression.IMemberProvider; @@ -38,7 +37,7 @@ public class ResolvedInstallableUnit implements IInstallableUnit, IMemberProvide public Collection<IInstallableUnitFragment> getFragments() { int fcount = fragments.length; if (fcount == 0) - return CollectionUtils.emptyList(); + return Collections.<IInstallableUnitFragment> emptyList(); ArrayList<IInstallableUnitFragment> result = new ArrayList<IInstallableUnitFragment>(fcount); result.addAll(Arrays.asList(fragments)); diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/expression/Everything.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/expression/Everything.java index 52758ad32..4cc51cff9 100644 --- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/expression/Everything.java +++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/expression/Everything.java @@ -10,9 +10,7 @@ *******************************************************************************/ package org.eclipse.equinox.internal.p2.metadata.expression; -import java.util.Collection; -import java.util.Iterator; -import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils; +import java.util.*; import org.eclipse.equinox.p2.metadata.index.IIndexProvider; /** @@ -24,7 +22,7 @@ public final class Everything<T> extends MatchIteratorFilter<T> implements IRepe private final Class<? extends T> elementClass; public Everything(Class<? extends T> elementClass, Collection<T> collection) { - super(RepeatableIterator.<T> create(collection == null ? CollectionUtils.<T> emptyList() : collection)); + super(RepeatableIterator.<T> create(collection == null ? Collections.<T> emptyList() : collection)); this.elementClass = elementClass; } diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/expression/Expression.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/expression/Expression.java index 9cdbd5226..7966215ae 100644 --- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/expression/Expression.java +++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/expression/Expression.java @@ -11,7 +11,6 @@ package org.eclipse.equinox.internal.p2.metadata.expression; import java.util.*; -import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils; import org.eclipse.equinox.internal.p2.metadata.InstallableUnit; import org.eclipse.equinox.p2.metadata.IInstallableUnit; import org.eclipse.equinox.p2.metadata.expression.*; @@ -342,7 +341,7 @@ public abstract class Expression implements IExpression, Comparable<Expression>, } List<String> getMembers() { - return members == null ? CollectionUtils.<String> emptyList() : members; + return members == null ? Collections.<String> emptyList() : members; } } diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/expression/Limit.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/expression/Limit.java index 8a02b0e8a..5a5a1e5f2 100644 --- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/expression/Limit.java +++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/expression/Limit.java @@ -10,9 +10,7 @@ *******************************************************************************/ package org.eclipse.equinox.internal.p2.metadata.expression; -import java.util.Iterator; -import java.util.NoSuchElementException; -import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils; +import java.util.*; import org.eclipse.equinox.p2.metadata.expression.IEvaluationContext; /** @@ -68,7 +66,7 @@ final class Limit extends Binary { limit = ((Integer) rval).intValue(); if (limit < 0) throw new IllegalArgumentException("limit expression did not evalutate to a positive integer"); //$NON-NLS-1$ - return limit == 0 ? CollectionUtils.emptySet().iterator() : new CountingIterator<Object>(lhs.evaluateAsIterator(context), limit); + return limit == 0 ? Collections.emptySet().iterator() : new CountingIterator<Object>(lhs.evaluateAsIterator(context), limit); } public int getExpressionType() { diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/expression/MemberProvider.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/expression/MemberProvider.java index cc82db7d9..dccb00397 100644 --- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/expression/MemberProvider.java +++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/expression/MemberProvider.java @@ -12,7 +12,6 @@ package org.eclipse.equinox.internal.p2.metadata.expression; import java.util.*; import java.util.Map.Entry; -import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils; import org.eclipse.equinox.p2.metadata.expression.IMemberProvider; import org.osgi.framework.ServiceReference; @@ -119,7 +118,7 @@ public abstract class MemberProvider implements IMemberProvider { } } - private static final MemberProvider emptyProvider = create(CollectionUtils.emptyMap(), false); + private static final MemberProvider emptyProvider = create(Collections.emptyMap(), false); /** * Create a new member provider on the given value. The value can be an instance of a {@link Map}, {@link Dictionary}, diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/index/CapabilityIndex.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/index/CapabilityIndex.java index c9e2056f6..a30d1f530 100644 --- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/index/CapabilityIndex.java +++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/index/CapabilityIndex.java @@ -11,7 +11,6 @@ package org.eclipse.equinox.internal.p2.metadata.index; import java.util.*; -import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils; import org.eclipse.equinox.internal.p2.metadata.*; import org.eclipse.equinox.internal.p2.metadata.expression.*; import org.eclipse.equinox.p2.metadata.*; @@ -200,7 +199,7 @@ public class CapabilityIndex extends Index<IInstallableUnit> { if (queriedKeys == Boolean.FALSE) { // It has been determined that the expression has no chance // to succeed regardless of input - matchingIUs = CollectionUtils.<IInstallableUnit> emptySet(); + matchingIUs = Collections.<IInstallableUnit> emptySet(); } else if (queriedKeys instanceof Collection<?>) { matchingIUs = new HashSet<IInstallableUnit>(); for (Object key : (Collection<Object>) queriedKeys) @@ -208,7 +207,7 @@ public class CapabilityIndex extends Index<IInstallableUnit> { } else { Object v = capabilityMap.get(queriedKeys); if (v == null) - matchingIUs = CollectionUtils.<IInstallableUnit> emptySet(); + matchingIUs = Collections.<IInstallableUnit> emptySet(); else if (v instanceof IInstallableUnit) matchingIUs = Collections.singleton((IInstallableUnit) v); else diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/index/CompoundIndex.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/index/CompoundIndex.java index 77e207f23..3caa03025 100644 --- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/index/CompoundIndex.java +++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/index/CompoundIndex.java @@ -11,7 +11,6 @@ package org.eclipse.equinox.internal.p2.metadata.index; import java.util.*; -import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils; import org.eclipse.equinox.p2.metadata.expression.IEvaluationContext; import org.eclipse.equinox.p2.metadata.expression.IExpression; import org.eclipse.equinox.p2.metadata.index.IIndex; @@ -39,7 +38,7 @@ public class CompoundIndex<T> implements IIndex<T> { } } if (result == null) - result = CollectionUtils.emptySet(); + result = Collections.emptySet(); return result.iterator(); } } diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/MetadataFactory.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/MetadataFactory.java index cd7227621..4cbaffb30 100644 --- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/MetadataFactory.java +++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/metadata/MetadataFactory.java @@ -15,7 +15,6 @@ package org.eclipse.equinox.p2.metadata; import java.net.URI; import java.util.*; import org.eclipse.core.runtime.Assert; -import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils; import org.eclipse.equinox.internal.p2.metadata.*; import org.eclipse.equinox.p2.metadata.expression.*; @@ -374,7 +373,7 @@ public final class MetadataFactory { /** * Singleton touchpoint data for a touchpoint with no instructions. */ - private static final ITouchpointData EMPTY_TOUCHPOINT_DATA = new TouchpointData(CollectionUtils.<String, ITouchpointInstruction> emptyMap()); + private static final ITouchpointData EMPTY_TOUCHPOINT_DATA = new TouchpointData(Collections.<String, ITouchpointInstruction> emptyMap()); private static ITouchpointType[] typeCache = new ITouchpointType[5]; diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/CollectionResult.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/CollectionResult.java index ef482853e..797483ecf 100644 --- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/CollectionResult.java +++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/CollectionResult.java @@ -13,7 +13,6 @@ package org.eclipse.equinox.p2.query; import java.lang.reflect.Array; import java.util.*; import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils; /** * This class allows to adapt java collections to a p2 a query result and as such something queryable @@ -23,7 +22,7 @@ public class CollectionResult<T> implements IQueryResult<T> { private final Collection<T> collection; public CollectionResult(Collection<T> collection) { - this.collection = collection == null ? CollectionUtils.<T> emptySet() : collection; + this.collection = collection == null ? Collections.<T> emptySet() : collection; } public IQueryResult<T> query(IQuery<T> query, IProgressMonitor monitor) { diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/Collector.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/Collector.java index c387ce71a..05b0826cd 100644 --- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/Collector.java +++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/Collector.java @@ -15,7 +15,6 @@ import java.lang.reflect.Array; import java.util.*; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils; import org.eclipse.equinox.internal.p2.metadata.Messages; /** @@ -107,7 +106,7 @@ public class Collector<T> implements IQueryResult<T> { * @return an iterator of the collected objects. */ public Iterator<T> iterator() { - return collected == null ? CollectionUtils.<T> emptyList().iterator() : collected.iterator(); + return collected == null ? Collections.<T> emptyList().iterator() : collected.iterator(); } /** diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/CompoundQueryable.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/CompoundQueryable.java index dab517ce7..6d1f6a58f 100644 --- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/CompoundQueryable.java +++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/p2/query/CompoundQueryable.java @@ -11,7 +11,6 @@ package org.eclipse.equinox.p2.query; import java.util.*; import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils; import org.eclipse.equinox.internal.p2.metadata.InstallableUnit; import org.eclipse.equinox.internal.p2.metadata.expression.CompoundIterator; import org.eclipse.equinox.internal.p2.metadata.index.CompoundIndex; @@ -107,7 +106,7 @@ public final class CompoundQueryable<T> extends IndexProvider<T> { public Iterator<T> everything() { if (queryables.length == 0) - return CollectionUtils.<T> emptySet().iterator(); + return Collections.<T> emptySet().iterator(); if (queryables.length == 1) return getIteratorFromQueryable(queryables[0]); @@ -150,7 +149,7 @@ public final class CompoundQueryable<T> extends IndexProvider<T> { } Iterator<T> getCapturedIterator() { - return capturedIterator == null ? CollectionUtils.<T> emptySet().iterator() : capturedIterator; + return capturedIterator == null ? Collections.<T> emptySet().iterator() : capturedIterator; } } diff --git a/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/UpdateOperation.java b/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/UpdateOperation.java index ba8dc9c77..b8bf802b2 100644 --- a/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/UpdateOperation.java +++ b/bundles/org.eclipse.equinox.p2.operations/src/org/eclipse/equinox/p2/operations/UpdateOperation.java @@ -14,7 +14,6 @@ package org.eclipse.equinox.p2.operations; import java.util.*; 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.director.ProfileChangeRequest; import org.eclipse.equinox.internal.p2.operations.*; import org.eclipse.equinox.p2.engine.IProfile; @@ -294,7 +293,7 @@ public class UpdateOperation extends ProfileChangeOperation { private Collection<IInstallableUnit> getInstalledIUs() { IProfile profile = session.getProfileRegistry().getProfile(profileId); if (profile == null) - return CollectionUtils.emptyList(); + return Collections.<IInstallableUnit> emptyList(); IQuery<IInstallableUnit> query = new UserVisibleRootQuery(); IQueryResult<IInstallableUnit> queryResult = profile.query(query, null); return queryResult.toUnmodifiableSet(); diff --git a/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/internal/p2/publisher/eclipse/ProductFile.java b/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/internal/p2/publisher/eclipse/ProductFile.java index 324c94fc5..3aa7ec9e7 100644 --- a/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/internal/p2/publisher/eclipse/ProductFile.java +++ b/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/internal/p2/publisher/eclipse/ProductFile.java @@ -21,7 +21,8 @@ import java.util.Map.Entry; import javax.xml.parsers.*; import org.eclipse.core.runtime.*; import org.eclipse.equinox.frameworkadmin.BundleInfo; -import org.eclipse.equinox.internal.p2.core.helpers.*; +import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper; +import org.eclipse.equinox.internal.p2.core.helpers.URLUtil; import org.eclipse.equinox.p2.metadata.IVersionedId; import org.eclipse.equinox.p2.metadata.VersionedId; import org.eclipse.equinox.p2.publisher.eclipse.FeatureEntry; @@ -288,7 +289,7 @@ public class ProductFile extends DefaultHandler implements IProductDescriptor { * @return A List<BundleInfo> */ public List<BundleInfo> getBundleInfos() { - return bundleInfos != null ? bundleInfos : CollectionUtils.<BundleInfo> emptyList(); + return bundleInfos != null ? bundleInfos : Collections.<BundleInfo> emptyList(); } /** diff --git a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AbstractPublisherAction.java b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AbstractPublisherAction.java index dd780e619..20980f1af 100644 --- a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AbstractPublisherAction.java +++ b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AbstractPublisherAction.java @@ -404,7 +404,7 @@ public abstract class AbstractPublisherAction implements IPublisherAction { if (currentInstructions == null) { if (advice == null || advice.isEmpty()) return; - currentInstructions = CollectionUtils.emptyMap(); + currentInstructions = Collections.emptyMap(); } ITouchpointData result = MetadataFactory.createTouchpointData(currentInstructions); diff --git a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AdviceFileAdvice.java b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AdviceFileAdvice.java index 3e872c2cf..f22d2cb1b 100644 --- a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AdviceFileAdvice.java +++ b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/p2/publisher/AdviceFileAdvice.java @@ -11,6 +11,7 @@ package org.eclipse.equinox.p2.publisher; import java.io.*; +import java.util.Collections; import java.util.Map; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; @@ -101,7 +102,7 @@ public class AdviceFileAdvice extends AbstractAdvice implements ITouchpointAdvic private static Map<String, String> loadAdviceMap(IPath basePath, IPath adviceFilePath) { File location = basePath.toFile(); if (location == null || !location.exists()) - return CollectionUtils.emptyMap(); + return Collections.<String, String> emptyMap(); ZipFile jar = null; InputStream stream = null; @@ -109,13 +110,13 @@ public class AdviceFileAdvice extends AbstractAdvice implements ITouchpointAdvic if (location.isDirectory()) { File adviceFile = new File(location, adviceFilePath.toString()); if (!adviceFile.isFile()) - return CollectionUtils.emptyMap(); + return Collections.<String, String> emptyMap(); stream = new BufferedInputStream(new FileInputStream(adviceFile)); } else if (location.isFile()) { jar = new ZipFile(location); ZipEntry entry = jar.getEntry(adviceFilePath.toString()); if (entry == null) - return CollectionUtils.emptyMap(); + return Collections.<String, String> emptyMap(); stream = new BufferedInputStream(jar.getInputStream(entry)); } @@ -124,7 +125,7 @@ public class AdviceFileAdvice extends AbstractAdvice implements ITouchpointAdvic String message = "An error occured while reading advice file: basePath=" + basePath + ", adviceFilePath=" + adviceFilePath + "."; //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ IStatus status = new Status(IStatus.ERROR, Activator.ID, message, e); LogHelper.log(status); - return CollectionUtils.emptyMap(); + return Collections.<String, String> emptyMap(); } finally { if (stream != null) try { diff --git a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/spi/p2/publisher/LocalizationHelper.java b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/spi/p2/publisher/LocalizationHelper.java index 1d36e0c74..9afe42dfa 100644 --- a/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/spi/p2/publisher/LocalizationHelper.java +++ b/bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox/spi/p2/publisher/LocalizationHelper.java @@ -147,7 +147,7 @@ public final class LocalizationHelper { } } catch (FileNotFoundException e) { // if there is no messages file then just return; - return CollectionUtils.emptyMap(); + return Collections.<String, String> emptyMap(); } return CollectionUtils.loadProperties(propertyStream); } finally { diff --git a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/PlatformXmlListener.java b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/PlatformXmlListener.java index 15eab6283..09e4111f0 100644 --- a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/PlatformXmlListener.java +++ b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/PlatformXmlListener.java @@ -16,7 +16,6 @@ import java.net.URISyntaxException; import java.util.*; import java.util.Map.Entry; import org.eclipse.core.runtime.*; -import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils; import org.eclipse.equinox.internal.p2.core.helpers.LogHelper; import org.eclipse.equinox.internal.p2.extensionlocation.*; import org.eclipse.equinox.internal.p2.update.*; @@ -140,7 +139,7 @@ public class PlatformXmlListener extends DirectoryChangeListener { public Collection<IMetadataRepository> getMetadataRepositories() { if (configRepositories == null) - return CollectionUtils.emptySet(); + return Collections.<IMetadataRepository> emptySet(); return configRepositories; } diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/mirroring/Mirroring.java b/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/mirroring/Mirroring.java index 470d47a1d..69ca5e92a 100644 --- a/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/mirroring/Mirroring.java +++ b/bundles/org.eclipse.equinox.p2.repository.tools/src/org/eclipse/equinox/p2/internal/repository/mirroring/Mirroring.java @@ -15,7 +15,6 @@ package org.eclipse.equinox.p2.internal.repository.mirroring; import java.util.*; import org.eclipse.core.runtime.*; import org.eclipse.equinox.internal.p2.artifact.repository.RawMirrorRequest; -import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils; import org.eclipse.equinox.internal.p2.repository.Transport; import org.eclipse.equinox.p2.core.ProvisionException; import org.eclipse.equinox.p2.internal.repository.tools.Activator; @@ -41,7 +40,7 @@ public class Mirroring { private boolean validate = false; private IArtifactComparator comparator; private IQuery<IArtifactDescriptor> compareExclusionQuery = null; - private Set<IArtifactDescriptor> compareExclusions = CollectionUtils.<IArtifactDescriptor> emptySet(); + private Set<IArtifactDescriptor> compareExclusions = Collections.<IArtifactDescriptor> emptySet(); private String comparatorID; private List<IArtifactKey> keysToMirror; private IArtifactMirrorLog comparatorLog; diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/IUDescription.java b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/IUDescription.java index abee0f0cb..b6cfec4be 100644 --- a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/IUDescription.java +++ b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/IUDescription.java @@ -12,7 +12,6 @@ package org.eclipse.equinox.p2.internal.repository.tools.tasks; import java.util.*; import org.apache.tools.ant.types.DataType; -import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils; import org.eclipse.equinox.p2.internal.repository.tools.Activator; import org.eclipse.equinox.p2.metadata.IInstallableUnit; import org.eclipse.equinox.p2.metadata.Version; @@ -150,7 +149,7 @@ public class IUDescription extends DataType { private Map<String, String> processQueryAttributes(String attributes) { if (attributes == null || attributes.length() == 0) - return CollectionUtils.emptyMap(); + return Collections.<String, String> emptyMap(); Map<String, String> result = new HashMap<String, String>(); int start = 0; diff --git a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/ArtifactDescriptorQuery.java b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/ArtifactDescriptorQuery.java index 778e9f5aa..e704b1763 100644 --- a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/ArtifactDescriptorQuery.java +++ b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/artifact/ArtifactDescriptorQuery.java @@ -13,7 +13,6 @@ package org.eclipse.equinox.p2.repository.artifact; import java.util.*; -import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils; import org.eclipse.equinox.p2.metadata.IArtifactKey; import org.eclipse.equinox.p2.metadata.VersionRange; import org.eclipse.equinox.p2.metadata.expression.*; @@ -41,7 +40,7 @@ public final class ArtifactDescriptorQuery extends ExpressionMatchQuery<IArtifac properties.put(IArtifactDescriptor.FORMAT, format); } } else if (properties == null) - properties = CollectionUtils.emptyMap(); + properties = Collections.<String, String> emptyMap(); IExpressionFactory factory = ExpressionUtil.getFactory(); return factory.<IArtifactDescriptor> matchExpression(descriptorMatch, id, range, properties); diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/MirrorTaskTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/MirrorTaskTest.java index 903f59fc3..4ef74d2a6 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/MirrorTaskTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/ant/MirrorTaskTest.java @@ -18,7 +18,6 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; import org.eclipse.core.runtime.*; import org.eclipse.equinox.internal.p2.artifact.processors.md5.Messages; -import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils; import org.eclipse.equinox.internal.p2.director.PermissiveSlicer; import org.eclipse.equinox.internal.p2.metadata.ArtifactKey; import org.eclipse.equinox.internal.p2.metadata.InstallableUnit; @@ -361,7 +360,7 @@ public class MirrorTaskTest extends AbstractAntProvisioningTest { runAntTask(); - PermissiveSlicer slicer = new PermissiveSlicer(repo, CollectionUtils.<String, String> emptyMap(), true, false, true, false, false); + PermissiveSlicer slicer = new PermissiveSlicer(repo, Collections.<String, String> emptyMap(), true, false, true, false, false); IQueryable result = slicer.slice(new IInstallableUnit[] {iu}, new NullProgressMonitor()); assertEquals("Different number of IUs", queryResultSize(result.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor())), getIUCount(destinationRepo)); diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/SPIMetadataRepositoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/SPIMetadataRepositoryTest.java index 51f241f22..12b52360d 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/SPIMetadataRepositoryTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/SPIMetadataRepositoryTest.java @@ -18,7 +18,6 @@ import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.*; import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils; import org.eclipse.equinox.internal.p2.metadata.*; import org.eclipse.equinox.p2.core.ProvisionException; import org.eclipse.equinox.p2.metadata.*; @@ -317,7 +316,7 @@ public class SPIMetadataRepositoryTest extends AbstractProvisioningTest { } public List<IRequirement> getMetaRequirements() { - return CollectionUtils.emptyList(); + return Collections.<IRequirement> emptyList(); } public String getProperty(String key, String locale) { diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/NegationTesting.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/NegationTesting.java index c98b92d52..875884ad9 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/NegationTesting.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/NegationTesting.java @@ -10,10 +10,8 @@ *******************************************************************************/ package org.eclipse.equinox.p2.tests.planner; -import java.util.ArrayList; -import java.util.Collection; +import java.util.*; import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils; import org.eclipse.equinox.internal.p2.director.ProfileChangeRequest; import org.eclipse.equinox.internal.p2.director.Slicer; import org.eclipse.equinox.internal.p2.engine.ProvisioningPlan; @@ -89,7 +87,7 @@ public class NegationTesting extends AbstractProvisioningTest { IMetadataRepository repo = createTestMetdataRepository(new IInstallableUnit[] {iu1, iu2, iu3}); // Verify that the slice includes iu3 because the requirement from iu1 is a range including the provided capability of iu3. - Slicer slicer = new Slicer(repo, CollectionUtils.<String, String> emptyMap(), false); + Slicer slicer = new Slicer(repo, Collections.<String, String> emptyMap(), false); IQueryable slice = slicer.slice(new IInstallableUnit[] {iu1}, new NullProgressMonitor()); assertEquals(3, queryResultSize(slice.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor()))); @@ -147,7 +145,7 @@ public class NegationTesting extends AbstractProvisioningTest { IMetadataRepository repo = createTestMetdataRepository(new IInstallableUnit[] {iu1, iu2, iu3}); //Test the slicer. The slice will not contain iu3 because none of the range of iu1 cause it to be brought in. - Slicer slicer = new Slicer(repo, CollectionUtils.<String, String> emptyMap(), false); + Slicer slicer = new Slicer(repo, Collections.<String, String> emptyMap(), false); IQueryable slice = slicer.slice(new IInstallableUnit[] {iu1}, new NullProgressMonitor()); assertEquals(0, queryResultSize(slice.query(QueryUtil.createIUQuery("ProviderOf1_1_1"), new NullProgressMonitor()))); assertEquals(2, queryResultSize(slice.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor()))); @@ -179,7 +177,7 @@ public class NegationTesting extends AbstractProvisioningTest { IMetadataRepository repo = createTestMetdataRepository(new IInstallableUnit[] {iu1, iu2}); //Test the slicer. The slice will not contain iu3 because none of the range of iu1 cause it to be brought in. - Slicer slicer = new Slicer(repo, CollectionUtils.<String, String> emptyMap(), false); + Slicer slicer = new Slicer(repo, Collections.<String, String> emptyMap(), false); IQueryable slice = slicer.slice(new IInstallableUnit[] {iu1}, new NullProgressMonitor()); assertEquals(0, queryResultSize(slice.query(QueryUtil.createIUQuery("ProviderOf1_1_1"), new NullProgressMonitor()))); assertEquals(2, queryResultSize(slice.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor()))); @@ -233,7 +231,7 @@ public class NegationTesting extends AbstractProvisioningTest { IMetadataRepository repo = createTestMetdataRepository(new IInstallableUnit[] {iu1, iu2, iu3}); // Verify that the slice includes iu3 because the requirement from iu1 is a range including the provided capability of iu3. - Slicer slicer = new Slicer(repo, CollectionUtils.<String, String> emptyMap(), false); + Slicer slicer = new Slicer(repo, Collections.<String, String> emptyMap(), false); IQueryable slice = slicer.slice(new IInstallableUnit[] {iu1}, new NullProgressMonitor()); assertEquals(3, queryResultSize(slice.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor()))); @@ -302,12 +300,12 @@ public class NegationTesting extends AbstractProvisioningTest { IMetadataRepository repo = createTestMetdataRepository(new IInstallableUnit[] {iu1, iu2, iu3, iu4}); // Verify that the slice includes iu3 - Slicer slicer = new Slicer(repo, CollectionUtils.<String, String> emptyMap(), false); + Slicer slicer = new Slicer(repo, Collections.<String, String> emptyMap(), false); IQueryable slice = slicer.slice(new IInstallableUnit[] {iu1, iu4}, new NullProgressMonitor()); assertEquals(4, queryResultSize(slice.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor()))); // Verify that the slice includes iu3 - Slicer slicer2 = new Slicer(repo, CollectionUtils.<String, String> emptyMap(), false); + Slicer slicer2 = new Slicer(repo, Collections.<String, String> emptyMap(), false); IQueryable slice2 = slicer2.slice(new IInstallableUnit[] {iu4}, new NullProgressMonitor()); assertEquals(2, queryResultSize(slice2.query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor()))); diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PermissiveSlicerTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PermissiveSlicerTest.java index 6b9421821..570c568d3 100644 --- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PermissiveSlicerTest.java +++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/planner/PermissiveSlicerTest.java @@ -11,10 +11,8 @@ package org.eclipse.equinox.p2.tests.planner; import java.io.File; -import java.util.HashMap; -import java.util.Map; +import java.util.*; import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils; import org.eclipse.equinox.internal.p2.director.PermissiveSlicer; import org.eclipse.equinox.p2.metadata.*; import org.eclipse.equinox.p2.query.*; @@ -32,7 +30,7 @@ public class PermissiveSlicerTest extends AbstractProvisioningTest { } public void testSliceRCPOut() { - PermissiveSlicer slicer = new PermissiveSlicer(repo, CollectionUtils.<String, String> emptyMap(), true, false, true, false, false); + PermissiveSlicer slicer = new PermissiveSlicer(repo, Collections.<String, String> emptyMap(), true, false, true, false, false); IQueryResult c = repo.query(QueryUtil.createIUQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor()); IInstallableUnit iu = (IInstallableUnit) c.iterator().next(); IQueryable result = slicer.slice(new IInstallableUnit[] {iu}, new NullProgressMonitor()); @@ -45,7 +43,7 @@ public class PermissiveSlicerTest extends AbstractProvisioningTest { //Test with and without optional pieces public void testSliceRCPWithOptionalPieces() { - PermissiveSlicer slicer = new PermissiveSlicer(repo, CollectionUtils.<String, String> emptyMap(), false, false, true, false, false); + PermissiveSlicer slicer = new PermissiveSlicer(repo, Collections.<String, String> emptyMap(), false, false, true, false, false); IQueryResult c = repo.query(QueryUtil.createIUQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor()); IInstallableUnit iu = (IInstallableUnit) c.iterator().next(); IQueryable result = slicer.slice(new IInstallableUnit[] {iu}, new NullProgressMonitor()); @@ -56,7 +54,7 @@ public class PermissiveSlicerTest extends AbstractProvisioningTest { } public void testSliceRCPWithIgnoringGreed() { - PermissiveSlicer slicer = new PermissiveSlicer(repo, CollectionUtils.<String, String> emptyMap(), false, true, true, false, false); + PermissiveSlicer slicer = new PermissiveSlicer(repo, Collections.<String, String> emptyMap(), false, true, true, false, false); IQueryResult c = repo.query(QueryUtil.createIUQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor()); IInstallableUnit iu = (IInstallableUnit) c.iterator().next(); IQueryable result = slicer.slice(new IInstallableUnit[] {iu}, new NullProgressMonitor()); @@ -99,7 +97,7 @@ public class PermissiveSlicerTest extends AbstractProvisioningTest { } public void testExtractPlatformIndependentPieces() { - PermissiveSlicer slicer = new PermissiveSlicer(repo, CollectionUtils.<String, String> emptyMap(), true, false, false, false, false); + PermissiveSlicer slicer = new PermissiveSlicer(repo, Collections.<String, String> emptyMap(), true, false, false, false, false); IQueryResult c = repo.query(QueryUtil.createIUQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor()); IInstallableUnit iu = (IInstallableUnit) c.iterator().next(); IQueryable result = slicer.slice(new IInstallableUnit[] {iu}, new NullProgressMonitor()); @@ -117,7 +115,7 @@ public class PermissiveSlicerTest extends AbstractProvisioningTest { IRequirement[] metaReq = createRequiredCapabilities("p2.action", "action1", new VersionRange("[0.0.0, 1.0.0]")); IInstallableUnit a = createIUWithMetaRequirement("A", DEFAULT_VERSION, true, NO_REQUIRES, metaReq); - PermissiveSlicer slicer = new PermissiveSlicer(createTestMetdataRepository(new IInstallableUnit[] {a, act1}), CollectionUtils.<String, String> emptyMap(), true, false, false, false, false); + PermissiveSlicer slicer = new PermissiveSlicer(createTestMetdataRepository(new IInstallableUnit[] {a, act1}), Collections.<String, String> emptyMap(), true, false, false, false, false); IQueryable result = slicer.slice(new IInstallableUnit[] {a}, new NullProgressMonitor()); assertEquals(1, queryResultSize(result.query(QueryUtil.createIUQuery("Action1"), null))); } @@ -137,7 +135,7 @@ public class PermissiveSlicerTest extends AbstractProvisioningTest { public void testMissingNecessaryPiece() { IRequirement[] req = createRequiredCapabilities("B", "B", new VersionRange("[0.0.0, 1.0.0]")); IInstallableUnit iuA = createIU("A", DEFAULT_VERSION, null, req, NO_PROVIDES, NO_PROPERTIES, null, NO_TP_DATA, true); - PermissiveSlicer slicer = new PermissiveSlicer(createTestMetdataRepository(new IInstallableUnit[] {iuA}), CollectionUtils.<String, String> emptyMap(), true, false, false, false, false); + PermissiveSlicer slicer = new PermissiveSlicer(createTestMetdataRepository(new IInstallableUnit[] {iuA}), Collections.<String, String> emptyMap(), true, false, false, false, false); IQueryable result = slicer.slice(new IInstallableUnit[] {iuA}, new NullProgressMonitor()); assertNotNull(result); assertNotOK(slicer.getStatus()); @@ -156,7 +154,7 @@ public class PermissiveSlicerTest extends AbstractProvisioningTest { } public void testExtractOnlyPlatformSpecific() { - PermissiveSlicer slicer = new PermissiveSlicer(repo, CollectionUtils.<String, String> emptyMap(), true, false, true, false, true); + PermissiveSlicer slicer = new PermissiveSlicer(repo, Collections.<String, String> emptyMap(), true, false, true, false, true); IQueryResult c = repo.query(QueryUtil.createIUQuery("org.eclipse.rcp.feature.group"), new NullProgressMonitor()); IInstallableUnit iu = (IInstallableUnit) c.iterator().next(); IQueryResult resultCollector = slicer.slice(new IInstallableUnit[] {iu}, new NullProgressMonitor()).query(QueryUtil.createIUAnyQuery(), new NullProgressMonitor()); diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/EclipseMarkSetProvider.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/EclipseMarkSetProvider.java index faf6c666f..c64a11ecc 100644 --- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/EclipseMarkSetProvider.java +++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/EclipseMarkSetProvider.java @@ -13,7 +13,6 @@ package org.eclipse.equinox.internal.p2.touchpoint.eclipse; import java.io.File; import java.util.*; import org.eclipse.equinox.frameworkadmin.BundleInfo; -import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils; import org.eclipse.equinox.internal.p2.garbagecollector.MarkSet; import org.eclipse.equinox.internal.p2.garbagecollector.MarkSetProvider; import org.eclipse.equinox.internal.p2.update.*; @@ -65,7 +64,7 @@ public class EclipseMarkSetProvider extends MarkSetProvider { private List<Feature> getAllFeatures(Configuration cfg) { if (cfg == null) - return CollectionUtils.emptyList(); + return Collections.<Feature> emptyList(); List<Site> sites = cfg.getSites(); ArrayList<Feature> result = new ArrayList<Feature>(); for (Site object : sites) { diff --git a/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/AutomaticUpdater.java b/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/AutomaticUpdater.java index 45f34dc16..40273866f 100644 --- a/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/AutomaticUpdater.java +++ b/bundles/org.eclipse.equinox.p2.ui.sdk.scheduler/src/org/eclipse/equinox/internal/p2/ui/sdk/scheduler/AutomaticUpdater.java @@ -16,7 +16,6 @@ import java.lang.reflect.Method; import java.util.*; import org.eclipse.core.runtime.*; import org.eclipse.core.runtime.jobs.*; -import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils; import org.eclipse.equinox.internal.provisional.p2.core.eventbus.IProvisioningEventBus; import org.eclipse.equinox.internal.provisional.p2.core.eventbus.ProvisioningListener; import org.eclipse.equinox.internal.provisional.p2.updatechecker.IUpdateListener; @@ -360,7 +359,7 @@ public class AutomaticUpdater implements IUpdateListener { public Collection<IInstallableUnit> getInstalledIUs() { IProfile profile = getProfileRegistry().getProfile(profileId); if (profile == null) - return CollectionUtils.emptyList(); + return Collections.<IInstallableUnit> emptyList(); IQuery<IInstallableUnit> query = new UserVisibleRootQuery(); IQueryResult<IInstallableUnit> queryResult = profile.query(query, null); return queryResult.toUnmodifiableSet(); diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ElementWrapper.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ElementWrapper.java index c8a5622cd..ed47b934a 100644 --- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ElementWrapper.java +++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ElementWrapper.java @@ -11,7 +11,6 @@ package org.eclipse.equinox.internal.p2.ui; import java.util.*; -import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils; import org.eclipse.equinox.p2.query.Collector; /** @@ -40,7 +39,7 @@ public abstract class ElementWrapper { * Gets the collection where the elements are being stored. */ protected Collection<?> getCollection() { - return collection == null ? CollectionUtils.emptyList() : collection; + return collection == null ? Collections.emptyList() : collection; } /** diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/CategoryElement.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/CategoryElement.java index e76c8ceb4..2fbf9b44f 100644 --- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/CategoryElement.java +++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/CategoryElement.java @@ -10,10 +10,8 @@ *******************************************************************************/ package org.eclipse.equinox.internal.p2.ui.model; -import java.util.ArrayList; -import java.util.Collection; +import java.util.*; import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils; import org.eclipse.equinox.internal.p2.ui.*; import org.eclipse.equinox.p2.metadata.IInstallableUnit; import org.eclipse.equinox.p2.metadata.IRequirement; @@ -104,7 +102,7 @@ public class CategoryElement extends RemoteQueriedElement implements IIUElement public Collection<IRequirement> getRequirements() { if (ius == null || ius.isEmpty()) - return CollectionUtils.emptyList(); + return Collections.<IRequirement> emptyList(); if (requirements == null) { if (ius.size() == 1) requirements = getIU().getRequirements(); diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/QueriedElement.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/QueriedElement.java index a478e683f..2ae966587 100644 --- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/QueriedElement.java +++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/model/QueriedElement.java @@ -13,7 +13,6 @@ package org.eclipse.equinox.internal.p2.ui.model; import java.util.*; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils; import org.eclipse.equinox.internal.p2.ui.ElementQueryDescriptor; import org.eclipse.equinox.internal.p2.ui.QueryProvider; import org.eclipse.equinox.internal.p2.ui.query.IUViewQueryContext; @@ -96,7 +95,7 @@ public abstract class QueriedElement extends ProvElement { } protected Object[] fetchChildren(Object o, IProgressMonitor monitor) { - cachedChildren = CollectionUtils.emptyList(); + cachedChildren = Collections.emptyList(); QueryProvider provider = new QueryProvider(getProvisioningUI()); ElementQueryDescriptor queryDescriptor = provider.getQueryDescriptor(this); if (queryDescriptor == null) diff --git a/bundles/org.eclipse.equinox.p2.updatechecker/src/org/eclipse/equinox/internal/p2/updatechecker/UpdateChecker.java b/bundles/org.eclipse.equinox.p2.updatechecker/src/org/eclipse/equinox/internal/p2/updatechecker/UpdateChecker.java index f3b4b2a65..f876bc018 100644 --- a/bundles/org.eclipse.equinox.p2.updatechecker/src/org/eclipse/equinox/internal/p2/updatechecker/UpdateChecker.java +++ b/bundles/org.eclipse.equinox.p2.updatechecker/src/org/eclipse/equinox/internal/p2/updatechecker/UpdateChecker.java @@ -16,7 +16,8 @@ import java.text.SimpleDateFormat; import java.util.*; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; -import org.eclipse.equinox.internal.p2.core.helpers.*; +import org.eclipse.equinox.internal.p2.core.helpers.LogHelper; +import org.eclipse.equinox.internal.p2.core.helpers.Tracing; import org.eclipse.equinox.internal.provisional.p2.updatechecker.*; import org.eclipse.equinox.p2.core.IProvisioningAgent; import org.eclipse.equinox.p2.core.ProvisionException; @@ -123,7 +124,7 @@ public class UpdateChecker implements IUpdateChecker { IProfile profile = getProfileRegistry().getProfile(profileId); ArrayList<IInstallableUnit> iusWithUpdates = new ArrayList<IInstallableUnit>(); if (profile == null) - return CollectionUtils.emptyList(); + return Collections.<IInstallableUnit> emptyList(); ProvisioningContext context = new ProvisioningContext(agent); context.setMetadataRepositories(getAvailableRepositories()); if (query == null) diff --git a/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/SiteXMLAction.java b/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/SiteXMLAction.java index 71336f1e6..af9171700 100644 --- a/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/SiteXMLAction.java +++ b/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/SiteXMLAction.java @@ -18,7 +18,6 @@ import java.net.URISyntaxException; import java.util.*; import java.util.Map.Entry; import org.eclipse.core.runtime.*; -import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils; import org.eclipse.equinox.internal.p2.core.helpers.LogHelper; import org.eclipse.equinox.internal.p2.repository.Transport; import org.eclipse.equinox.p2.core.ProvisionException; @@ -187,7 +186,7 @@ public class SiteXMLAction extends AbstractPublisherAction { String expression = siteIU.getQueryExpression(); Object[] params = siteIU.getQueryParams(); if (id == null && (type == null || expression == null)) - return CollectionUtils.emptyList(); + return Collections.<IInstallableUnit> emptyList(); IQuery<IInstallableUnit> query = null; if (id != null) { VersionRange vRange = new VersionRange(range); @@ -197,7 +196,7 @@ public class SiteXMLAction extends AbstractPublisherAction { } else if (type.equals("match")) //$NON-NLS-1$ query = QueryUtil.createMatchQuery(expression, params); if (query == null) - return CollectionUtils.emptyList(); + return Collections.<IInstallableUnit> emptyList(); IQueryResult<IInstallableUnit> queryResult = results.query(query, null); if (queryResult.isEmpty()) queryResult = publisherInfo.getMetadataRepository().query(query, null); @@ -531,13 +530,13 @@ public class SiteXMLAction extends AbstractPublisherAction { String categoryId = buildCategoryId(category.getName()); cat.setId(categoryId); if (categoryVersion == null) - cat.setVersion(Version.createOSGi(1, 0, 0, versionSuffixGenerator.generateSuffix(childrenIUs, CollectionUtils.<IVersionedId> emptyList()))); + cat.setVersion(Version.createOSGi(1, 0, 0, versionSuffixGenerator.generateSuffix(childrenIUs, Collections.<IVersionedId> emptyList()))); else { if (categoryVersion.isOSGiCompatible()) { org.osgi.framework.Version osgiVersion = PublisherHelper.toOSGiVersion(categoryVersion); String qualifier = osgiVersion.getQualifier(); if (qualifier.endsWith(QUALIFIER)) { - String suffix = versionSuffixGenerator.generateSuffix(childrenIUs, CollectionUtils.<IVersionedId> emptyList()); + String suffix = versionSuffixGenerator.generateSuffix(childrenIUs, Collections.<IVersionedId> emptyList()); qualifier = qualifier.substring(0, qualifier.length() - 9) + suffix; categoryVersion = Version.createOSGi(osgiVersion.getMajor(), osgiVersion.getMinor(), osgiVersion.getMicro(), qualifier); } |