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 Touch.java
Date Mon, 10 Dec 2001 15:54:26 GMT
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:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message