From 2ffd04693bce9c88c58f044cdab8dd0ca59f5ef9 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Mon, 10 Dec 2001 15:54:26 +0000 Subject: [PATCH] use the same timestamp for all files of nested filesets in if no value has been specified. PR: 2956 Submitted by: richardwan@servidium.com (Richard F Wan) git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270109 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/org/apache/tools/ant/taskdefs/Touch.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main/org/apache/tools/ant/taskdefs/Touch.java b/src/main/org/apache/tools/ant/taskdefs/Touch.java index d7700630d..57a94e60b 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Touch.java +++ b/src/main/org/apache/tools/ant/taskdefs/Touch.java @@ -174,13 +174,18 @@ public class Touch extends Task { 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 @@ -211,11 +216,7 @@ public class Touch extends Task { return; } - if (millis < 0) { - fileUtils.setFileLastModified(file, System.currentTimeMillis()); - } else { - fileUtils.setFileLastModified(file, millis); - } + fileUtils.setFileLastModified(file, millis); } }