Author: jkf
Date: Sat Jan 27 13:09:30 2007
New Revision: 500620

URL: http://svn.apache.org/viewvc?view=rev&rev=500620
Log:
41411 Bug in org.apache.tools.ant.types.resources.comparators.Date 
Cedomir Igaly

Modified:
    ant/core/trunk/CONTRIBUTORS
    ant/core/trunk/WHATSNEW
    
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/comparators/Date.java

Modified: ant/core/trunk/CONTRIBUTORS
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/CONTRIBUTORS?view=diff&rev=500620&r1=500619&r2=500620
==============================================================================
Binary files - no diff available.

Modified: ant/core/trunk/WHATSNEW
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?view=diff&rev=500620&r1=500619&r2=500620
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Sat Jan 27 13:09:30 2007
@@ -6,6 +6,8 @@
 
 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.

Modified: 
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/comparators/Date.java
URL: 
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/resources/comparators/Date.java?view=diff&rev=500620&r1=500619&r2=500620
==============================================================================
--- 
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/comparators/Date.java
 (original)
+++ 
ant/core/trunk/src/main/org/apache/tools/ant/types/resources/comparators/Date.java
 Sat Jan 27 13:09:30 2007
@@ -32,7 +32,14 @@
      *         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;
+        }
     }
 
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to