From 0a624fc22e84c2665f17a18b9c66b9b387487e0b Mon Sep 17 00:00:00 2001 From: acolyer Date: Mon, 26 Apr 2004 15:00:44 +0000 Subject: [PATCH] fixes a tiny window of error in incremental compilation. File.lastModified() only reports timestamps to the second (rounding down). We compare against the lastBuildTime. It is therefore possible to miss updates that have occured <1000ms after the last build. --- .../org/aspectj/ajdt/internal/core/builder/AjState.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java index 9c531df4a..6950b307a 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java @@ -131,8 +131,9 @@ public class AjState { if (!file.exists()) continue; long modTime = file.lastModified(); - //System.out.println("check: " + file + " mod " + modTime + " build " + lastBuildTime); - if (modTime >= lastBuildTime) { + //System.out.println("check: " + file + " mod " + modTime + " build " + lastBuildTime); + // need to add 1000 since lastModTime is only accurate to a second on some (all?) platforms + if (modTime + 1000 >= lastBuildTime) { ret.add(file); } } @@ -153,7 +154,8 @@ public class AjState { long modTime = file.lastModified(); //System.out.println("check: " + file + " mod " + modTime + " build " + lastBuildTime); - if (modTime >= lastBuildTime) { + // need to add 1000 since lastModTime is only accurate to a second on some (all?) platforms + if (modTime + 1000 >= lastBuildTime) { ret.add(bsfile); } } -- 2.39.5