From 2f588f517b961412710e95091b0e976b3d98bc98 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Thu, 24 Jun 2010 07:39:11 +0000 Subject: [PATCH] log a warning message if File#setLastModified fails. PR 49485 git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@957442 13f79535-47bb-0310-9956-ffa450edef68 --- WHATSNEW | 5 +++++ .../org/apache/tools/ant/types/resources/FileResource.java | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/WHATSNEW b/WHATSNEW index feb4cf5c2..faceefe31 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -112,6 +112,11 @@ Other changes: scenarios where a given extension-point may or may not exist. Bugzilla Report 49473. + * Ant now logs a warning message if it fails to change the file + modification time in for example when using or preserving + timestamps in various tasks. + Bugzilla Report 49485. + Changes from Ant 1.8.0 TO Ant 1.8.1 =================================== diff --git a/src/main/org/apache/tools/ant/types/resources/FileResource.java b/src/main/org/apache/tools/ant/types/resources/FileResource.java index 5e37204b2..fb475027d 100644 --- a/src/main/org/apache/tools/ant/types/resources/FileResource.java +++ b/src/main/org/apache/tools/ant/types/resources/FileResource.java @@ -345,7 +345,9 @@ public class FileResource extends Resource implements Touchable, FileProvider, ((FileResource) getCheckedRef()).touch(modTime); return; } - getNotNullFile().setLastModified(modTime); + if (!getNotNullFile().setLastModified(modTime)) { + log("Failed to change file modification time", Project.MSG_WARN); + } } /**