ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs DependSet.java
Date Wed, 20 Feb 2002 16:48:00 GMT
bodewig     02/02/20 08:48:00

  Modified:    src/main/org/apache/tools/ant/taskdefs DependSet.java
  Log:
  fix boundary checking problem similiar to the one fixed for bug report 4290
  
  Actually this wouldn't throw an ArrayIndexOutOuBounds- but a
  BuildException as FileList.getFiles barfs out on empty lists, but that
  way it is more consistent.
  
  Revision  Changes    Path
  1.9       +4 -4      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/DependSet.java
  
  Index: DependSet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/DependSet.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- DependSet.java	20 Feb 2002 16:32:21 -0000	1.8
  +++ DependSet.java	20 Feb 2002 16:48:00 -0000	1.9
  @@ -108,7 +108,7 @@
    * </li></ul>
    * 
    * @author <a href="mailto:cstrong@arielpartners.com">Craeg Strong</a>
  - * @version $Revision: 1.8 $ $Date: 2002/02/20 16:32:21 $
  + * @version $Revision: 1.9 $ $Date: 2002/02/20 16:48:00 $
    */
   public class DependSet extends MatchingTask {
   
  @@ -231,6 +231,7 @@
                    log("Warning: "+targetFiles[i]+" modified in the future.", 
                        Project.MSG_WARN);
                 }
  +
                 if (oldestTarget == null ||
                     dest.lastModified() < oldestTargetTime) {
                     oldestTargetTime = dest.lastModified();
  @@ -256,8 +257,7 @@
                 FileList sourceFL         = (FileList) enumSourceLists.nextElement();
                 String[] sourceFiles      = sourceFL.getFiles(project);
   
  -              int i = 0;
  -              do {
  +              for (int i=0; upToDate && i < sourceFiles.length; i++) {
                    File src = new File(sourceFL.getDir(project), sourceFiles[i]);
   
                    if (src.lastModified() > now) {
  @@ -276,7 +276,7 @@
                       log(oldestTarget + " is out of date with respect to " +
                           sourceFiles[i], Project.MSG_VERBOSE);
                    }
  -              } while (upToDate && (++i < sourceFiles.length) );
  +              }
              }
           }
   
  
  
  

--
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