diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 355188c4d..adcacf0ee 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -29,6 +29,7 @@ Brant Langer Gurganus Brian Deitte Brian Felder Bruce Atherton +Cedomir Igaly Charles Hudak Charlie Hubbard Chris Povirk diff --git a/WHATSNEW b/WHATSNEW index 629d42eb8..6372c2dfa 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -6,6 +6,8 @@ Changes that could break older environments: Fixed bugs: ----------- +* Bug in org.apache.tools.ant.types.resources.comparators.Date + Bugzilla report 41411 * in Ant 1.7.0 could throw NPE if no was defined. Bugzilla report 41422. diff --git a/src/main/org/apache/tools/ant/types/resources/comparators/Date.java b/src/main/org/apache/tools/ant/types/resources/comparators/Date.java index 7638a181c..b6be66bb6 100755 --- a/src/main/org/apache/tools/ant/types/resources/comparators/Date.java +++ b/src/main/org/apache/tools/ant/types/resources/comparators/Date.java @@ -32,7 +32,14 @@ public class Date extends ResourceComparator { * argument is less than, equal to, or greater than the second. */ protected int resourceCompare(Resource foo, Resource bar) { - return (int) (foo.getLastModified() - bar.getLastModified()); + long diff = foo.getLastModified() - bar.getLastModified(); + if (diff > 0) { + return +1; + } else if (diff < 0) { + return -1; + } else { + return 0; + } } }