From: wisberg Date: Sat, 31 May 2003 07:25:30 +0000 (+0000) Subject: delay until after final last-modified-time stamp on newly-staged files X-Git-Tag: V1_1_0~29 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1dfd90af588d2a4661b22494b2edee4512d3475f;p=aspectj.git delay until after final last-modified-time stamp on newly-staged files since last-modified-time stamp can be delayed by filesystem buffering and rounding-up to next second. --- diff --git a/testing/src/org/aspectj/testing/harness/bridge/CompilerRun.java b/testing/src/org/aspectj/testing/harness/bridge/CompilerRun.java index 80798e1a8..680ecbea9 100644 --- a/testing/src/org/aspectj/testing/harness/bridge/CompilerRun.java +++ b/testing/src/org/aspectj/testing/harness/bridge/CompilerRun.java @@ -237,6 +237,13 @@ public class CompilerRun implements IAjcRun { for (int i = 0; i < sourcerootFiles.length; i++) { FileUtil.deleteContents(sourcerootFiles[i], pickIncFiles, false); } + if (0 < sourcerootFiles.length) { + FileUtil.sleepPastFinalModifiedTime(sourcerootFiles); + } + } + File[] files = FileUtil.getBaseDirFiles(sandbox.stagingDir, srcPaths); + if (0 < files.length) { + FileUtil.sleepPastFinalModifiedTime(files); } } catch (IllegalArgumentException e) { validator.fail("staging - bad input", e); diff --git a/testing/src/org/aspectj/testing/harness/bridge/IncCompilerRun.java b/testing/src/org/aspectj/testing/harness/bridge/IncCompilerRun.java index dc2e858bc..b4302ac63 100644 --- a/testing/src/org/aspectj/testing/harness/bridge/IncCompilerRun.java +++ b/testing/src/org/aspectj/testing/harness/bridge/IncCompilerRun.java @@ -16,6 +16,7 @@ package org.aspectj.testing.harness.bridge; import java.io.File; import java.io.FileFilter; import java.io.IOException; +import java.util.*; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -109,6 +110,8 @@ public class IncCompilerRun implements IAjcRun { int numDeletes; int numFails; } + // sigh - delay until after last last-mod-time + final ArrayList copied = new ArrayList(); final intHolder holder = new intHolder(); FileFilter deleteOrCount = new FileFilter() { final String clip = ".delete" + toSuffix; @@ -119,6 +122,7 @@ public class IncCompilerRun implements IAjcRun { if (!path.endsWith(clip)) { holder.numCopies++; validator.info("copying file: " + path); + copied.add(file); } else { doCopy = false; path = path.substring(0, path.length()-clip.length()) + toSuffix; @@ -143,6 +147,10 @@ public class IncCompilerRun implements IAjcRun { } else { result = (0 == holder.numFails); } + if (0 < copied.size()) { + File[] files = (File[]) copied.toArray(new File[0]); + FileUtil.sleepPastFinalModifiedTime(files); + } } catch (NullPointerException npe) { validator.fail("staging - input", npe); } catch (IOException e) {