Use proper out-of-dateness check
git-svn-id: https://svn.apache.org/repos/asf/ant/antlibs/compress/trunk@1182250 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/main/org/apache/ant/compress/taskdefs/Pack200Normalize.java b/src/main/org/apache/ant/compress/taskdefs/Pack200Normalize.java
index 69c75dc..9fb67e5 100644
--- a/src/main/org/apache/ant/compress/taskdefs/Pack200Normalize.java
+++ b/src/main/org/apache/ant/compress/taskdefs/Pack200Normalize.java
@@ -27,6 +27,9 @@
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.types.Environment;
+import org.apache.tools.ant.types.resources.FileResource;
+import org.apache.tools.ant.types.selectors.SelectorUtils;
+import org.apache.tools.ant.util.FileUtils;
/**
* Task to "normalize" a JAR archive so that a signature applied to it
@@ -83,7 +86,13 @@
throw new BuildException("srcFile attribute is required");
}
if (force ||
- (dest != null && dest.lastModified() <= src.lastModified())) {
+ (dest != null
+ && SelectorUtils.isOutOfDate(new FileResource(src),
+ new FileResource(dest),
+ FileUtils.getFileUtils()
+ .getFileTimestampGranularity())
+ )
+ ) {
if (dest != null) {
log("Normalizing " + src + " to " + dest + ".");
} else {