ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From co...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/depend AntAnalyzer.java
Date Fri, 21 Jun 2002 02:15:50 GMT
conor       2002/06/20 19:15:49

  Modified:    src/main/org/apache/tools/ant/taskdefs/optional/depend Tag:
                        ANT_15_BRANCH AntAnalyzer.java
  Log:
  Skip unnecessary loop which slows depend down
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.3.2.1   +11 -2     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/depend/AntAnalyzer.java
  
  Index: AntAnalyzer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/depend/AntAnalyzer.java,v
  retrieving revision 1.3
  retrieving revision 1.3.2.1
  diff -u -w -u -r1.3 -r1.3.2.1
  --- AntAnalyzer.java	14 Apr 2002 11:16:16 -0000	1.3
  +++ AntAnalyzer.java	21 Jun 2002 02:15:49 -0000	1.3.2.1
  @@ -93,10 +93,12 @@
               toAnalyze.put(classname, classname);
           }
   
  +        System.out.println("Analyze size = " + toAnalyze.size());
           int count = 0;
  -        int maxCount = isClosureRequired() ? MAX_LOOPS : 2;
  +        int maxCount = isClosureRequired() ? MAX_LOOPS : 1;
  +        Hashtable analyzedDeps = null;
           while (toAnalyze.size() != 0 && count++ < maxCount) {
  -            Hashtable analyzedDeps = new Hashtable();
  +            analyzedDeps = new Hashtable();
               for (Enumeration e = toAnalyze.keys(); e.hasMoreElements();) {
                   String classname = (String) e.nextElement();
                   dependencies.put(classname, classname);
  @@ -153,6 +155,13 @@
               }
           }
   
  +        // pick up the last round of dependencies that were determined
  +        Enumeration depsEnum = analyzedDeps.elements();
  +        while (depsEnum.hasMoreElements()) {
  +            String className = (String) depsEnum.nextElement();
  +            dependencies.put(className, className);
  +        }
  +        
           files.removeAllElements();
           for (Enumeration e = containers.keys(); e.hasMoreElements();) {
               files.addElement((File) e.nextElement());
  
  
  

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


Mime
View raw message