Browse Source

removing enum variable

PR: 22345
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275074 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Reilly 22 years ago
parent
commit
9434671efa
14 changed files with 70 additions and 70 deletions
  1. +6
    -6
      src/main/org/apache/tools/ant/ComponentHelper.java
  2. +3
    -3
      src/main/org/apache/tools/ant/RuntimeConfigurable.java
  3. +3
    -3
      src/main/org/apache/tools/ant/Task.java
  4. +3
    -3
      src/main/org/apache/tools/ant/input/DefaultInputHandler.java
  5. +4
    -4
      src/main/org/apache/tools/ant/taskdefs/Ant.java
  6. +6
    -6
      src/main/org/apache/tools/ant/taskdefs/AntStructure.java
  7. +3
    -3
      src/main/org/apache/tools/ant/taskdefs/Concat.java
  8. +3
    -3
      src/main/org/apache/tools/ant/taskdefs/Copydir.java
  9. +3
    -3
      src/main/org/apache/tools/ant/taskdefs/Expand.java
  10. +9
    -9
      src/main/org/apache/tools/ant/taskdefs/Jar.java
  11. +18
    -18
      src/main/org/apache/tools/ant/taskdefs/Javadoc.java
  12. +3
    -3
      src/main/org/apache/tools/ant/taskdefs/Replace.java
  13. +3
    -3
      src/main/org/apache/tools/ant/taskdefs/UpToDate.java
  14. +3
    -3
      src/main/org/apache/tools/ant/taskdefs/Zip.java

+ 6
- 6
src/main/org/apache/tools/ant/ComponentHelper.java View File

@@ -746,9 +746,9 @@ public class ComponentHelper {
} }
props.load(in); props.load(in);


Enumeration enum = props.propertyNames();
while (enum.hasMoreElements()) {
String name = (String) enum.nextElement();
Enumeration e = props.propertyNames();
while (e.hasMoreElements()) {
String name = (String) e.nextElement();
String className = props.getProperty(name); String className = props.getProperty(name);
AntTypeDefinition def = new AntTypeDefinition(); AntTypeDefinition def = new AntTypeDefinition();
def.setName(name); def.setName(name);
@@ -791,9 +791,9 @@ public class ComponentHelper {
} }
props.load(in); props.load(in);


Enumeration enum = props.propertyNames();
while (enum.hasMoreElements()) {
String name = (String) enum.nextElement();
Enumeration e = props.propertyNames();
while (e.hasMoreElements()) {
String name = (String) e.nextElement();
String className = props.getProperty(name); String className = props.getProperty(name);
AntTypeDefinition def = new AntTypeDefinition(); AntTypeDefinition def = new AntTypeDefinition();
def.setName(name); def.setName(name);


+ 3
- 3
src/main/org/apache/tools/ant/RuntimeConfigurable.java View File

@@ -419,10 +419,10 @@ public class RuntimeConfigurable implements Serializable {
ProjectHelper.addText(p, wrappedObject, characters.substring(0)); ProjectHelper.addText(p, wrappedObject, characters.substring(0));
} }


Enumeration enum = getChildren();
while (enum.hasMoreElements()) {
Enumeration e = getChildren();
while (e.hasMoreElements()) {
RuntimeConfigurable child RuntimeConfigurable child
= (RuntimeConfigurable) enum.nextElement();
= (RuntimeConfigurable) e.nextElement();
if (child.wrappedObject instanceof Task) { if (child.wrappedObject instanceof Task) {
Task childTask = (Task) child.wrappedObject; Task childTask = (Task) child.wrappedObject;
childTask.setRuntimeConfigurableWrapper(child); childTask.setRuntimeConfigurableWrapper(child);


+ 3
- 3
src/main/org/apache/tools/ant/Task.java View File

@@ -474,10 +474,10 @@ public abstract class Task extends ProjectComponent {
*/ */
private void replaceChildren(RuntimeConfigurable wrapper, private void replaceChildren(RuntimeConfigurable wrapper,
UnknownElement parentElement) { UnknownElement parentElement) {
Enumeration enum = wrapper.getChildren();
while (enum.hasMoreElements()) {
Enumeration e = wrapper.getChildren();
while (e.hasMoreElements()) {
RuntimeConfigurable childWrapper = RuntimeConfigurable childWrapper =
(RuntimeConfigurable) enum.nextElement();
(RuntimeConfigurable) e.nextElement();
UnknownElement childElement = UnknownElement childElement =
new UnknownElement(childWrapper.getElementTag()); new UnknownElement(childWrapper.getElementTag());
parentElement.addChild(childElement); parentElement.addChild(childElement);


+ 3
- 3
src/main/org/apache/tools/ant/input/DefaultInputHandler.java View File

@@ -124,14 +124,14 @@ public class DefaultInputHandler implements InputHandler {
if (request instanceof MultipleChoiceInputRequest) { if (request instanceof MultipleChoiceInputRequest) {
StringBuffer sb = new StringBuffer(prompt); StringBuffer sb = new StringBuffer(prompt);
sb.append("("); sb.append("(");
Enumeration enum =
Enumeration e =
((MultipleChoiceInputRequest) request).getChoices().elements(); ((MultipleChoiceInputRequest) request).getChoices().elements();
boolean first = true; boolean first = true;
while (enum.hasMoreElements()) {
while (e.hasMoreElements()) {
if (!first) { if (!first) {
sb.append(","); sb.append(",");
} }
sb.append(enum.nextElement());
sb.append(e.nextElement());
first = false; first = false;
} }
sb.append(")"); sb.append(")");


+ 4
- 4
src/main/org/apache/tools/ant/taskdefs/Ant.java View File

@@ -384,16 +384,16 @@ public class Ant extends Task {
} finally { } finally {
// help the gc // help the gc
newProject = null; newProject = null;
Enumeration enum = properties.elements();
while (enum.hasMoreElements()) {
Property p = (Property) enum.nextElement();
Enumeration e = properties.elements();
while (e.hasMoreElements()) {
Property p = (Property) e.nextElement();
p.setProject(null); p.setProject(null);
} }


if (output != null && out != null) { if (output != null && out != null) {
try { try {
out.close(); out.close();
} catch (final Exception e) {
} catch (final Exception ex) {
//ignore //ignore
} }
} }


+ 6
- 6
src/main/org/apache/tools/ant/taskdefs/AntStructure.java View File

@@ -272,9 +272,9 @@ public class AntStructure extends Task {
v.addElement(TASKS); v.addElement(TASKS);
} }


Enumeration enum = ih.getNestedElements();
while (enum.hasMoreElements()) {
v.addElement(enum.nextElement());
Enumeration e = ih.getNestedElements();
while (e.hasMoreElements()) {
v.addElement(e.nextElement());
} }


if (v.isEmpty()) { if (v.isEmpty()) {
@@ -300,9 +300,9 @@ public class AntStructure extends Task {
sb.append(name); sb.append(name);
sb.append(lSep).append(" id ID #IMPLIED"); sb.append(lSep).append(" id ID #IMPLIED");


enum = ih.getAttributes();
while (enum.hasMoreElements()) {
String attrName = (String) enum.nextElement();
e = ih.getAttributes();
while (e.hasMoreElements()) {
String attrName = (String) e.nextElement();
if ("id".equals(attrName)) { if ("id".equals(attrName)) {
continue; continue;
} }


+ 3
- 3
src/main/org/apache/tools/ant/taskdefs/Concat.java View File

@@ -304,12 +304,12 @@ public class Concat extends Task {
* Specify the end of line to find and to add if * Specify the end of line to find and to add if
* not present at end of each input file. This attribute * not present at end of each input file. This attribute
* is used in conjuction with fixlastline. * is used in conjuction with fixlastline.
* @param enum the type of new line to add -
* @param crlf the type of new line to add -
* cr, mac, lf, unix, crlf, or dos * cr, mac, lf, unix, crlf, or dos
* @since Ant 1.6 * @since Ant 1.6
*/ */
public void setEol(FixCRLF.CrLf enum) {
String s = enum.getValue();
public void setEol(FixCRLF.CrLf crlf) {
String s = crlf.getValue();
if (s.equals("cr") || s.equals("mac")) { if (s.equals("cr") || s.equals("mac")) {
eolString = "\r"; eolString = "\r";
} else if (s.equals("lf") || s.equals("unix")) { } else if (s.equals("lf") || s.equals("unix")) {


+ 3
- 3
src/main/org/apache/tools/ant/taskdefs/Copydir.java View File

@@ -142,9 +142,9 @@ public class Copydir extends MatchingTask {
log("Copying " + filecopyList.size() + " file" log("Copying " + filecopyList.size() + " file"
+ (filecopyList.size() == 1 ? "" : "s") + (filecopyList.size() == 1 ? "" : "s")
+ " to " + destDir.getAbsolutePath()); + " to " + destDir.getAbsolutePath());
Enumeration enum = filecopyList.keys();
while (enum.hasMoreElements()) {
String fromFile = (String) enum.nextElement();
Enumeration e = filecopyList.keys();
while (e.hasMoreElements()) {
String fromFile = (String) e.nextElement();
String toFile = (String) filecopyList.get(fromFile); String toFile = (String) filecopyList.get(fromFile);
try { try {
getProject().copyFile(fromFile, toFile, filtering, getProject().copyFile(fromFile, toFile, filtering,


+ 3
- 3
src/main/org/apache/tools/ant/taskdefs/Expand.java View File

@@ -156,9 +156,9 @@ public class Expand extends Task {
ZipFile zf = null; ZipFile zf = null;
try { try {
zf = new ZipFile(srcF, encoding); zf = new ZipFile(srcF, encoding);
Enumeration enum = zf.getEntries();
while (enum.hasMoreElements()) {
ZipEntry ze = (ZipEntry) enum.nextElement();
Enumeration e = zf.getEntries();
while (e.hasMoreElements()) {
ZipEntry ze = (ZipEntry) e.nextElement();
extractFile(fileUtils, srcF, dir, zf.getInputStream(ze), extractFile(fileUtils, srcF, dir, zf.getInputStream(ze),
ze.getName(), new Date(ze.getTime()), ze.getName(), new Date(ze.getTime()),
ze.isDirectory()); ze.isDirectory());


+ 9
- 9
src/main/org/apache/tools/ant/taskdefs/Jar.java View File

@@ -273,9 +273,9 @@ public class Jar extends Zip {


// must not use getEntry as "well behaving" applications // must not use getEntry as "well behaving" applications
// must accept the manifest in any capitalization // must accept the manifest in any capitalization
Enumeration enum = zf.entries();
while (enum.hasMoreElements()) {
ZipEntry ze = (ZipEntry) enum.nextElement();
Enumeration e = zf.entries();
while (e.hasMoreElements()) {
ZipEntry ze = (ZipEntry) e.nextElement();
if (ze.getName().equalsIgnoreCase(MANIFEST_NAME)) { if (ze.getName().equalsIgnoreCase(MANIFEST_NAME)) {
InputStreamReader isr = InputStreamReader isr =
new InputStreamReader(zf.getInputStream(ze), "UTF-8"); new InputStreamReader(zf.getInputStream(ze), "UTF-8");
@@ -448,9 +448,9 @@ public class Jar extends Zip {
// JarIndex is sorting the directories by ascending order. // JarIndex is sorting the directories by ascending order.
// it's painful to do in JDK 1.1 and it has no value but cosmetic // it's painful to do in JDK 1.1 and it has no value but cosmetic
// since it will be read into a hashtable by the classloader. // since it will be read into a hashtable by the classloader.
Enumeration enum = addedDirs.keys();
while (enum.hasMoreElements()) {
String dir = (String) enum.nextElement();
Enumeration e = addedDirs.keys();
while (e.hasMoreElements()) {
String dir = (String) e.nextElement();


// try to be smart, not to be fooled by a weird directory name // try to be smart, not to be fooled by a weird directory name
// @fixme do we need to check for directories starting by ./ ? // @fixme do we need to check for directories starting by ./ ?
@@ -470,9 +470,9 @@ public class Jar extends Zip {
writer.println(dir); writer.println(dir);
} }


enum = rootEntries.elements();
while (enum.hasMoreElements()) {
writer.println(enum.nextElement());
e = rootEntries.elements();
while (e.hasMoreElements()) {
writer.println(e.nextElement());
} }


writer.flush(); writer.flush();


+ 18
- 18
src/main/org/apache/tools/ant/taskdefs/Javadoc.java View File

@@ -1927,9 +1927,9 @@ public class Javadoc extends Task {
true)); true));
} }


Enumeration enum = packagesToDoc.elements();
while (enum.hasMoreElements()) {
String packageName = (String) enum.nextElement();
Enumeration e = packagesToDoc.elements();
while (e.hasMoreElements()) {
String packageName = (String) e.nextElement();
if (useExternalFile) { if (useExternalFile) {
srcListWriter.println(packageName); srcListWriter.println(packageName);
} else { } else {
@@ -1937,9 +1937,9 @@ public class Javadoc extends Task {
} }
} }


enum = sourceFilesToDoc.elements();
while (enum.hasMoreElements()) {
SourceFile sf = (SourceFile) enum.nextElement();
e = sourceFilesToDoc.elements();
while (e.hasMoreElements()) {
SourceFile sf = (SourceFile) e.nextElement();
String sourceFileName = sf.getFile().getAbsolutePath(); String sourceFileName = sf.getFile().getAbsolutePath();
if (useExternalFile) { if (useExternalFile) {
if (javadoc4 && sourceFileName.indexOf(" ") > -1) { if (javadoc4 && sourceFileName.indexOf(" ") > -1) {
@@ -2013,9 +2013,9 @@ public class Javadoc extends Task {
* @since 1.5 * @since 1.5
*/ */
private void addFileSets(Vector sf) { private void addFileSets(Vector sf) {
Enumeration enum = fileSets.elements();
while (enum.hasMoreElements()) {
FileSet fs = (FileSet) enum.nextElement();
Enumeration e = fileSets.elements();
while (e.hasMoreElements()) {
FileSet fs = (FileSet) e.nextElement();
if (!fs.hasPatterns() && !fs.hasSelectors()) { if (!fs.hasPatterns() && !fs.hasSelectors()) {
fs = (FileSet) fs.clone(); fs = (FileSet) fs.clone();
fs.createInclude().setName("**/*.java"); fs.createInclude().setName("**/*.java");
@@ -2047,9 +2047,9 @@ public class Javadoc extends Task {
// and nested excludepackage elements // and nested excludepackage elements
if (sourcePath != null && packageNames.size() > 0) { if (sourcePath != null && packageNames.size() > 0) {
PatternSet ps = new PatternSet(); PatternSet ps = new PatternSet();
Enumeration enum = packageNames.elements();
while (enum.hasMoreElements()) {
PackageName p = (PackageName) enum.nextElement();
Enumeration e = packageNames.elements();
while (e.hasMoreElements()) {
PackageName p = (PackageName) e.nextElement();
String pkg = p.getName().replace('.', '/'); String pkg = p.getName().replace('.', '/');
if (pkg.endsWith("*")) { if (pkg.endsWith("*")) {
pkg += "*"; pkg += "*";
@@ -2057,9 +2057,9 @@ public class Javadoc extends Task {
ps.createInclude().setName(pkg); ps.createInclude().setName(pkg);
} }


enum = excludePackageNames.elements();
while (enum.hasMoreElements()) {
PackageName p = (PackageName) enum.nextElement();
e = excludePackageNames.elements();
while (e.hasMoreElements()) {
PackageName p = (PackageName) e.nextElement();
String pkg = p.getName().replace('.', '/'); String pkg = p.getName().replace('.', '/');
if (pkg.endsWith("*")) { if (pkg.endsWith("*")) {
pkg += "*"; pkg += "*";
@@ -2078,9 +2078,9 @@ public class Javadoc extends Task {
} }
} }


Enumeration enum = dirSets.elements();
while (enum.hasMoreElements()) {
DirSet ds = (DirSet) enum.nextElement();
Enumeration e = dirSets.elements();
while (e.hasMoreElements()) {
DirSet ds = (DirSet) e.nextElement();
File baseDir = ds.getDir(getProject()); File baseDir = ds.getDir(getProject());
log("scanning " + baseDir + " for packages.", Project.MSG_DEBUG); log("scanning " + baseDir + " for packages.", Project.MSG_DEBUG);
DirectoryScanner dsc = ds.getDirectoryScanner(getProject()); DirectoryScanner dsc = ds.getDirectoryScanner(getProject());


+ 3
- 3
src/main/org/apache/tools/ant/taskdefs/Replace.java View File

@@ -271,9 +271,9 @@ public class Replace extends MatchingTask {
try { try {
if (replaceFilterFile != null) { if (replaceFilterFile != null) {
Properties props = getProperties(replaceFilterFile); Properties props = getProperties(replaceFilterFile);
Enumeration enum = props.keys();
while (enum.hasMoreElements()) {
String token = enum.nextElement().toString();
Enumeration e = props.keys();
while (e.hasMoreElements()) {
String token = e.nextElement().toString();
Replacefilter replaceFilter = createReplacefilter(); Replacefilter replaceFilter = createReplacefilter();
replaceFilter.setToken(token); replaceFilter.setToken(token);
replaceFilter.setValue(props.getProperty(token)); replaceFilter.setValue(props.getProperty(token));


+ 3
- 3
src/main/org/apache/tools/ant/taskdefs/UpToDate.java View File

@@ -194,10 +194,10 @@ public class UpToDate extends Task implements Condition {
+ " not found."); + " not found.");
} }


Enumeration enum = sourceFileSets.elements();
Enumeration e = sourceFileSets.elements();
boolean upToDate = true; boolean upToDate = true;
while (upToDate && enum.hasMoreElements()) {
FileSet fs = (FileSet) enum.nextElement();
while (upToDate && e.hasMoreElements()) {
FileSet fs = (FileSet) e.nextElement();
DirectoryScanner ds = fs.getDirectoryScanner(getProject()); DirectoryScanner ds = fs.getDirectoryScanner(getProject());
upToDate = upToDate && scanDir(fs.getDir(getProject()), upToDate = upToDate && scanDir(fs.getDir(getProject()),
ds.getIncludedFiles()); ds.getIncludedFiles());


+ 3
- 3
src/main/org/apache/tools/ant/taskdefs/Zip.java View File

@@ -1139,9 +1139,9 @@ public class Zip extends MatchingTask {
entries.clear(); entries.clear();
addingNewFiles = false; addingNewFiles = false;
doUpdate = savedDoUpdate; doUpdate = savedDoUpdate;
Enumeration enum = filesetsFromGroupfilesets.elements();
while (enum.hasMoreElements()) {
ZipFileSet zf = (ZipFileSet) enum.nextElement();
Enumeration e = filesetsFromGroupfilesets.elements();
while (e.hasMoreElements()) {
ZipFileSet zf = (ZipFileSet) e.nextElement();
filesets.removeElement(zf); filesets.removeElement(zf);
} }
filesetsFromGroupfilesets.removeAllElements(); filesetsFromGroupfilesets.removeAllElements();


Loading…
Cancel
Save