You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bo...@apache.org on 2001/12/10 16:54:26 UTC

cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs Touch.java

bodewig     01/12/10 07:54:26

  Modified:    src/main/org/apache/tools/ant/taskdefs Touch.java
  Log:
  use the same timestamp for all files of nested filesets in <touch> if
  no value has been specified.
  
  PR: 2956
  Submitted by:	richardwan@servidium.com (Richard F Wan)
  
  Revision  Changes    Path
  1.12      +7 -6      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Touch.java
  
  Index: Touch.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Touch.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- Touch.java	2001/10/28 21:26:29	1.11
  +++ Touch.java	2001/12/10 15:54:26	1.12
  @@ -174,15 +174,20 @@
                                                location);
                   }
               }
  -            touch(file);
           }
   
           if (millis >= 0 && project.getJavaVersion() == Project.JAVA_1_1) {
               log("modification time of files cannot be set in JDK 1.1",
                   Project.MSG_WARN);
               return;
  +        } else {
  +            millis = System.currentTimeMillis();
           }
   
  +        if (file != null) {
  +            touch(file);
  +        }
  +
           // deal with the filesets
           for (int i=0; i < filesets.size(); i++) {
               FileSet fs = (FileSet) filesets.elementAt(i);
  @@ -211,11 +216,7 @@
               return;
           }
   
  -        if (millis < 0) {
  -            fileUtils.setFileLastModified(file, System.currentTimeMillis());
  -        } else {
  -            fileUtils.setFileLastModified(file, millis);
  -        }
  +        fileUtils.setFileLastModified(file, millis);
       }
   
   }
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>