]> source.dussan.org Git - aspectj.git/commitdiff
fixes for 117209: ensures proceedOnError makes it across in the case of AJDT (also...
authoraclement <aclement>
Wed, 30 Nov 2005 19:51:24 +0000 (19:51 +0000)
committeraclement <aclement>
Wed, 30 Nov 2005 19:51:24 +0000 (19:51 +0000)
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java
tests/multiIncremental/pr117209/base/src/Aspect.java [new file with mode: 0644]
tests/multiIncremental/pr117209/base/src/Broken.java [new file with mode: 0644]
tests/multiIncremental/pr117209/base/src/DefaultInterfaceImplementationRecipe.java [new file with mode: 0644]
tests/multiIncremental/pr117209/base/src/MyClass_ch16.java [new file with mode: 0644]
tests/multiIncremental/pr117209/base/src/MyInterface_ch16.java [new file with mode: 0644]
tests/multiIncremental/pr117209/base/src/P.java [new file with mode: 0644]
tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java
tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java

index 25200a327cb16c8f31d73aa05d400a7032d6d7d2..c8dcb428dd272f059e026c3f1e5b0c99bfcc8578 100644 (file)
@@ -375,6 +375,10 @@ public class AjBuildConfig {
         if (!isXlazyTjp() && global.isXlazyTjp()) {
                setXlazyTjp(true);
         }
+        if (!getProceedOnError() && global.getProceedOnError()) {
+               setProceedOnError(true);
+        }
+               setTargetAspectjRuntimeLevel(global.getTargetAspectjRuntimeLevel());
         if (!isXHasMemberEnabled() && global.isXHasMemberEnabled()) {
                setXHasMemberSupport(true);
         }
diff --git a/tests/multiIncremental/pr117209/base/src/Aspect.java b/tests/multiIncremental/pr117209/base/src/Aspect.java
new file mode 100644 (file)
index 0000000..b66fd76
--- /dev/null
@@ -0,0 +1,21 @@
+public class Aspect {
+  public static void main(String []argv) {
+    new Aspect().m();
+  }
+
+  public void m() {
+  }
+}
+
+aspect Y {
+
+  public int Aspect.x = 5;
+  public void Aspect.foo() {
+  }
+  before():execution(* m()) {
+  }
+
+  before(): staticinitialization(*) {
+
+  }
+}
diff --git a/tests/multiIncremental/pr117209/base/src/Broken.java b/tests/multiIncremental/pr117209/base/src/Broken.java
new file mode 100644 (file)
index 0000000..eb6d6fe
--- /dev/null
@@ -0,0 +1,2 @@
+public class Broken {
+
diff --git a/tests/multiIncremental/pr117209/base/src/DefaultInterfaceImplementationRecipe.java b/tests/multiIncremental/pr117209/base/src/DefaultInterfaceImplementationRecipe.java
new file mode 100644 (file)
index 0000000..b22ce5e
--- /dev/null
@@ -0,0 +1,10 @@
+public aspect DefaultInterfaceImplementationRecipe
+{
+       declare parents : MyClass_ch16 implements MyInterface_ch16;
+       
+       // Declare the default implementation of the bar method
+       public void MyInterface_ch16.bar(String name)
+       {
+               System.out.println("bar(String) called on " + this);
+       }
+}
diff --git a/tests/multiIncremental/pr117209/base/src/MyClass_ch16.java b/tests/multiIncremental/pr117209/base/src/MyClass_ch16.java
new file mode 100644 (file)
index 0000000..63f681f
--- /dev/null
@@ -0,0 +1,18 @@
+public class MyClass_ch16
+{
+        public void foo(int number, String name)
+       {
+               System.out.println("Inside foo (int, String) with args: " + 
+number + ":" + name);
+       }
+
+       public static void main(String[] args)
+       {
+               // Create an instance of MyClass
+               MyInterface_ch16 myObject = (MyInterface_ch16)new MyClass_ch16
+();
+               
+               // Make the call to foo
+               myObject.bar("Russ");
+       }
+}
diff --git a/tests/multiIncremental/pr117209/base/src/MyInterface_ch16.java b/tests/multiIncremental/pr117209/base/src/MyInterface_ch16.java
new file mode 100644 (file)
index 0000000..7edcd68
--- /dev/null
@@ -0,0 +1,5 @@
+public interface MyInterface_ch16
+{
+       public void bar(String name);
+}
+
diff --git a/tests/multiIncremental/pr117209/base/src/P.java b/tests/multiIncremental/pr117209/base/src/P.java
new file mode 100644 (file)
index 0000000..e69de29
index e98f0aad550f0261344e010662436d2598a8109d..cd8b51f09bf0d65e58079d45c586cc015f527952 100644 (file)
@@ -65,6 +65,10 @@ public class AjdeInteractionTestbed extends TestCase {
        public static void configureNewProjectDependency(String fromProject, String projectItDependsOn) {
                MyProjectPropertiesAdapter.addDependancy(fromProject,projectItDependsOn);
        }
+       
+       public static void configureNonStandardCompileOptions(String options) {
+               MyBuildOptionsAdapter.setNonStandardOptions(options);
+       }
        // End of methods for configuring the build
        
        
@@ -117,6 +121,7 @@ public class AjdeInteractionTestbed extends TestCase {
                        MyBuildProgressMonitor.reset();
                        MyTaskListManager.reset();
                        MyStateListener.reset();
+                       // MyBuildOptionsAdapter.reset(); needs manually resetting in a test
                        
                        MyProjectPropertiesAdapter.setActiveProject(projectName);
                        AsmManager.attemptIncrementalModelRepairs=true;
@@ -620,6 +625,16 @@ public class AjdeInteractionTestbed extends TestCase {
                static MyBuildOptionsAdapter _instance = new MyBuildOptionsAdapter();
                private MyBuildOptionsAdapter() {}
                
+               public static void setNonStandardOptions(String options) {
+                       _instance.nonstandardoptions = options;
+               }
+
+               private String nonstandardoptions=null;
+               
+               public static void reset() {
+                       _instance.nonstandardoptions=null;
+               }
+               
                public static BuildOptionsAdapter getInstance() { 
                        return _instance;
                }
@@ -666,7 +681,7 @@ public class AjdeInteractionTestbed extends TestCase {
                }
 
                public String getNonStandardOptions() {
-                       return null;
+                       return nonstandardoptions;
                }
 
                public String getComplianceLevel() {
index 15fa9192e51df7e78d73dfd5038606a878c48cc4..c35efcdc49b3f979f7b79e8049b3d84e31ccdf09 100644 (file)
@@ -290,6 +290,18 @@ public class MultiProjectIncrementalTests extends AjdeInteractionTestbed {
                build("PR92837");
        }
        
+       // If you fiddle with the compiler options - you must manually reset the options at the end of the test
+       public void testPr117209() {
+               try {
+                       initialiseProject("PR117209");
+                       configureNonStandardCompileOptions("-proceedOnError");
+                       build("PR117209");
+                       checkCompileWeaveCount(6,6);
+               } finally {
+                       MyBuildOptionsAdapter.reset();
+               }
+       }
+       
        public void testPr114875() {
                initialiseProject("pr114875");
                build("pr114875");