]> source.dussan.org Git - aspectj.git/commitdiff
See pr90806 - change to harness so fast machines don't fail incremental tests.
authoraclement <aclement>
Wed, 13 Apr 2005 11:45:27 +0000 (11:45 +0000)
committeraclement <aclement>
Wed, 13 Apr 2005 11:45:27 +0000 (11:45 +0000)
org.aspectj.ajdt.core/testsrc/org/aspectj/tools/ajc/Ajc.java

index c3f35770ecbe4c5e11395cac6e86538fd1691508..b2193d1b5a0f0f49e49d167330621b50e819ea4b 100644 (file)
@@ -166,6 +166,10 @@ public class Ajc {
                        args = adjustToSandbox(args,!isIncremental);
                        MessageHandler holder = new MessageHandler();
                        main.setHolder(holder);
+                       if (incrementalStage==10 && hasSpecifiedIncremental(args)) {
+                         // important to sleep after preparing the sandbox on first incremental stage (see notes in pr90806)
+                         try { Thread.sleep(1000); } catch (Exception e) {}
+                       }
                        if (isIncremental) {
                                controller.doIncremental(holder);
                        } else {
@@ -191,6 +195,14 @@ public class Ajc {
                return result;
        }
        
+       private boolean hasSpecifiedIncremental(String[] args) {
+               if (args==null) return false;
+               for (int i = 0; i < args.length; i++) {
+                       if (args[i].equals("-incremental")) return true;
+               }
+               return false;
+       }
+
        /**
         * After compiling for the first time with compile(), if the -incremental option was specified
         * you can do as many subsequent incremental compiles as you like by calling this method.