From 551b9ca14c28b843c1dbbc14a48427bf4bb9f097 Mon Sep 17 00:00:00 2001 From: aclement Date: Wed, 30 Nov 2005 19:51:24 +0000 Subject: [PATCH] fixes for 117209: ensures proceedOnError makes it across in the case of AJDT (also -Xajruntimetarget...) --- .../internal/core/builder/AjBuildConfig.java | 4 ++++ .../pr117209/base/src/Aspect.java | 21 +++++++++++++++++++ .../pr117209/base/src/Broken.java | 2 ++ .../DefaultInterfaceImplementationRecipe.java | 10 +++++++++ .../pr117209/base/src/MyClass_ch16.java | 18 ++++++++++++++++ .../pr117209/base/src/MyInterface_ch16.java | 5 +++++ .../multiIncremental/pr117209/base/src/P.java | 0 .../tools/AjdeInteractionTestbed.java | 17 ++++++++++++++- .../tools/MultiProjectIncrementalTests.java | 12 +++++++++++ 9 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 tests/multiIncremental/pr117209/base/src/Aspect.java create mode 100644 tests/multiIncremental/pr117209/base/src/Broken.java create mode 100644 tests/multiIncremental/pr117209/base/src/DefaultInterfaceImplementationRecipe.java create mode 100644 tests/multiIncremental/pr117209/base/src/MyClass_ch16.java create mode 100644 tests/multiIncremental/pr117209/base/src/MyInterface_ch16.java create mode 100644 tests/multiIncremental/pr117209/base/src/P.java diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java index 25200a327..c8dcb428d 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildConfig.java @@ -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 index 000000000..b66fd7642 --- /dev/null +++ b/tests/multiIncremental/pr117209/base/src/Aspect.java @@ -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 index 000000000..eb6d6fe7c --- /dev/null +++ b/tests/multiIncremental/pr117209/base/src/Broken.java @@ -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 index 000000000..b22ce5e66 --- /dev/null +++ b/tests/multiIncremental/pr117209/base/src/DefaultInterfaceImplementationRecipe.java @@ -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 index 000000000..63f681f29 --- /dev/null +++ b/tests/multiIncremental/pr117209/base/src/MyClass_ch16.java @@ -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 index 000000000..7edcd6887 --- /dev/null +++ b/tests/multiIncremental/pr117209/base/src/MyInterface_ch16.java @@ -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 index 000000000..e69de29bb diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java b/tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java index e98f0aad5..cd8b51f09 100644 --- a/tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java +++ b/tests/src/org/aspectj/systemtest/incremental/tools/AjdeInteractionTestbed.java @@ -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() { diff --git a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java index 15fa9192e..c35efcdc4 100644 --- a/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java +++ b/tests/src/org/aspectj/systemtest/incremental/tools/MultiProjectIncrementalTests.java @@ -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"); -- 2.39.5