peterreilly 2003/08/13 08:02:29 Modified: src/main/org/apache/tools/ant/taskdefs/condition And.java Or.java src/main/org/apache/tools/ant/taskdefs/cvslib ChangeLogParser.java src/main/org/apache/tools/ant/taskdefs/optional EchoProperties.java Javah.java NetRexxC.java Rpm.java src/main/org/apache/tools/ant/taskdefs/optional/j2ee ServerDeploy.java src/main/org/apache/tools/ant/taskdefs/optional/jsp JspC.java src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers DefaultJspCompilerAdapter.java src/main/org/apache/tools/ant/taskdefs/optional/junit JUnitTask.java JUnitTestRunner.java XMLResultAggregator.java src/main/org/apache/tools/ant/taskdefs/optional/sitraka XMLReport.java src/main/org/apache/tools/ant/taskdefs/optional/sitraka/bytecode ClassPathLoader.java Log: removing enum variabe PR: 22345 Revision Changes Path 1.9 +4 -4 ant/src/main/org/apache/tools/ant/taskdefs/condition/And.java Index: And.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/condition/And.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- And.java 25 Jul 2003 08:28:21 -0000 1.8 +++ And.java 13 Aug 2003 15:02:28 -0000 1.9 @@ -74,9 +74,9 @@ * @exception BuildException if an error occurs */ public boolean eval() throws BuildException { - Enumeration enum = getConditions(); - while (enum.hasMoreElements()) { - Condition c = (Condition) enum.nextElement(); + Enumeration e = getConditions(); + while (e.hasMoreElements()) { + Condition c = (Condition) e.nextElement(); if (!c.eval()) { return false; } 1.9 +4 -4 ant/src/main/org/apache/tools/ant/taskdefs/condition/Or.java Index: Or.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/condition/Or.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- Or.java 25 Jul 2003 08:28:21 -0000 1.8 +++ Or.java 13 Aug 2003 15:02:28 -0000 1.9 @@ -74,9 +74,9 @@ * @exception BuildException if an error occurs */ public boolean eval() throws BuildException { - Enumeration enum = getConditions(); - while (enum.hasMoreElements()) { - Condition c = (Condition) enum.nextElement(); + Enumeration e = getConditions(); + while (e.hasMoreElements()) { + Condition c = (Condition) e.nextElement(); if (c.eval()) { return true; } 1.20 +4 -4 ant/src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogParser.java Index: ChangeLogParser.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogParser.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- ChangeLogParser.java 17 Jul 2003 15:44:39 -0000 1.19 +++ ChangeLogParser.java 13 Aug 2003 15:02:28 -0000 1.20 @@ -103,10 +103,10 @@ */ CVSEntry[] getEntrySetAsArray() { final CVSEntry[] array = new CVSEntry[ m_entries.size() ]; - Enumeration enum = m_entries.elements(); + Enumeration e = m_entries.elements(); int i = 0; - while (enum.hasMoreElements()) { - array[i++] = (CVSEntry) enum.nextElement(); + while (e.hasMoreElements()) { + array[i++] = (CVSEntry) e.nextElement(); } return array; } 1.21 +7 -7 ant/src/main/org/apache/tools/ant/taskdefs/optional/EchoProperties.java Index: EchoProperties.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/EchoProperties.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- EchoProperties.java 18 Jul 2003 12:45:57 -0000 1.20 +++ EchoProperties.java 13 Aug 2003 15:02:28 -0000 1.21 @@ -302,9 +302,9 @@ } } - Enumeration enum = propertySets.elements(); - while (enum.hasMoreElements()) { - PropertySet ps = (PropertySet) enum.nextElement(); + Enumeration e = propertySets.elements(); + while (e.hasMoreElements()) { + PropertySet ps = (PropertySet) e.nextElement(); CollectionUtils.putAll(allProps, ps.getProperties()); } @@ -348,7 +348,7 @@ if (os != null) { try { os.close(); - } catch (IOException e) { + } catch (IOException ex) { //ignore } } @@ -369,9 +369,9 @@ protected void saveProperties(Hashtable allProps, OutputStream os) throws IOException, BuildException { Properties props = new Properties(); - Enumeration enum = allProps.keys(); - while (enum.hasMoreElements()) { - String name = enum.nextElement().toString(); + Enumeration e = allProps.keys(); + while (e.hasMoreElements()) { + String name = e.nextElement().toString(); String value = allProps.get(name).toString(); props.put(name, value); } 1.26 +3 -3 ant/src/main/org/apache/tools/ant/taskdefs/optional/Javah.java Index: Javah.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/Javah.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- Javah.java 18 Jul 2003 12:45:57 -0000 1.25 +++ Javah.java 13 Aug 2003 15:02:28 -0000 1.26 @@ -449,9 +449,9 @@ } } - Enumeration enum = classes.elements(); - while (enum.hasMoreElements()) { - ClassArgument arg = (ClassArgument) enum.nextElement(); + Enumeration e = classes.elements(); + while (e.hasMoreElements()) { + ClassArgument arg = (ClassArgument) e.nextElement(); String aClass = arg.getName(); cmd.createArgument().setValue(aClass); niceClassList.append(" " + aClass + lSep); 1.26 +3 -3 ant/src/main/org/apache/tools/ant/taskdefs/optional/NetRexxC.java Index: NetRexxC.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/NetRexxC.java,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- NetRexxC.java 18 Jul 2003 12:45:57 -0000 1.25 +++ NetRexxC.java 13 Aug 2003 15:02:28 -0000 1.26 @@ -701,10 +701,10 @@ + (filecopyList.size() == 1 ? "" : "s") + " to " + destDir.getAbsolutePath()); - Enumeration enum = filecopyList.keys(); + Enumeration e = filecopyList.keys(); - while (enum.hasMoreElements()) { - String fromFile = (String) enum.nextElement(); + while (e.hasMoreElements()) { + String fromFile = (String) e.nextElement(); String toFile = (String) filecopyList.get(fromFile); try { 1.17 +2 -2 ant/src/main/org/apache/tools/ant/taskdefs/optional/Rpm.java Index: Rpm.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/Rpm.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- Rpm.java 18 Jul 2003 12:45:57 -0000 1.16 +++ Rpm.java 13 Aug 2003 15:02:28 -0000 1.17 @@ -310,8 +310,8 @@ protected String guessRpmBuildCommand() { Vector env = Execute.getProcEnvironment(); String path = null; - for (Enumeration enum = env.elements(); enum.hasMoreElements();) { - String var = (String) enum.nextElement(); + for (Enumeration e = env.elements(); e.hasMoreElements();) { + String var = (String) e.nextElement(); if (var.startsWith("PATH=") || var.startsWith("Path=")) { path = var.substring(6 /* "PATH=".length() + 1 */); break; 1.11 +3 -3 ant/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/ServerDeploy.java Index: ServerDeploy.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/j2ee/ServerDeploy.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- ServerDeploy.java 19 Jul 2003 11:20:18 -0000 1.10 +++ ServerDeploy.java 13 Aug 2003 15:02:28 -0000 1.11 @@ -138,9 +138,9 @@ * are invalid or incomplete, or a failure occurs in the deployment process. */ public void execute() throws BuildException { - for (Enumeration enum = vendorTools.elements(); - enum.hasMoreElements();) { - HotDeploymentTool tool = (HotDeploymentTool) enum.nextElement(); + for (Enumeration e = vendorTools.elements(); + e.hasMoreElements();) { + HotDeploymentTool tool = (HotDeploymentTool) e.nextElement(); tool.validateAttributes(); tool.deploy(); } 1.36 +3 -3 ant/src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspC.java Index: JspC.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspC.java,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- JspC.java 19 Jul 2003 08:11:05 -0000 1.35 +++ JspC.java 13 Aug 2003 15:02:28 -0000 1.36 @@ -614,9 +614,9 @@ */ public void deleteEmptyJavaFiles() { if (javaFiles != null) { - Enumeration enum = javaFiles.elements(); - while (enum.hasMoreElements()) { - File file = (File) enum.nextElement(); + Enumeration e = javaFiles.elements(); + while (e.hasMoreElements()) { + File file = (File) e.nextElement(); if (file.exists() && file.length() == 0) { log("deleting empty output file " + file); file.delete(); 1.10 +3 -3 ant/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/DefaultJspCompilerAdapter.java Index: DefaultJspCompilerAdapter.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/jsp/compilers/DefaultJspCompilerAdapter.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- DefaultJspCompilerAdapter.java 19 Jul 2003 08:11:05 -0000 1.9 +++ DefaultJspCompilerAdapter.java 13 Aug 2003 15:02:28 -0000 1.10 @@ -91,9 +91,9 @@ niceSourceList.append(lSep); - Enumeration enum = compileList.elements(); - while (enum.hasMoreElements()) { - String arg = (String) enum.nextElement(); + Enumeration e = compileList.elements(); + while (e.hasMoreElements()) { + String arg = (String) e.nextElement(); cmd.createArgument().setValue(arg); niceSourceList.append(" " + arg + lSep); } 1.77 +21 -21 ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java Index: JUnitTask.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java,v retrieving revision 1.76 retrieving revision 1.77 diff -u -r1.76 -r1.77 --- JUnitTask.java 13 Aug 2003 13:28:12 -0000 1.76 +++ JUnitTask.java 13 Aug 2003 15:02:28 -0000 1.77 @@ -204,9 +204,9 @@ * @since Ant 1.5 */ public void setFiltertrace(boolean value) { - Enumeration enum = allTests(); - while (enum.hasMoreElements()) { - BaseTest test = (BaseTest) enum.nextElement(); + Enumeration e = allTests(); + while (e.hasMoreElements()) { + BaseTest test = (BaseTest) e.nextElement(); test.setFiltertrace(value); } } @@ -222,9 +222,9 @@ * @since Ant 1.2 */ public void setHaltonerror(boolean value) { - Enumeration enum = allTests(); - while (enum.hasMoreElements()) { - BaseTest test = (BaseTest) enum.nextElement(); + Enumeration e = allTests(); + while (e.hasMoreElements()) { + BaseTest test = (BaseTest) e.nextElement(); test.setHaltonerror(value); } } @@ -241,9 +241,9 @@ * @since Ant 1.4 */ public void setErrorProperty(String propertyName) { - Enumeration enum = allTests(); - while (enum.hasMoreElements()) { - BaseTest test = (BaseTest) enum.nextElement(); + Enumeration e = allTests(); + while (e.hasMoreElements()) { + BaseTest test = (BaseTest) e.nextElement(); test.setErrorProperty(propertyName); } } @@ -260,9 +260,9 @@ * @since Ant 1.2 */ public void setHaltonfailure(boolean value) { - Enumeration enum = allTests(); - while (enum.hasMoreElements()) { - BaseTest test = (BaseTest) enum.nextElement(); + Enumeration e = allTests(); + while (e.hasMoreElements()) { + BaseTest test = (BaseTest) e.nextElement(); test.setHaltonfailure(value); } } @@ -279,9 +279,9 @@ * @since Ant 1.4 */ public void setFailureProperty(String propertyName) { - Enumeration enum = allTests(); - while (enum.hasMoreElements()) { - BaseTest test = (BaseTest) enum.nextElement(); + Enumeration e = allTests(); + while (e.hasMoreElements()) { + BaseTest test = (BaseTest) e.nextElement(); test.setFailureProperty(propertyName); } } @@ -300,9 +300,9 @@ * @since Ant 1.2 */ public void setFork(boolean value) { - Enumeration enum = allTests(); - while (enum.hasMoreElements()) { - BaseTest test = (BaseTest) enum.nextElement(); + Enumeration e = allTests(); + while (e.hasMoreElements()) { + BaseTest test = (BaseTest) e.nextElement(); test.setFork(value); } } @@ -739,8 +739,8 @@ + propsFile.getAbsolutePath()); Hashtable p = getProject().getProperties(); Properties props = new Properties(); - for (Enumeration enum = p.keys(); enum.hasMoreElements();) { - Object key = enum.nextElement(); + for (Enumeration e = p.keys(); e.hasMoreElements();) { + Object key = e.nextElement(); props.put(key, p.get(key)); } try { 1.40 +2 -2 ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java Index: JUnitTestRunner.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.java,v retrieving revision 1.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- JUnitTestRunner.java 19 Jul 2003 08:11:05 -0000 1.39 +++ JUnitTestRunner.java 13 Aug 2003 15:02:28 -0000 1.40 @@ -525,8 +525,8 @@ // Add/overlay system properties on the properties from the Ant project Hashtable p = System.getProperties(); - for (Enumeration enum = p.keys(); enum.hasMoreElements();) { - Object key = enum.nextElement(); + for (Enumeration e = p.keys(); e.hasMoreElements();) { + Object key = e.nextElement(); props.put(key, p.get(key)); } t.setProperties(props); 1.25 +3 -3 ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLResultAggregator.java Index: XMLResultAggregator.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLResultAggregator.java,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- XMLResultAggregator.java 19 Jul 2003 11:20:19 -0000 1.24 +++ XMLResultAggregator.java 13 Aug 2003 15:02:28 -0000 1.25 @@ -165,10 +165,10 @@ throw new BuildException("Unable to write test aggregate to '" + destFile + "'", e); } // apply transformation - Enumeration enum = transformers.elements(); - while (enum.hasMoreElements()) { + Enumeration e = transformers.elements(); + while (e.hasMoreElements()) { AggregateTransformer transformer = - (AggregateTransformer) enum.nextElement(); + (AggregateTransformer) e.nextElement(); transformer.setXmlDocument(rootElement.getOwnerDocument()); transformer.transform(); } 1.15 +8 -8 ant/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/XMLReport.java Index: XMLReport.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/XMLReport.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- XMLReport.java 19 Jul 2003 11:20:20 -0000 1.14 +++ XMLReport.java 13 Aug 2003 15:02:28 -0000 1.15 @@ -198,9 +198,9 @@ // Iterate over the classpath to identify reference classes classFiles = new Hashtable(); ClassPathLoader cpl = new ClassPathLoader(classPath); - Enumeration enum = cpl.loaders(); - while (enum.hasMoreElements()) { - ClassPathLoader.FileLoader fl = (ClassPathLoader.FileLoader) enum.nextElement(); + Enumeration e = cpl.loaders(); + while (e.hasMoreElements()) { + ClassPathLoader.FileLoader fl = (ClassPathLoader.FileLoader) e.nextElement(); ClassFile[] classes = fl.getClasses(); log("Processing " + classes.length + " classes in " + fl.getFile()); // process all classes @@ -435,9 +435,9 @@ int total_lines = 0; // use the map for access, all nodes should be there - Enumeration enum = pkgMap.elements(); - while (enum.hasMoreElements()) { - Element pkgElem = (Element) enum.nextElement(); + Enumeration e = pkgMap.elements(); + while (e.hasMoreElements()) { + Element pkgElem = (Element) e.nextElement(); String pkgname = pkgElem.getAttribute("name"); Element[] classes = getClasses(pkgElem); int pkg_calls = 0; @@ -461,10 +461,10 @@ pkg_total_methods += Integer.parseInt(covdata.getAttribute("total_methods")); pkg_hit_lines += Integer.parseInt(covdata.getAttribute("hit_lines")); pkg_total_lines += Integer.parseInt(covdata.getAttribute("total_lines")); - } catch (NumberFormatException e) { + } catch (NumberFormatException ex) { log("Error parsing '" + classname + "' (" + j + "/" + classes.length + ") in package '" + pkgname + "'"); - throw e; + throw ex; } } Element covdata = getCovDataChild(pkgElem); 1.15 +3 -3 ant/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/bytecode/ClassPathLoader.java Index: ClassPathLoader.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/bytecode/ClassPathLoader.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- ClassPathLoader.java 19 Jul 2003 11:20:21 -0000 1.14 +++ ClassPathLoader.java 13 Aug 2003 15:02:29 -0000 1.15 @@ -145,9 +145,9 @@ */ public Hashtable getClasses() throws IOException { Hashtable map = new Hashtable(); - Enumeration enum = loaders(); - while (enum.hasMoreElements()) { - FileLoader loader = (FileLoader) enum.nextElement(); + Enumeration e = loaders(); + while (e.hasMoreElements()) { + FileLoader loader = (FileLoader) e.nextElement(); System.out.println("Processing " + loader.getFile()); long t0 = System.currentTimeMillis(); ClassFile[] classes = loader.getClasses();
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]