]> source.dussan.org Git - aspectj.git/commitdiff
delay until after final last-modified-time stamp on newly-staged files
authorwisberg <wisberg>
Sat, 31 May 2003 07:25:30 +0000 (07:25 +0000)
committerwisberg <wisberg>
Sat, 31 May 2003 07:25:30 +0000 (07:25 +0000)
since last-modified-time stamp can be delayed by filesystem buffering
and rounding-up to next second.

testing/src/org/aspectj/testing/harness/bridge/CompilerRun.java
testing/src/org/aspectj/testing/harness/bridge/IncCompilerRun.java

index 80798e1a8e9840825af187a85b5d3fae2828e5e6..680ecbea9965b3ae895252aa552dfc283c8552ff 100644 (file)
@@ -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);
index dc2e858bccb66bcfd4b5d6254a4e3c9647dcb17b..b4302ac633647135125b1141831e4568fb93e065 100644 (file)
@@ -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) {