Browse Source

No need to finish building up the set for uniqueness before

the handler can be invoked.  Removes an import, some LOC, and
has a better chance of preserving order between eg pathconvert and length.


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@277318 13f79535-47bb-0310-9956-ffa450edef68
master
Matthew Jason Benson 20 years ago
parent
commit
b38c25e33c
1 changed files with 5 additions and 7 deletions
  1. +5
    -7
      src/main/org/apache/tools/ant/taskdefs/Length.java

+ 5
- 7
src/main/org/apache/tools/ant/taskdefs/Length.java View File

@@ -23,7 +23,6 @@ import java.io.OutputStream;
import java.io.ByteArrayOutputStream;
import java.util.Vector;
import java.util.HashSet;
import java.util.Iterator;

import org.apache.tools.ant.Task;
import org.apache.tools.ant.Project;
@@ -44,8 +43,6 @@ public class Length extends Task {
private static final String EACH = "each";
private static final String STRING = "string";

private static final FileUtils FILE_UTILS = FileUtils.getFileUtils();

private String property;
private String string;
private Boolean trim;
@@ -157,12 +154,13 @@ public class Length extends Task {
File basedir = fs.getDir(getProject());
String[] f = ds.getIncludedFiles();
for (int j = 0; j < f.length; j++) {
included.add(FILE_UTILS.resolveFile(basedir, f[j]));
File file = FileUtils.getFileUtils().resolveFile(basedir, f[j]);
if (!(included.contains(file))) {
included.add(file);
h.handle(file);
}
}
}
for (Iterator iter = included.iterator(); iter.hasNext();) {
h.handle((File)(iter.next()));
}
included.clear();
included = null;
h.complete();


Loading…
Cancel
Save