[ https://issues.apache.org/jira/browse/CAMEL-10568?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15732284#comment-15732284 ]
ASF GitHub Bot commented on CAMEL-10568: ---------------------------------------- GitHub user adamcamp opened a pull request: https://github.com/apache/camel/pull/1337 CAMEL-10568 Fix SftpChangedExclusiveReadLockStrategy integer overflow bug https://issues.apache.org/jira/browse/CAMEL-10568 You can merge this pull request into a Git repository by running: $ git pull https://github.com/adamcamp/camel CAMEL-10568 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/camel/pull/1337.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #1337 ---- commit df2f7cd2bb2e5816b59e854eb9e1a75b660f5e79 Author: acampbel <adam.campb...@neustar.biz> Date: 2016-12-08T13:55:28Z CAMEL-10568 Fix integer overflow bug ---- > SftpChangedExclusiveReadLockStrategy integer overflow > ----------------------------------------------------- > > Key: CAMEL-10568 > URL: https://issues.apache.org/jira/browse/CAMEL-10568 > Project: Camel > Issue Type: Bug > Components: camel-sftp > Affects Versions: 2.18.0 > Reporter: Adam Campbell > Fix For: 2.17.5, 2.18.2, 2.19.0 > > > It looks like CAMEL-9820 has not resolved SFTP readLockMinAge functionality. > When I run the latest version, I get a new last modified time as negative. I > think this is because both types are int so it is performing the calculation > as an int and then converting it to long. > It should work if this line: > newLastModified = f.getAttrs().getMTime() * 1000; > Is changed to: > newLastModified = f.getAttrs().getMTime() * 1000L; > TRACE o.a.c.c.f.r.s.SftpChangedExclusiveReadLockStrategy - List files > outgoing/Promo/dev/test.dat found 1 files > TRACE o.a.c.c.f.r.s.SftpChangedExclusiveReadLockStrategy - Previous last > modified: -9223372036854775808, new last modified: -616826120 > TRACE o.a.c.c.f.r.s.SftpChangedExclusiveReadLockStrategy - Previous length: > -9223372036854775808, new length: 12921172 > TRACE o.a.c.c.f.r.s.SftpChangedExclusiveReadLockStrategy - New older than > threshold: 1481147995902 > TRACE o.a.c.c.f.r.s.SftpChangedExclusiveReadLockStrategy - Read lock acquired. -- This message was sent by Atlassian JIRA (v6.3.4#6332)