Browse Source

41411 Bug in org.apache.tools.ant.types.resources.comparators.Date

Cedomir Igaly

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@500620 13f79535-47bb-0310-9956-ffa450edef68
master
Jacobus Martinus Kruithof 18 years ago
parent
commit
9a388391c4
3 changed files with 11 additions and 1 deletions
  1. +1
    -0
      CONTRIBUTORS
  2. +2
    -0
      WHATSNEW
  3. +8
    -1
      src/main/org/apache/tools/ant/types/resources/comparators/Date.java

+ 1
- 0
CONTRIBUTORS View File

@@ -29,6 +29,7 @@ Brant Langer Gurganus
Brian Deitte
Brian Felder
Bruce Atherton
Cedomir Igaly
Charles Hudak
Charlie Hubbard
Chris Povirk


+ 2
- 0
WHATSNEW View File

@@ -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

* <junit> in Ant 1.7.0 could throw NPE if no <classpath> was defined.
Bugzilla report 41422.


+ 8
- 1
src/main/org/apache/tools/ant/types/resources/comparators/Date.java View File

@@ -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;
}
}

}

Loading…
Cancel
Save