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 DirectoryScanner.java
Date Wed, 23 Jul 2003 07:57:07 GMT
bodewig     2003/07/23 00:57:07

  Modified:    src/main/org/apache/tools/ant DirectoryScanner.java
  Log:
  Now that we avoid double scanning in scanDir, we don't need to perform parent-tests on the
patterns anymore
  
  Revision  Changes    Path
  1.55      +1 -30     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.54
  retrieving revision 1.55
  diff -u -r1.54 -r1.55
  --- DirectoryScanner.java	23 Jul 2003 07:50:25 -0000	1.54
  +++ DirectoryScanner.java	23 Jul 2003 07:57:07 -0000	1.55
  @@ -672,36 +672,7 @@
           for (int icounter = 0; icounter < includes.length; icounter++) {
               String newpattern =
                   SelectorUtils.rtrimWildcardTokens(includes[icounter]);
  -            // check whether the candidate new pattern has a parent
  -            boolean hasParent = false;
  -            Enumeration myenum = newroots.keys();
  -            // logically, there should be at most one child pattern present
  -            // let's use a vector though to be sure
  -            Vector vdelete = new Vector();
  -            while (myenum.hasMoreElements()) {
  -                String existingpattern = (String) myenum.nextElement();
  -                // check whether the existing pattern is a child of the new pattern
  -                if (existingpattern.length() >= newpattern.length()) {
  -                    if (existingpattern.indexOf(newpattern) == 0) {
  -                        vdelete.add(existingpattern);
  -                    }
  -                }
  -                // check whether the new pattern is a child of the existing pattern
  -                if (existingpattern.length() <= newpattern.length()) {
  -                    if (newpattern.indexOf(existingpattern) == 0) {
  -                        hasParent = true;
  -                        break;
  -                    }
  -                }
  -            }
  -            // add the new pattern if does not have parents
  -            if (!hasParent) {
  -                newroots.put(newpattern, includes[icounter]);
  -                // remove child patterns
  -                for (int icounter2 = 0; icounter2 < vdelete.size(); icounter2++) {
  -                    newroots.remove(vdelete.elementAt(icounter2));
  -                }
  -            }
  +            newroots.put(newpattern, includes[icounter]);
           }
   
           Enumeration enum2 = newroots.keys();
  
  
  

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


Mime
View raw message