diff options
author | acolyer <acolyer> | 2004-04-26 15:00:44 +0000 |
---|---|---|
committer | acolyer <acolyer> | 2004-04-26 15:00:44 +0000 |
commit | 0a624fc22e84c2665f17a18b9c66b9b387487e0b (patch) | |
tree | 0d6f9f0565de70fac2b64ce68bbad2ce83eebde1 | |
parent | 1fa4c5fe1b08d6e3bdc6e3b77e7f9d3218e14736 (diff) | |
download | aspectj-0a624fc22e84c2665f17a18b9c66b9b387487e0b.tar.gz aspectj-0a624fc22e84c2665f17a18b9c66b9b387487e0b.zip |
fixes a tiny window of error in incremental compilation. File.lastModified()Root_ajdt_support
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.
-rw-r--r-- | org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjState.java | 8 |
1 files 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); } } |