diff --git a/src/main/org/apache/tools/ant/types/AbstractFileSet.java b/src/main/org/apache/tools/ant/types/AbstractFileSet.java index 88ac4987a..fecc37e5e 100644 --- a/src/main/org/apache/tools/ant/types/AbstractFileSet.java +++ b/src/main/org/apache/tools/ant/types/AbstractFileSet.java @@ -466,9 +466,9 @@ public abstract class AbstractFileSet extends DataType implements Cloneable, return true; } - Enumeration enum = additionalPatterns.elements(); - while (enum.hasMoreElements()) { - PatternSet ps = (PatternSet) enum.nextElement(); + Enumeration e = additionalPatterns.elements(); + while (e.hasMoreElements()) { + PatternSet ps = (PatternSet) e.nextElement(); if (ps.hasPatterns(getProject())) { return true; } diff --git a/src/main/org/apache/tools/ant/types/CommandlineJava.java b/src/main/org/apache/tools/ant/types/CommandlineJava.java index ad2e0b971..db7945369 100644 --- a/src/main/org/apache/tools/ant/types/CommandlineJava.java +++ b/src/main/org/apache/tools/ant/types/CommandlineJava.java @@ -141,8 +141,8 @@ public class CommandlineJava implements Cloneable { } } Properties propertySets = mergePropertySets(); - for (Enumeration enum = propertySets.keys(); enum.hasMoreElements();) { - String key = (String) enum.nextElement(); + for (Enumeration e = propertySets.keys(); e.hasMoreElements();) { + String key = (String) e.nextElement(); String value = propertySets.getProperty(key); listIt.add("-D" + key + "=" + value); } diff --git a/src/main/org/apache/tools/ant/types/FilterSet.java b/src/main/org/apache/tools/ant/types/FilterSet.java index d9a549530..c934c4aab 100644 --- a/src/main/org/apache/tools/ant/types/FilterSet.java +++ b/src/main/org/apache/tools/ant/types/FilterSet.java @@ -324,14 +324,14 @@ public class FilterSet extends DataType implements Cloneable { in = new FileInputStream(filtersFile); props.load(in); - Enumeration enum = props.propertyNames(); + Enumeration e = props.propertyNames(); Vector filters = getFilters(); - while (enum.hasMoreElements()) { - String strPropName = (String) enum.nextElement(); + while (e.hasMoreElements()) { + String strPropName = (String) e.nextElement(); String strValue = props.getProperty(strPropName); filters.addElement(new Filter(strPropName, strValue)); } - } catch (Exception e) { + } catch (Exception ex) { throw new BuildException("Could not read filters from file: " + filtersFile); } finally { diff --git a/src/main/org/apache/tools/ant/types/Path.java b/src/main/org/apache/tools/ant/types/Path.java index 6f5657022..4b54828b9 100644 --- a/src/main/org/apache/tools/ant/types/Path.java +++ b/src/main/org/apache/tools/ant/types/Path.java @@ -490,9 +490,9 @@ public class Path extends DataType implements Cloneable { return; } - Enumeration enum = elements.elements(); - while (enum.hasMoreElements()) { - Object o = enum.nextElement(); + Enumeration e = elements.elements(); + while (e.hasMoreElements()) { + Object o = e.nextElement(); if (o instanceof Reference) { o = ((Reference) o).getReferencedObject(p); } diff --git a/src/main/org/apache/tools/ant/types/PropertySet.java b/src/main/org/apache/tools/ant/types/PropertySet.java index fa285c9cd..485be383c 100644 --- a/src/main/org/apache/tools/ant/types/PropertySet.java +++ b/src/main/org/apache/tools/ant/types/PropertySet.java @@ -265,21 +265,21 @@ public class PropertySet extends DataType { } } else if (ref.builtin != null) { - Enumeration enum = null; + Enumeration e2 = null; if (ref.builtin.equals(BuiltinPropertySetName.ALL)) { - enum = properties.keys(); + e2 = properties.keys(); } else if (ref.builtin.equals(BuiltinPropertySetName.SYSTEM)) { - enum = System.getProperties().keys(); + e2 = System.getProperties().keys(); } else if (ref.builtin.equals(BuiltinPropertySetName .COMMANDLINE)) { - enum = getProject().getUserProperties().keys(); + e2 = getProject().getUserProperties().keys(); } else { throw new BuildException("Impossible: Invalid builtin " + "attribute!"); } - while (enum.hasMoreElements()) { - names.addElement(enum.nextElement()); + while (e2.hasMoreElements()) { + names.addElement(e2.nextElement()); } } else { diff --git a/src/main/org/apache/tools/ant/types/XMLCatalog.java b/src/main/org/apache/tools/ant/types/XMLCatalog.java index 647f2d23a..ac4002432 100644 --- a/src/main/org/apache/tools/ant/types/XMLCatalog.java +++ b/src/main/org/apache/tools/ant/types/XMLCatalog.java @@ -390,9 +390,9 @@ public class XMLCatalog extends DataType // Add all nested elements to our catalog Vector newElements = catalog.getElements(); Vector ourElements = getElements(); - Enumeration enum = newElements.elements(); - while (enum.hasMoreElements()) { - ourElements.addElement(enum.nextElement()); + Enumeration e = newElements.elements(); + while (e.hasMoreElements()) { + ourElements.addElement(e.nextElement()); } // Append the classpath of the nested catalog @@ -630,10 +630,10 @@ public class XMLCatalog extends DataType * of the Resource or null if no such information is available. */ private ResourceLocation findMatchingEntry(String publicId) { - Enumeration enum = getElements().elements(); + Enumeration e = getElements().elements(); ResourceLocation element = null; - while (enum.hasMoreElements()) { - Object o = enum.nextElement(); + while (e.hasMoreElements()) { + Object o = e.nextElement(); if (o instanceof ResourceLocation) { element = (ResourceLocation) o; if (element.getPublicId().equals(publicId)) { diff --git a/src/main/org/apache/tools/ant/types/ZipScanner.java b/src/main/org/apache/tools/ant/types/ZipScanner.java index fa0de815e..a291fed33 100644 --- a/src/main/org/apache/tools/ant/types/ZipScanner.java +++ b/src/main/org/apache/tools/ant/types/ZipScanner.java @@ -259,9 +259,9 @@ public class ZipScanner extends DirectoryScanner { throw new BuildException("problem opening " + srcFile, ex); } - Enumeration enum = zf.getEntries(); - while (enum.hasMoreElements()) { - entry = (ZipEntry) enum.nextElement(); + Enumeration e = zf.getEntries(); + while (e.hasMoreElements()) { + entry = (ZipEntry) e.nextElement(); myentries.put(new String(entry.getName()), new Resource(entry.getName(), true, entry.getTime(), diff --git a/src/main/org/apache/tools/ant/util/Watchdog.java b/src/main/org/apache/tools/ant/util/Watchdog.java index cc7836679..85ba59a9b 100644 --- a/src/main/org/apache/tools/ant/util/Watchdog.java +++ b/src/main/org/apache/tools/ant/util/Watchdog.java @@ -90,9 +90,9 @@ public class Watchdog implements Runnable { } protected final void fireTimeoutOccured() { - Enumeration enum = observers.elements(); - while (enum.hasMoreElements()) { - ((TimeoutObserver) enum.nextElement()).timeoutOccured(this); + Enumeration e = observers.elements(); + while (e.hasMoreElements()) { + ((TimeoutObserver) e.nextElement()).timeoutOccured(this); } } diff --git a/src/main/org/apache/tools/ant/util/facade/FacadeTaskHelper.java b/src/main/org/apache/tools/ant/util/facade/FacadeTaskHelper.java index e3134d99e..075d7d371 100644 --- a/src/main/org/apache/tools/ant/util/facade/FacadeTaskHelper.java +++ b/src/main/org/apache/tools/ant/util/facade/FacadeTaskHelper.java @@ -152,9 +152,9 @@ public class FacadeTaskHelper { */ public String[] getArgs() { Vector tmp = new Vector(args.size()); - for (Enumeration enum = args.elements(); enum.hasMoreElements();) { + for (Enumeration e = args.elements(); e.hasMoreElements();) { ImplementationSpecificArgument arg = - ((ImplementationSpecificArgument) enum.nextElement()); + ((ImplementationSpecificArgument) e.nextElement()); String[] curr = arg.getParts(getImplementation()); for (int i = 0; i < curr.length; i++) { tmp.addElement(curr[i]); diff --git a/src/main/org/apache/tools/zip/ZipFile.java b/src/main/org/apache/tools/zip/ZipFile.java index 44a520b20..cfbfac99b 100644 --- a/src/main/org/apache/tools/zip/ZipFile.java +++ b/src/main/org/apache/tools/zip/ZipFile.java @@ -429,9 +429,9 @@ public class ZipFile { */ private void resolveLocalFileHeaderData() throws IOException { - Enumeration enum = getEntries(); - while (enum.hasMoreElements()) { - ZipEntry ze = (ZipEntry) enum.nextElement(); + Enumeration e = getEntries(); + while (e.hasMoreElements()) { + ZipEntry ze = (ZipEntry) e.nextElement(); long offset = ((Long) entries.get(ze)).longValue(); archive.seek(offset + LFH_OFFSET_FOR_FILENAME_LENGTH); byte[] b = new byte[2];