summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2013-11-19 02:14:16 (EST)
committerGerrit Code Review @ Eclipse.org2013-11-19 04:10:31 (EST)
commitdf8b3aceccc548666833df2ff68112fcb08838dd (patch)
treeea2916f8225ca369aa6cf095c28a8c1a2da2e839
parent1eece4f1366d56ff50e5b41df6c2845fef0214ad (diff)
downloadrt.equinox.p2-df8b3aceccc548666833df2ff68112fcb08838dd.zip
rt.equinox.p2-df8b3aceccc548666833df2ff68112fcb08838dd.tar.gz
rt.equinox.p2-df8b3aceccc548666833df2ff68112fcb08838dd.tar.bz2
Bug 422025 - Generify DeltaApplierrefs/changes/43/18543/2
P2 has moved to Java 1.5 now and DeltaApplier not being properly generified clutters the build logs and platform reports. It's better to get rid of these warnings in order to make important problems more visible. Change-Id: Iceb37a42dcfe9e52ddde2a81cb836ceaa6ae80be Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/jardelta/DeltaApplier.java22
1 files changed, 11 insertions, 11 deletions
diff --git a/bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/jardelta/DeltaApplier.java b/bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/jardelta/DeltaApplier.java
index d5f4d16..4b5da7c 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/jardelta/DeltaApplier.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/jardelta/DeltaApplier.java
@@ -22,7 +22,7 @@ public class DeltaApplier {
private File destination;
private ZipFile baseJar;
private ZipFile deltaJar;
- private Set baseEntries;
+ private Set<String> baseEntries;
private ZipFile manifestJar;
public DeltaApplier(File base, File delta, File destination) {
@@ -46,8 +46,8 @@ public class DeltaApplier {
// start out assuming that all the base entries will be moved over.
baseEntries = getEntries(baseJar);
// remove from the base all the entries that appear in the delta
- for (Enumeration e = deltaJar.entries(); e.hasMoreElements();) {
- ZipEntry entry = ((ZipEntry) e.nextElement());
+ for (Enumeration<? extends ZipEntry> e = deltaJar.entries(); e.hasMoreElements();) {
+ ZipEntry entry = e.nextElement();
checkForManifest(entry, deltaJar);
String name = entry.getName();
if (name.endsWith(DELETE_SUFFIX)) {
@@ -69,13 +69,13 @@ public class DeltaApplier {
if (manifestJar != null)
writeEntry(result, manifestJar.getEntry(MANIFEST_ENTRY_NAME), manifestJar, true);
// write out the things we know are staying from the base JAR
- for (Iterator i = baseEntries.iterator(); i.hasNext();) {
- ZipEntry entry = baseJar.getEntry((String) i.next());
+ for (Iterator<String> i = baseEntries.iterator(); i.hasNext();) {
+ ZipEntry entry = baseJar.getEntry(i.next());
writeEntry(result, entry, baseJar, false);
}
// write out the changes/additions from the delta.
- for (Enumeration e = deltaJar.entries(); e.hasMoreElements();) {
- ZipEntry entry = (ZipEntry) e.nextElement();
+ for (Enumeration<? extends ZipEntry> e = deltaJar.entries(); e.hasMoreElements();) {
+ ZipEntry entry = e.nextElement();
if (!entry.getName().endsWith(DELETE_SUFFIX))
writeEntry(result, entry, deltaJar, false);
}
@@ -160,10 +160,10 @@ public class DeltaApplier {
}
}
- private Set getEntries(ZipFile jar) {
- HashSet result = new HashSet(jar.size());
- for (Enumeration e = jar.entries(); e.hasMoreElements();) {
- ZipEntry entry = (ZipEntry) e.nextElement();
+ private Set<String> getEntries(ZipFile jar) {
+ HashSet<String> result = new HashSet<String>(jar.size());
+ for (Enumeration<? extends ZipEntry> e = jar.entries(); e.hasMoreElements();) {
+ ZipEntry entry = e.nextElement();
checkForManifest(entry, jar);
result.add(entry.getName());
}