From 1e36c81085ed4a31c8cf338057c562d08d40c670 Mon Sep 17 00:00:00 2001 From: Robin Rosenberg Date: Mon, 13 Apr 2009 22:45:00 +0200 Subject: [PATCH] Handle the case when the file timestamp in java is rounded to seconds Even if the file systems support subsecond timestamp resolution the Java runtime, including the Eclipse resources may return timestamps that are truncated to seconds only. Signed-off-by: Robin Rosenberg Signed-off-by: Shawn O. Pearce --- .../egit/ui/internal/decorators/DecoratableResourceAdapter.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/DecoratableResourceAdapter.java b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/DecoratableResourceAdapter.java index 5c68d5b2..12f7ec33 100644 --- a/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/DecoratableResourceAdapter.java +++ b/org.spearce.egit.ui/src/org/spearce/egit/ui/internal/decorators/DecoratableResourceAdapter.java @@ -354,8 +354,12 @@ class DecoratableResourceAdapter implements IDecoratableResource { // so we need to check to see if this is the case here, and possibly // fix the timestamp of the resource to match the resolution of the // index. - if (tIndex % 1000 == 0) { - return tIndex == (tWorkspaceResource - (tWorkspaceResource % 1000)); + // It also appears the timestamp in Java on Linux may also be rounded + // in which case the index timestamp may have subseconds, but not + // the timestamp from the workspace resource. + // If either timestamp looks rounded we skip the subscond part. + if (tIndex % 1000 == 0 || tWorkspaceResource % 1000 == 0) { + return tIndex / 1000 == tWorkspaceResource / 1000; } else { return tIndex == tWorkspaceResource; } -- 2.11.4.GIT