ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: ant/src/main/org/apache/tools/ant/types Resource.java ZipScanner.java
Date Tue, 29 Jul 2003 09:10:08 GMT
bodewig     2003/07/29 02:10:08

  Modified:    src/main/org/apache/tools/ant DirectoryScanner.java
               src/main/org/apache/tools/ant/types Resource.java
                        ZipScanner.java
  Log:
  Some tasks rely on the DFS ordering getIncludedXYZ used to provide
  
  Revision  Changes    Path
  1.59      +3 -0      ant/src/main/org/apache/tools/ant/DirectoryScanner.java
  
  Index: DirectoryScanner.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/DirectoryScanner.java,v
  retrieving revision 1.58
  retrieving revision 1.59
  diff -u -r1.58 -r1.59
  --- DirectoryScanner.java	25 Jul 2003 18:40:53 -0000	1.58
  +++ DirectoryScanner.java	29 Jul 2003 09:10:07 -0000	1.59
  @@ -56,6 +56,7 @@
   
   import java.io.File;
   import java.io.IOException;
  +import java.util.Arrays;
   import java.util.Enumeration;
   import java.util.HashMap;
   import java.util.HashSet;
  @@ -1032,6 +1033,7 @@
       public String[] getIncludedFiles() {
           String[] files = new String[filesIncluded.size()];
           filesIncluded.copyInto(files);
  +        Arrays.sort(files);
           return files;
       }
   
  @@ -1099,6 +1101,7 @@
       public String[] getIncludedDirectories() {
           String[] directories = new String[dirsIncluded.size()];
           dirsIncluded.copyInto(directories);
  +        Arrays.sort(directories);
           return directories;
       }
   
  
  
  
  1.5       +14 -1     ant/src/main/org/apache/tools/ant/types/Resource.java
  
  Index: Resource.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/Resource.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Resource.java	17 Feb 2003 12:59:23 -0000	1.4
  +++ Resource.java	29 Jul 2003 09:10:07 -0000	1.5
  @@ -63,7 +63,7 @@
    * @author <a href="mailto:levylambert@tiscali-dsl.de">Antoine Levy-Lambert</a>
    * @since Ant 1.5.2
    */
  -public class Resource implements Cloneable {
  +public class Resource implements Cloneable, Comparable {
       private String name = null;
       private boolean exists = true;
       private long lastmodified = 0;
  @@ -179,4 +179,17 @@
           }
       }
   
  +    /**
  +     * delegates to a comparison of names.
  +     *
  +     * @since Ant 1.6
  +     */
  +    public int compareTo(Object other) {
  +        if (!(other instanceof Resource)) {
  +            throw new IllegalArgumentException("Can only be compared with "
  +                                               + "Resources");
  +        }
  +        Resource r = (Resource) other;
  +        return getName().compareTo(r.getName());
  +    }
   }
  
  
  
  1.21      +3 -0      ant/src/main/org/apache/tools/ant/types/ZipScanner.java
  
  Index: ZipScanner.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/types/ZipScanner.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- ZipScanner.java	15 Jul 2003 14:54:14 -0000	1.20
  +++ ZipScanner.java	29 Jul 2003 09:10:07 -0000	1.21
  @@ -56,6 +56,7 @@
   
   import java.io.File;
   import java.io.IOException;
  +import java.util.Arrays;
   import java.util.Vector;
   import java.util.Hashtable;
   import java.util.Enumeration;
  @@ -138,6 +139,7 @@
               }
               String[] files = new String[myvector.size()];
               myvector.copyInto(files);
  +            Arrays.sort(files);
               return files;
           } else {
               return super.getIncludedFiles();
  @@ -165,6 +167,7 @@
               }
               String[] files = new String[myvector.size()];
               myvector.copyInto(files);
  +            Arrays.sort(files);
               return files;
           } else {
               return super.getIncludedDirectories();
  
  
  

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


Mime
View raw message