You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bo...@apache.org on 2011/10/12 10:07:40 UTC

svn commit: r1182250 - /ant/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/Pack200Normalize.java

Author: bodewig
Date: Wed Oct 12 08:07:40 2011
New Revision: 1182250

URL: http://svn.apache.org/viewvc?rev=1182250&view=rev
Log:
Use proper out-of-dateness check

Modified:
    ant/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/Pack200Normalize.java

Modified: ant/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/Pack200Normalize.java
URL: http://svn.apache.org/viewvc/ant/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/Pack200Normalize.java?rev=1182250&r1=1182249&r2=1182250&view=diff
==============================================================================
--- ant/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/Pack200Normalize.java (original)
+++ ant/antlibs/compress/trunk/src/main/org/apache/ant/compress/taskdefs/Pack200Normalize.java Wed Oct 12 08:07:40 2011
@@ -27,6 +27,9 @@ import org.apache.tools.ant.BuildExcepti
 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 @@ public class Pack200Normalize extends Ta
             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 {