DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=41411>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=41411

           Summary: Bug in
                    org.apache.tools.ant.types.resources.comparators.Date
           Product: Ant
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Core
        AssignedTo: dev@ant.apache.org
        ReportedBy: [EMAIL PROTECTED]


protected int resourceCompare(Resource foo, Resource bar) {
        return (int) (foo.getLastModified() - bar.getLastModified());
    }

When difference foo.getLastModified() - bar.getLastModified() is greater than
Integer.MAX_VALUE or less than Integer.MIN_VALUE, result returned by
resourceCompare is undefined. Possible fix is:

    protected int resourceCompare(Resource foo, Resource bar) {
        long diff = foo.getLastModified() - bar.getLastModified();
        if (diff > 0) {
            return +1;
        } else if (diff < 0) {
            return -1;
        } else {
            return 0;
        }
    }

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

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

Reply via email to