summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault2012-12-11 11:03:08 (EST)
committerPascal Rapicault2012-12-11 11:12:34 (EST)
commit106f6cd9b769c04d011bd95e490ddb87e5b03609 (patch)
tree9cbcac277d7ededd418463cf781540c254b25d6b
parentb7de11cb350d4c9d97b1ca265566264ee84cf32e (diff)
downloadrt.equinox.p2-106f6cd9b769c04d011bd95e490ddb87e5b03609.zip
rt.equinox.p2-106f6cd9b769c04d011bd95e490ddb87e5b03609.tar.gz
rt.equinox.p2-106f6cd9b769c04d011bd95e490ddb87e5b03609.tar.bz2
Fix up warning related to the move to java 5.
-rw-r--r--bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/CommandStep.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/PackStep.java24
-rw-r--r--bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/PackUnpackStep.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/SignCommandStep.java16
-rw-r--r--bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/UnpackStep.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/Utils.java20
-rw-r--r--bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/ZipProcessor.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/unsigner/UnsignCommand.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/verifier/VerifyStep.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/internal/provisional/equinox/p2/jarprocessor/IProcessStep.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/internal/provisional/equinox/p2/jarprocessor/JarProcessor.java46
-rw-r--r--bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/internal/provisional/equinox/p2/jarprocessor/JarProcessorExecutor.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.jarprocessor/src_ant/org/eclipse/equinox/internal/p2/jarprocessor/ant/AntBasedProcessorExecutor.java10
-rw-r--r--bundles/org.eclipse.equinox.p2.jarprocessor/src_ant/org/eclipse/equinox/internal/p2/jarprocessor/ant/AntSignCommand.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.jarprocessor/src_ant/org/eclipse/equinox/internal/p2/jarprocessor/ant/JarProcessorTask.java4
15 files changed, 80 insertions, 78 deletions
diff --git a/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/CommandStep.java b/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/CommandStep.java
index d03a9f7..fc0f19d 100644
--- a/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/CommandStep.java
+++ b/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/CommandStep.java
@@ -62,7 +62,7 @@ public abstract class CommandStep implements IProcessStep {
return options;
}
- public boolean adjustInf(File input, Properties inf, List containers) {
+ public boolean adjustInf(File input, Properties inf, List<Properties> containers) {
//do nothing by default
return false;
}
diff --git a/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/PackStep.java b/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/PackStep.java
index f85bb55..bd202ad 100644
--- a/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/PackStep.java
+++ b/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/PackStep.java
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.jarprocessor;
+import java.util.Properties;
+
import java.io.File;
import java.io.IOException;
import java.util.*;
@@ -19,7 +21,7 @@ public class PackStep extends CommandStep {
protected static String packCommand = null;
private static Boolean canPack = null;
- private Set exclusions = Collections.EMPTY_SET;
+ private Set<String> exclusions = Collections.emptySet();
public static boolean canPack() {
if (canPack != null)
@@ -65,11 +67,11 @@ public class PackStep extends CommandStep {
return null;
}
- public File preProcess(File input, File workingDirectory, List containers) {
+ public File preProcess(File input, File workingDirectory, List<Properties> containers) {
return null;
}
- public File postProcess(File input, File workingDirectory, List containers) {
+ public File postProcess(File input, File workingDirectory, List<Properties> containers) {
if (canPack() && packCommand != null) {
Properties inf = Utils.getEclipseInf(input, verbose);
if (!shouldPack(input, containers, inf))
@@ -90,11 +92,11 @@ public class PackStep extends CommandStep {
return null;
}
- protected boolean shouldPack(File input, List containers, Properties inf) {
+ protected boolean shouldPack(File input, List<Properties> containers, Properties inf) {
//1: exclude by containers
// innermost jar is first on the list, it can override outer jars
- for (Iterator iterator = containers.iterator(); iterator.hasNext();) {
- Properties container = (Properties) iterator.next();
+ for (Iterator<Properties> iterator = containers.iterator(); iterator.hasNext();) {
+ Properties container = iterator.next();
if (container.containsKey(Utils.MARK_EXCLUDE_CHILDREN_PACK)) {
if (Boolean.valueOf(container.getProperty(Utils.MARK_EXCLUDE_CHILDREN_PACK)).booleanValue()) {
if (verbose)
@@ -115,7 +117,7 @@ public class PackStep extends CommandStep {
return true;
}
- protected String[] getCommand(File input, File outputFile, Properties inf, List containers) throws IOException {
+ protected String[] getCommand(File input, File outputFile, Properties inf, List<Properties> containers) throws IOException {
String[] cmd = null;
String arguments = getArguments(input, inf, containers);
if (arguments != null && arguments.length() > 0) {
@@ -131,15 +133,15 @@ public class PackStep extends CommandStep {
return cmd;
}
- protected String getArguments(File input, Properties inf, List containers) {
+ protected String getArguments(File input, Properties inf, List<Properties> containers) {
//1: Explicitly marked in our .inf file
if (inf != null && inf.containsKey(Utils.PACK_ARGS)) {
return inf.getProperty(Utils.PACK_ARGS);
}
//2: Defaults set in one of our containing jars
- for (Iterator iterator = containers.iterator(); iterator.hasNext();) {
- Properties container = (Properties) iterator.next();
+ for (Iterator<Properties> iterator = containers.iterator(); iterator.hasNext();) {
+ Properties container = iterator.next();
if (container.containsKey(Utils.DEFAULT_PACK_ARGS)) {
return container.getProperty(Utils.DEFAULT_PACK_ARGS);
}
@@ -164,7 +166,7 @@ public class PackStep extends CommandStep {
return "Pack"; //$NON-NLS-1$
}
- public boolean adjustInf(File input, Properties inf, List containers) {
+ public boolean adjustInf(File input, Properties inf, List<Properties> containers) {
if (input == null || inf == null)
return false;
diff --git a/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/PackUnpackStep.java b/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/PackUnpackStep.java
index 79707a6..ae50814 100644
--- a/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/PackUnpackStep.java
+++ b/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/PackUnpackStep.java
@@ -19,7 +19,7 @@ import java.util.*;
*
*/
public class PackUnpackStep extends PackStep {
- private Set exclusions = null;
+ private Set<String> exclusions = null;
public PackUnpackStep(Properties options) {
super(options);
@@ -41,7 +41,7 @@ public class PackUnpackStep extends PackStep {
/* (non-Javadoc)
* @see org.eclipse.update.internal.jarprocessor.PackStep#postProcess(java.io.File, java.io.File, java.util.LinkedList)
*/
- public File postProcess(File input, File workingDirectory, List containers) {
+ public File postProcess(File input, File workingDirectory, List<Properties> containers) {
if (canPack() && packCommand != null && input != null) {
Properties inf = Utils.getEclipseInf(input, verbose);
if (!shouldPack(input, containers, inf))
@@ -76,7 +76,7 @@ public class PackUnpackStep extends PackStep {
/* (non-Javadoc)
* @see org.eclipse.update.internal.jarprocessor.PackStep#preProcess(java.io.File, java.io.File, java.util.LinkedList)
*/
- public File preProcess(File input, File workingDirectory, List containers) {
+ public File preProcess(File input, File workingDirectory, List<Properties> containers) {
return null;
}
diff --git a/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/SignCommandStep.java b/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/SignCommandStep.java
index e648808..c6c0f6d 100644
--- a/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/SignCommandStep.java
+++ b/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/SignCommandStep.java
@@ -15,7 +15,7 @@ import java.io.IOException;
import java.util.*;
public class SignCommandStep extends CommandStep {
- private Set exclusions = null;
+ private Set<String> exclusions = null;
public SignCommandStep(Properties options, String command) {
super(options, command, ".jar", false); //$NON-NLS-1$
@@ -39,14 +39,14 @@ public class SignCommandStep extends CommandStep {
/* (non-Javadoc)
* @see org.eclipse.update.jarprocessor.IProcessStep#preProcess(java.io.File, java.io.File)
*/
- public File preProcess(File input, File workingDirectory, List containers) {
+ public File preProcess(File input, File workingDirectory, List<Properties> containers) {
return null;
}
/* (non-Javadoc)
* @see org.eclipse.update.jarprocessor.IProcessStep#postProcess(java.io.File, java.io.File)
*/
- public File postProcess(File input, File workingDirectory, List containers) {
+ public File postProcess(File input, File workingDirectory, List<Properties> containers) {
if (command != null && input != null && shouldSign(input, containers)) {
try {
String[] cmd = new String[] {command, input.getCanonicalPath()};
@@ -65,15 +65,15 @@ public class SignCommandStep extends CommandStep {
return null;
}
- public boolean shouldSign(File input, List containers) {
+ public boolean shouldSign(File input, List<Properties> containers) {
Properties inf = null;
//1: Are we excluded from signing by our parents?
//innermost jar is first on the list, it overrides outer jars
- for (Iterator iterator = containers.iterator(); iterator.hasNext();) {
- inf = (Properties) iterator.next();
- if (inf.containsKey(Utils.MARK_EXCLUDE_CHILDREN_SIGN)){
- if(Boolean.valueOf(inf.getProperty(Utils.MARK_EXCLUDE_CHILDREN_SIGN)).booleanValue()) {
+ for (Iterator<Properties> iterator = containers.iterator(); iterator.hasNext();) {
+ inf = iterator.next();
+ if (inf.containsKey(Utils.MARK_EXCLUDE_CHILDREN_SIGN)) {
+ if (Boolean.valueOf(inf.getProperty(Utils.MARK_EXCLUDE_CHILDREN_SIGN)).booleanValue()) {
if (verbose)
System.out.println(input.getName() + "is excluded from signing by its containers."); //$NON-NLS-1$
return false;
diff --git a/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/UnpackStep.java b/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/UnpackStep.java
index a6c84bf..87984ca 100644
--- a/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/UnpackStep.java
+++ b/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/UnpackStep.java
@@ -72,7 +72,7 @@ public class UnpackStep extends CommandStep {
/* (non-Javadoc)
* @see org.eclipse.update.jarprocessor.IProcessStep#preProcess(java.io.File, java.io.File)
*/
- public File preProcess(File input, File workingDirectory, List containers) {
+ public File preProcess(File input, File workingDirectory, List<Properties> containers) {
if (canUnpack() && unpackCommand != null) {
String name = input.getName();
if (name.endsWith(Utils.PACKED_SUFFIX)) {
@@ -107,7 +107,7 @@ public class UnpackStep extends CommandStep {
/* (non-Javadoc)
* @see org.eclipse.update.jarprocessor.IProcessStep#postProcess(java.io.File, java.io.File)
*/
- public File postProcess(File input, File workingDirectory, List containers) {
+ public File postProcess(File input, File workingDirectory, List<Properties> containers) {
return null;
}
diff --git a/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/Utils.java b/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/Utils.java
index 5f1e683..feeddc6 100644
--- a/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/Utils.java
+++ b/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/Utils.java
@@ -187,35 +187,35 @@ public class Utils {
return result;
}
- public static Set getPackExclusions(Properties properties) {
+ public static Set<String> getPackExclusions(Properties properties) {
if (properties == null)
- return Collections.EMPTY_SET;
+ return Collections.emptySet();
String packExcludes = properties.getProperty(PACK_EXCLUDES);
if (packExcludes != null) {
String[] excludes = toStringArray(packExcludes, ","); //$NON-NLS-1$
- Set packExclusions = new HashSet();
+ Set<String> packExclusions = new HashSet<String>();
for (int i = 0; i < excludes.length; i++) {
packExclusions.add(excludes[i]);
}
return packExclusions;
}
- return Collections.EMPTY_SET;
+ return Collections.emptySet();
}
- public static Set getSignExclusions(Properties properties) {
+ public static Set<String> getSignExclusions(Properties properties) {
if (properties == null)
- return Collections.EMPTY_SET;
+ return Collections.emptySet();
String signExcludes = properties.getProperty(SIGN_EXCLUDES);
if (signExcludes != null) {
String[] excludes = toStringArray(signExcludes, ","); //$NON-NLS-1$
- Set signExclusions = new HashSet();
+ Set<String> signExclusions = new HashSet<String>();
for (int i = 0; i < excludes.length; i++) {
signExclusions.add(excludes[i]);
}
return signExclusions;
}
- return Collections.EMPTY_SET;
+ return Collections.emptySet();
}
public static String concat(String[] array) {
@@ -306,8 +306,8 @@ public class Utils {
public static void storeProperties(Properties props, OutputStream stream) {
PrintStream printStream = new PrintStream(stream);
printStream.print("#Processed using Jarprocessor\n"); //$NON-NLS-1$
- SortedMap sorted = new TreeMap(props);
- for (Iterator iter = sorted.keySet().iterator(); iter.hasNext();) {
+ SortedMap<Object, Object> sorted = new TreeMap<Object, Object>(props);
+ for (Iterator<Object> iter = sorted.keySet().iterator(); iter.hasNext();) {
String key = (String) iter.next();
printStream.print(key);
printStream.print(" = "); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/ZipProcessor.java b/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/ZipProcessor.java
index 1d951fb..04e3db9 100644
--- a/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/ZipProcessor.java
+++ b/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/ZipProcessor.java
@@ -27,8 +27,8 @@ public class ZipProcessor {
private String workingDirectory = null;
private Properties properties = null;
- private Set packExclusions = null;
- private Set signExclusions = null;
+ private Set<String> packExclusions = null;
+ private Set<String> signExclusions = null;
public void setExecutor(JarProcessorExecutor executor) {
this.executor = executor;
@@ -73,9 +73,9 @@ public class ZipProcessor {
if (!parent.exists())
parent.mkdirs();
ZipOutputStream zipOut = new ZipOutputStream(new FileOutputStream(outputFile));
- Enumeration entries = zip.entries();
+ Enumeration<? extends ZipEntry> entries = zip.entries();
if (entries.hasMoreElements()) {
- for (ZipEntry entry = (ZipEntry) entries.nextElement(); entry != null; entry = entries.hasMoreElements() ? (ZipEntry) entries.nextElement() : null) {
+ for (ZipEntry entry = entries.nextElement(); entry != null; entry = entries.hasMoreElements() ? (ZipEntry) entries.nextElement() : null) {
String name = entry.getName();
InputStream entryStream = zip.getInputStream(entry);
diff --git a/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/unsigner/UnsignCommand.java b/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/unsigner/UnsignCommand.java
index 30a9e85..d30c054 100644
--- a/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/unsigner/UnsignCommand.java
+++ b/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/unsigner/UnsignCommand.java
@@ -21,7 +21,7 @@ public class UnsignCommand extends SignCommandStep {
super(options, command, verbose);
}
- public File postProcess(File input, File workingDirectory, List containers) {
+ public File postProcess(File input, File workingDirectory, List<Properties> containers) {
if (command != null && input != null && shouldSign(input, containers)) {
execute(input);
}
diff --git a/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/verifier/VerifyStep.java b/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/verifier/VerifyStep.java
index 059df37..c49f9cf 100644
--- a/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/verifier/VerifyStep.java
+++ b/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/equinox/internal/p2/jarprocessor/verifier/VerifyStep.java
@@ -49,7 +49,7 @@ public class VerifyStep extends CommandStep {
return "Verify"; //$NON-NLS-1$
}
- public File postProcess(File input, File workingDirectory, List containers) {
+ public File postProcess(File input, File workingDirectory, List<Properties> containers) {
if (canVerify() && verifyCommand != null) {
try {
System.out.print("Verifying " + input.getName() + ": "); //$NON-NLS-1$ //$NON-NLS-2$
@@ -67,7 +67,7 @@ public class VerifyStep extends CommandStep {
return null;
}
- public File preProcess(File input, File workingDirectory, List containers) {
+ public File preProcess(File input, File workingDirectory, List<Properties> containers) {
return null;
}
diff --git a/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/internal/provisional/equinox/p2/jarprocessor/IProcessStep.java b/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/internal/provisional/equinox/p2/jarprocessor/IProcessStep.java
index e0bd059..b7612d3 100644
--- a/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/internal/provisional/equinox/p2/jarprocessor/IProcessStep.java
+++ b/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/internal/provisional/equinox/p2/jarprocessor/IProcessStep.java
@@ -36,7 +36,7 @@ public interface IProcessStep {
* @param containers inf properties for containing jars, innermost jar is first on the list
* @return the file containing the result of the processing
*/
- public File preProcess(File input, File workingDirectory, List containers);
+ public File preProcess(File input, File workingDirectory, List<Properties> containers);
/**
* Perform some processing on the input file after the JarProcessor returns from recursion.
@@ -46,7 +46,7 @@ public interface IProcessStep {
* @param containers inf properties for containing jars, innermost jar is first on the list
* @return the file containing the result of the processing
*/
- public File postProcess(File input, File workingDirectory, List containers);
+ public File postProcess(File input, File workingDirectory, List<Properties> containers);
/**
* Return the name of this process step
@@ -61,5 +61,5 @@ public interface IProcessStep {
* @param containers inf properties for containing jars, innermost jar is first on the list
* @return <code>true</code> if the properties file was adjusted, and false othewise
*/
- public boolean adjustInf(File input, Properties inf, List containers);
+ public boolean adjustInf(File input, Properties inf, List<Properties> containers);
}
diff --git a/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/internal/provisional/equinox/p2/jarprocessor/JarProcessor.java b/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/internal/provisional/equinox/p2/jarprocessor/JarProcessor.java
index f254717..f4a1dfd 100644
--- a/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/internal/provisional/equinox/p2/jarprocessor/JarProcessor.java
+++ b/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/internal/provisional/equinox/p2/jarprocessor/JarProcessor.java
@@ -18,12 +18,12 @@ import org.eclipse.equinox.internal.p2.jarprocessor.*;
public class JarProcessor {
public static final String PACKED_SUFFIX = "pack.gz"; //$NON-NLS-1$
- private List steps = new ArrayList();
+ private List<IProcessStep> steps = new ArrayList<IProcessStep>();
private String workingDirectory = ""; //$NON-NLS-1$
private int depth = -1;
private boolean verbose = false;
private boolean processAll = false;
- private LinkedList containingInfs = new LinkedList();
+ private LinkedList<Properties> containingInfs = new LinkedList<Properties>();
static public JarProcessor getUnpackProcessor(Properties properties) {
if (!canPerformUnpack())
@@ -74,7 +74,7 @@ public class JarProcessor {
steps.clear();
}
- public Iterator getStepIterator() {
+ public Iterator<IProcessStep> getStepIterator() {
return steps.iterator();
}
@@ -88,16 +88,16 @@ public class JarProcessor {
* @param directory - location to find file for new entryName
* @throws IOException
*/
- private void recreateJar(JarFile jar, JarOutputStream outputJar, Map replacements, File directory, Properties inf) throws IOException {
+ private void recreateJar(JarFile jar, JarOutputStream outputJar, Map<String, String> replacements, File directory, Properties inf) throws IOException {
InputStream in = null;
boolean marked = false;
try {
- Enumeration entries = jar.entries();
- for (JarEntry entry = (JarEntry) entries.nextElement(); entry != null; entry = entries.hasMoreElements() ? (JarEntry) entries.nextElement() : null) {
+ Enumeration<JarEntry> entries = jar.entries();
+ for (JarEntry entry = entries.nextElement(); entry != null; entry = entries.hasMoreElements() ? (JarEntry) entries.nextElement() : null) {
File replacement = null;
JarEntry newEntry = null;
if (replacements.containsKey(entry.getName())) {
- String name = (String) replacements.get(entry.getName());
+ String name = replacements.get(entry.getName());
replacement = new File(directory, name);
if (name != null) {
if (replacement.exists()) {
@@ -159,8 +159,8 @@ public class JarProcessor {
private String recursionEffect(String entryName) {
String result = null;
- for (Iterator iter = steps.iterator(); iter.hasNext();) {
- IProcessStep step = (IProcessStep) iter.next();
+ for (Iterator<IProcessStep> iter = steps.iterator(); iter.hasNext();) {
+ IProcessStep step = iter.next();
result = step.recursionEffect(entryName);
if (result != null)
@@ -169,7 +169,7 @@ public class JarProcessor {
return result;
}
- private void extractEntries(JarFile jar, File tempDir, Map data, Properties inf) throws IOException {
+ private void extractEntries(JarFile jar, File tempDir, Map<String, String> data, Properties inf) throws IOException {
if (inf != null) {
//skip if excluding children
if (inf.containsKey(Utils.MARK_EXCLUDE_CHILDREN)) {
@@ -184,9 +184,9 @@ public class JarProcessor {
}
}
- Enumeration entries = jar.entries();
+ Enumeration<JarEntry> entries = jar.entries();
if (entries.hasMoreElements()) {
- for (JarEntry entry = (JarEntry) entries.nextElement(); entry != null; entry = entries.hasMoreElements() ? (JarEntry) entries.nextElement() : null) {
+ for (JarEntry entry = entries.nextElement(); entry != null; entry = entries.hasMoreElements() ? (JarEntry) entries.nextElement() : null) {
String name = entry.getName();
String newName = recursionEffect(name);
if (newName != null) {
@@ -236,8 +236,8 @@ public class JarProcessor {
private File preProcess(File input, File tempDir) {
File result = null;
- for (Iterator iter = steps.iterator(); iter.hasNext();) {
- IProcessStep step = (IProcessStep) iter.next();
+ for (Iterator<IProcessStep> iter = steps.iterator(); iter.hasNext();) {
+ IProcessStep step = iter.next();
result = step.preProcess(input, tempDir, containingInfs);
if (result != null)
input = result;
@@ -247,8 +247,8 @@ public class JarProcessor {
private File postProcess(File input, File tempDir) {
File result = null;
- for (Iterator iter = steps.iterator(); iter.hasNext();) {
- IProcessStep step = (IProcessStep) iter.next();
+ for (Iterator<IProcessStep> iter = steps.iterator(); iter.hasNext();) {
+ IProcessStep step = iter.next();
result = step.postProcess(input, tempDir, containingInfs);
if (result != null)
input = result;
@@ -258,8 +258,8 @@ public class JarProcessor {
private boolean adjustInf(File input, Properties inf) {
boolean adjusted = false;
- for (Iterator iter = steps.iterator(); iter.hasNext();) {
- IProcessStep step = (IProcessStep) iter.next();
+ for (Iterator<IProcessStep> iter = steps.iterator(); iter.hasNext();) {
+ IProcessStep step = iter.next();
adjusted |= step.adjustInf(input, inf, containingInfs);
}
return adjusted;
@@ -280,8 +280,8 @@ public class JarProcessor {
System.out.println("Skipping " + input.getPath()); //$NON-NLS-1$
else {
System.out.print("Running "); //$NON-NLS-1$
- for (Iterator iter = steps.iterator(); iter.hasNext();) {
- IProcessStep step = (IProcessStep) iter.next();
+ for (Iterator<IProcessStep> iter = steps.iterator(); iter.hasNext();) {
+ IProcessStep step = iter.next();
System.out.print(step.getStepName() + " "); //$NON-NLS-1$
}
System.out.println("on " + input.getPath()); //$NON-NLS-1$
@@ -307,7 +307,7 @@ public class JarProcessor {
JarFile jar = null;
try {
jar = new JarFile(workingFile, false);
- Map replacements = new HashMap();
+ Map<String, String> replacements = new HashMap<String, String>();
Properties inf = Utils.getEclipseInf(workingFile, verbose);
extractEntries(jar, tempDir, replacements, inf);
@@ -383,8 +383,8 @@ public class JarProcessor {
try {
jar = new JarFile(input, false);
jarOut = new JarOutputStream(new BufferedOutputStream(new FileOutputStream(tempJar)));
- Enumeration entries = jar.entries();
- for (JarEntry entry = (JarEntry) entries.nextElement(); entry != null; entry = entries.hasMoreElements() ? (JarEntry) entries.nextElement() : null) {
+ Enumeration<JarEntry> entries = jar.entries();
+ for (JarEntry entry = entries.nextElement(); entry != null; entry = entries.hasMoreElements() ? (JarEntry) entries.nextElement() : null) {
JarEntry newEntry = new JarEntry(entry.getName());
newEntry.setTime(entry.getTime());
jarIn = new BufferedInputStream(jar.getInputStream(entry));
diff --git a/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/internal/provisional/equinox/p2/jarprocessor/JarProcessorExecutor.java b/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/internal/provisional/equinox/p2/jarprocessor/JarProcessorExecutor.java
index 332333f..023d179 100644
--- a/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/internal/provisional/equinox/p2/jarprocessor/JarProcessorExecutor.java
+++ b/bundles/org.eclipse.equinox.p2.jarprocessor/src/org/eclipse/internal/provisional/equinox/p2/jarprocessor/JarProcessorExecutor.java
@@ -30,8 +30,8 @@ public class JarProcessorExecutor {
}
protected Options options = null;
- private Set packExclusions = null;
- private Set signExclusions = null;
+ private Set<String> packExclusions = null;
+ private Set<String> signExclusions = null;
public void runJarProcessor(Options processOptions) {
this.options = processOptions;
diff --git a/bundles/org.eclipse.equinox.p2.jarprocessor/src_ant/org/eclipse/equinox/internal/p2/jarprocessor/ant/AntBasedProcessorExecutor.java b/bundles/org.eclipse.equinox.p2.jarprocessor/src_ant/org/eclipse/equinox/internal/p2/jarprocessor/ant/AntBasedProcessorExecutor.java
index 959c74e..d685b25 100644
--- a/bundles/org.eclipse.equinox.p2.jarprocessor/src_ant/org/eclipse/equinox/internal/p2/jarprocessor/ant/AntBasedProcessorExecutor.java
+++ b/bundles/org.eclipse.equinox.p2.jarprocessor/src_ant/org/eclipse/equinox/internal/p2/jarprocessor/ant/AntBasedProcessorExecutor.java
@@ -21,8 +21,8 @@ public class AntBasedProcessorExecutor extends JarProcessorExecutor {
private final Project project;
private final Properties signArguments;
private final String antTaskName;
- private List inputFiles;
- private HashSet filterSet = null;
+ private List<File> inputFiles;
+ private HashSet<File> filterSet = null;
private FileFilter baseFilter = null;
public AntBasedProcessorExecutor(Properties signArguments, Project project, String antTaskName) {
@@ -36,7 +36,7 @@ public class AntBasedProcessorExecutor extends JarProcessorExecutor {
if (inputFiles == null || inputFiles.size() == 0)
return baseFilter;
- filterSet = new HashSet();
+ filterSet = new HashSet<File>();
filterSet.addAll(inputFiles);
return new FileFilter() {
public boolean accept(File pathname) {
@@ -45,7 +45,7 @@ public class AntBasedProcessorExecutor extends JarProcessorExecutor {
};
}
- protected HashSet getFilterSet() {
+ protected HashSet<File> getFilterSet() {
return filterSet;
}
@@ -67,7 +67,7 @@ public class AntBasedProcessorExecutor extends JarProcessorExecutor {
processor.addProcessStep(new AntSignCommand(properties, signArguments, project, antTaskName, opt.signCommand, opt.verbose));
}
- public void setInputFiles(List inputFiles) {
+ public void setInputFiles(List<File> inputFiles) {
this.inputFiles = inputFiles;
}
}
diff --git a/bundles/org.eclipse.equinox.p2.jarprocessor/src_ant/org/eclipse/equinox/internal/p2/jarprocessor/ant/AntSignCommand.java b/bundles/org.eclipse.equinox.p2.jarprocessor/src_ant/org/eclipse/equinox/internal/p2/jarprocessor/ant/AntSignCommand.java
index 591cf8c..8698723 100644
--- a/bundles/org.eclipse.equinox.p2.jarprocessor/src_ant/org/eclipse/equinox/internal/p2/jarprocessor/ant/AntSignCommand.java
+++ b/bundles/org.eclipse.equinox.p2.jarprocessor/src_ant/org/eclipse/equinox/internal/p2/jarprocessor/ant/AntSignCommand.java
@@ -31,7 +31,7 @@ public class AntSignCommand extends SignCommandStep {
this.antTaskName = antTaskName;
}
- public File postProcess(File input, File workingDirectory, List containers) {
+ public File postProcess(File input, File workingDirectory, List<Properties> containers) {
if (command != null && input != null && shouldSign(input, containers)) {
execute(input);
}
diff --git a/bundles/org.eclipse.equinox.p2.jarprocessor/src_ant/org/eclipse/equinox/internal/p2/jarprocessor/ant/JarProcessorTask.java b/bundles/org.eclipse.equinox.p2.jarprocessor/src_ant/org/eclipse/equinox/internal/p2/jarprocessor/ant/JarProcessorTask.java
index 91d2d4e..c057abd 100644
--- a/bundles/org.eclipse.equinox.p2.jarprocessor/src_ant/org/eclipse/equinox/internal/p2/jarprocessor/ant/JarProcessorTask.java
+++ b/bundles/org.eclipse.equinox.p2.jarprocessor/src_ant/org/eclipse/equinox/internal/p2/jarprocessor/ant/JarProcessorTask.java
@@ -25,7 +25,7 @@ import org.eclipse.internal.provisional.equinox.p2.jarprocessor.JarProcessorExec
public class JarProcessorTask extends Task {
private final Options options = new Options();
private final Properties signArgs = new Properties();
- private final ArrayList inputFiles = new ArrayList();
+ private final ArrayList<File> inputFiles = new ArrayList<File>();
public static final String ALIAS = "alias"; //$NON-NLS-1$
public static final String KEYSTORE = "keystore"; //$NON-NLS-1$
@@ -119,7 +119,7 @@ public class JarProcessorTask extends Task {
public void addConfiguredFile(FileSet fileset) {
DirectoryScanner scanner = fileset.getDirectoryScanner(getProject());
- String [] included = scanner.getIncludedFiles();
+ String[] included = scanner.getIncludedFiles();
for (int i = 0; i < included.length; i++) {
addInputFile(new File(scanner.getBasedir(), included[i]));
}