Merge "Consider that some Java version on Linux only return integral timestamps"

This commit is contained in:
Robin Rosenberg 2013-01-08 17:50:01 -05:00 committed by Gerrit Code Review @ Eclipse.org
commit 0421481978
1 changed files with 4 additions and 1 deletions

View File

@ -759,7 +759,10 @@ public MetadataDiff compareMetadata(DirCacheEntry entry) {
long fileLastModified = getEntryLastModified();
if (cacheLastModified % 1000 == 0)
fileLastModified = fileLastModified - fileLastModified % 1000;
// Some Java version on Linux return whole seconds only even when
// the file systems supports more precision.
else if (fileLastModified % 1000 == 0)
cacheLastModified = cacheLastModified - cacheLastModified % 1000;
if (fileLastModified != cacheLastModified)
return MetadataDiff.DIFFER_BY_TIMESTAMP;
else if (!entry.isSmudged())