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 /bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox | |
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>
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.publisher/src/org/eclipse/equinox')
3 files changed, 7 insertions, 6 deletions
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 { |