Browse Source

remove enum variable

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-ffa450edef68
master
Peter Reilly 22 years ago
parent
commit
d050f6a18c
10 changed files with 35 additions and 35 deletions
  1. +3
    -3
      src/main/org/apache/tools/ant/types/AbstractFileSet.java
  2. +2
    -2
      src/main/org/apache/tools/ant/types/CommandlineJava.java
  3. +4
    -4
      src/main/org/apache/tools/ant/types/FilterSet.java
  4. +3
    -3
      src/main/org/apache/tools/ant/types/Path.java
  5. +6
    -6
      src/main/org/apache/tools/ant/types/PropertySet.java
  6. +6
    -6
      src/main/org/apache/tools/ant/types/XMLCatalog.java
  7. +3
    -3
      src/main/org/apache/tools/ant/types/ZipScanner.java
  8. +3
    -3
      src/main/org/apache/tools/ant/util/Watchdog.java
  9. +2
    -2
      src/main/org/apache/tools/ant/util/facade/FacadeTaskHelper.java
  10. +3
    -3
      src/main/org/apache/tools/zip/ZipFile.java

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

@@ -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;
}


+ 2
- 2
src/main/org/apache/tools/ant/types/CommandlineJava.java View File

@@ -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);
}


+ 4
- 4
src/main/org/apache/tools/ant/types/FilterSet.java View File

@@ -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 {


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

@@ -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);
}


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

@@ -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 {


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

@@ -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)) {


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

@@ -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(),


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

@@ -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);
}
}



+ 2
- 2
src/main/org/apache/tools/ant/util/facade/FacadeTaskHelper.java View File

@@ -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]);


+ 3
- 3
src/main/org/apache/tools/zip/ZipFile.java View File

@@ -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];


Loading…
Cancel
Save