From eb409a2265b661fea9fbf24269b5dc494dc4ef12 Mon Sep 17 00:00:00 2001 From: Conor MacNeill Date: Thu, 11 Sep 2003 14:41:07 +0000 Subject: [PATCH] Fix new style test so that it pases on Linux. There appeared to be a clock granularity problem where the output and the stylesheet both have the same timestamp. I have change the test in XSLTProcess to run the xslt in this case. Also added a more meaningful message git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275221 13f79535-47bb-0310-9956-ffa450edef68 --- src/etc/testcases/taskdefs/style/testNewerStylesheet.xsl | 2 +- src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/etc/testcases/taskdefs/style/testNewerStylesheet.xsl b/src/etc/testcases/taskdefs/style/testNewerStylesheet.xsl index 284089f72..d5700d0d4 100644 --- a/src/etc/testcases/taskdefs/style/testNewerStylesheet.xsl +++ b/src/etc/testcases/taskdefs/style/testNewerStylesheet.xsl @@ -3,7 +3,7 @@ version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> - + ${xsl.value} diff --git a/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java b/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java index 496c6154b..7c4ca2cc9 100644 --- a/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java +++ b/src/main/org/apache/tools/ant/taskdefs/XSLTProcess.java @@ -523,13 +523,17 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger { Project.MSG_DEBUG); log("Style file " + xslFile + " time: " + styleSheetLastModified, Project.MSG_DEBUG); - if (force || inFile.lastModified() > outFile.lastModified() - || styleSheetLastModified > outFile.lastModified()) { + if (force || inFile.lastModified() >= outFile.lastModified() + || styleSheetLastModified >= outFile.lastModified()) { ensureDirectoryFor(outFile); log("Processing " + inFile + " to " + outFile, Project.MSG_INFO); configureLiaison(stylesheet); liaison.transform(inFile, outFile); + } else { + log("Skipping input file " + inFile + + " because it is older than output file " + outFile + + " and so is the stylesheet " + stylesheet, Project.MSG_DEBUG); } } catch (Exception ex) { log("Failed to process " + inFile, Project.MSG_INFO);