ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject cvs commit: ant/src/main/org/apache/tools/ant/taskdefs Length.java
Date Fri, 07 Jan 2005 17:36:17 GMT
mbenson     2005/01/07 09:36:17

  Modified:    src/main/org/apache/tools/ant/taskdefs Length.java
  Log:
  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.
  
  Revision  Changes    Path
  1.3       +5 -7      ant/src/main/org/apache/tools/ant/taskdefs/Length.java
  
  Index: Length.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Length.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Length.java	6 Jan 2005 12:05:05 -0000	1.2
  +++ Length.java	7 Jan 2005 17:36:17 -0000	1.3
  @@ -23,7 +23,6 @@
   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 @@
       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,11 +154,12 @@
               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;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message