PR: 22336 Obtained from: Robert Stupp, using Jan Mat��rne's checkstyle check git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275076 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -466,9 +466,9 @@ public abstract class AbstractFileSet extends DataType implements Cloneable, | |||||
| return true; | 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())) { | if (ps.hasPatterns(getProject())) { | ||||
| return true; | return true; | ||||
| } | } | ||||
| @@ -141,8 +141,8 @@ public class CommandlineJava implements Cloneable { | |||||
| } | } | ||||
| } | } | ||||
| Properties propertySets = mergePropertySets(); | 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); | String value = propertySets.getProperty(key); | ||||
| listIt.add("-D" + key + "=" + value); | listIt.add("-D" + key + "=" + value); | ||||
| } | } | ||||
| @@ -324,14 +324,14 @@ public class FilterSet extends DataType implements Cloneable { | |||||
| in = new FileInputStream(filtersFile); | in = new FileInputStream(filtersFile); | ||||
| props.load(in); | props.load(in); | ||||
| Enumeration enum = props.propertyNames(); | |||||
| Enumeration e = props.propertyNames(); | |||||
| Vector filters = getFilters(); | Vector filters = getFilters(); | ||||
| while (enum.hasMoreElements()) { | |||||
| String strPropName = (String) enum.nextElement(); | |||||
| while (e.hasMoreElements()) { | |||||
| String strPropName = (String) e.nextElement(); | |||||
| String strValue = props.getProperty(strPropName); | String strValue = props.getProperty(strPropName); | ||||
| filters.addElement(new Filter(strPropName, strValue)); | filters.addElement(new Filter(strPropName, strValue)); | ||||
| } | } | ||||
| } catch (Exception e) { | |||||
| } catch (Exception ex) { | |||||
| throw new BuildException("Could not read filters from file: " | throw new BuildException("Could not read filters from file: " | ||||
| + filtersFile); | + filtersFile); | ||||
| } finally { | } finally { | ||||
| @@ -490,9 +490,9 @@ public class Path extends DataType implements Cloneable { | |||||
| return; | 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) { | if (o instanceof Reference) { | ||||
| o = ((Reference) o).getReferencedObject(p); | o = ((Reference) o).getReferencedObject(p); | ||||
| } | } | ||||
| @@ -265,21 +265,21 @@ public class PropertySet extends DataType { | |||||
| } | } | ||||
| } else if (ref.builtin != null) { | } else if (ref.builtin != null) { | ||||
| Enumeration enum = null; | |||||
| Enumeration e2 = null; | |||||
| if (ref.builtin.equals(BuiltinPropertySetName.ALL)) { | if (ref.builtin.equals(BuiltinPropertySetName.ALL)) { | ||||
| enum = properties.keys(); | |||||
| e2 = properties.keys(); | |||||
| } else if (ref.builtin.equals(BuiltinPropertySetName.SYSTEM)) { | } else if (ref.builtin.equals(BuiltinPropertySetName.SYSTEM)) { | ||||
| enum = System.getProperties().keys(); | |||||
| e2 = System.getProperties().keys(); | |||||
| } else if (ref.builtin.equals(BuiltinPropertySetName | } else if (ref.builtin.equals(BuiltinPropertySetName | ||||
| .COMMANDLINE)) { | .COMMANDLINE)) { | ||||
| enum = getProject().getUserProperties().keys(); | |||||
| e2 = getProject().getUserProperties().keys(); | |||||
| } else { | } else { | ||||
| throw new BuildException("Impossible: Invalid builtin " | throw new BuildException("Impossible: Invalid builtin " | ||||
| + "attribute!"); | + "attribute!"); | ||||
| } | } | ||||
| while (enum.hasMoreElements()) { | |||||
| names.addElement(enum.nextElement()); | |||||
| while (e2.hasMoreElements()) { | |||||
| names.addElement(e2.nextElement()); | |||||
| } | } | ||||
| } else { | } else { | ||||
| @@ -390,9 +390,9 @@ public class XMLCatalog extends DataType | |||||
| // Add all nested elements to our catalog | // Add all nested elements to our catalog | ||||
| Vector newElements = catalog.getElements(); | Vector newElements = catalog.getElements(); | ||||
| Vector ourElements = 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 | // 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. | * of the Resource or null if no such information is available. | ||||
| */ | */ | ||||
| private ResourceLocation findMatchingEntry(String publicId) { | private ResourceLocation findMatchingEntry(String publicId) { | ||||
| Enumeration enum = getElements().elements(); | |||||
| Enumeration e = getElements().elements(); | |||||
| ResourceLocation element = null; | ResourceLocation element = null; | ||||
| while (enum.hasMoreElements()) { | |||||
| Object o = enum.nextElement(); | |||||
| while (e.hasMoreElements()) { | |||||
| Object o = e.nextElement(); | |||||
| if (o instanceof ResourceLocation) { | if (o instanceof ResourceLocation) { | ||||
| element = (ResourceLocation) o; | element = (ResourceLocation) o; | ||||
| if (element.getPublicId().equals(publicId)) { | if (element.getPublicId().equals(publicId)) { | ||||
| @@ -259,9 +259,9 @@ public class ZipScanner extends DirectoryScanner { | |||||
| throw new BuildException("problem opening " + srcFile, ex); | 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()), | myentries.put(new String(entry.getName()), | ||||
| new Resource(entry.getName(), true, | new Resource(entry.getName(), true, | ||||
| entry.getTime(), | entry.getTime(), | ||||
| @@ -90,9 +90,9 @@ public class Watchdog implements Runnable { | |||||
| } | } | ||||
| protected final void fireTimeoutOccured() { | 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); | |||||
| } | } | ||||
| } | } | ||||
| @@ -152,9 +152,9 @@ public class FacadeTaskHelper { | |||||
| */ | */ | ||||
| public String[] getArgs() { | public String[] getArgs() { | ||||
| Vector tmp = new Vector(args.size()); | Vector tmp = new Vector(args.size()); | ||||
| for (Enumeration enum = args.elements(); enum.hasMoreElements();) { | |||||
| for (Enumeration e = args.elements(); e.hasMoreElements();) { | |||||
| ImplementationSpecificArgument arg = | ImplementationSpecificArgument arg = | ||||
| ((ImplementationSpecificArgument) enum.nextElement()); | |||||
| ((ImplementationSpecificArgument) e.nextElement()); | |||||
| String[] curr = arg.getParts(getImplementation()); | String[] curr = arg.getParts(getImplementation()); | ||||
| for (int i = 0; i < curr.length; i++) { | for (int i = 0; i < curr.length; i++) { | ||||
| tmp.addElement(curr[i]); | tmp.addElement(curr[i]); | ||||
| @@ -429,9 +429,9 @@ public class ZipFile { | |||||
| */ | */ | ||||
| private void resolveLocalFileHeaderData() | private void resolveLocalFileHeaderData() | ||||
| throws IOException { | 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(); | long offset = ((Long) entries.get(ze)).longValue(); | ||||
| archive.seek(offset + LFH_OFFSET_FOR_FILENAME_LENGTH); | archive.seek(offset + LFH_OFFSET_FOR_FILENAME_LENGTH); | ||||
| byte[] b = new byte[2]; | byte[] b = new byte[2]; | ||||