SFTPRepository incorrectly calculates last modified time for resources
----------------------------------------------------------------------

                 Key: IVY-815
                 URL: https://issues.apache.org/jira/browse/IVY-815
             Project: Ivy
          Issue Type: Bug
          Components: Core
    Affects Versions: 2.0.0-beta-2
         Environment: Pretty sure this is irrelevant but anyway...
Ivy client running on Windows XP
SFTP repository running on OpenSuse Linux
            Reporter: David Maplesden
             Fix For: 2.0-RC1


When the {{org.apache.ivy.plugins.repository.sftp.SFTPRepository}} 
implementation calculates the last modified time for the resources it returns 
it uses an {{int}} constant {{MILLIS_PER_SECOND}} to multiply the {{int}} value 
returned by {{attrs.getMTime()}}.   

This means the calculation is done using integer arithmetic but the result is 
virtually always too big for an {{int}} value and so it overflows, returning a 
negative number.

This can easily be fixed by changing the {{MILLIS_PER_SECOND}} constant to 
{{long}}, the multiplication is then done using longs and the result does not 
overflow.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to