diff options
author | aclement <aclement> | 2008-08-21 16:29:48 +0000 |
---|---|---|
committer | aclement <aclement> | 2008-08-21 16:29:48 +0000 |
commit | 1fa8b08feed7ff90f9ed4fc759480cfe77b18db0 (patch) | |
tree | 6e227c51a3a461259e072798af0b7107260c83b8 | |
parent | 9c17216914f955f65c44293970f4f6801e1536b8 (diff) | |
download | aspectj-1fa8b08feed7ff90f9ed4fc759480cfe77b18db0.tar.gz aspectj-1fa8b08feed7ff90f9ed4fc759480cfe77b18db0.zip |
244830: test and fix: only initfailurecase field in singleton aspect
-rw-r--r-- | tests/bugs162/pr244830/PTW.java | 26 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java | 1 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc162/ajc162.xml | 5 |
3 files changed, 32 insertions, 0 deletions
diff --git a/tests/bugs162/pr244830/PTW.java b/tests/bugs162/pr244830/PTW.java new file mode 100644 index 000000000..a45db9d1f --- /dev/null +++ b/tests/bugs162/pr244830/PTW.java @@ -0,0 +1,26 @@ +import java.lang.reflect.*; + +aspect X pertypewithin(A*) { + before(): execution(* *(..)) {} +} + +class A { + public void foo() {} +} + +class AA { + public void foo() {} +} +public class PTW { + public void foo() {} + + public static void main(String []argv) { + Field[] fs = X.class.getDeclaredFields(); + for (int i=0;i<fs.length;i++) { + if (fs[i].getName().equals("ajc$initFailureCause")) { + throw new RuntimeException("Should be no ajc$initFailureCause field for ptw"); + } + } + } +} + diff --git a/tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java b/tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java index c4578effe..2862c298f 100644 --- a/tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java @@ -19,6 +19,7 @@ import org.aspectj.testing.XMLBasedAjcTestCase; public class Ajc162Tests extends org.aspectj.testing.XMLBasedAjcTestCase { // AspectJ1.6.2 + public void testPTW_pr244830() { runTest("ptw initFailureCause"); } public void testGenericItdsOverrides_pr222648() { runTest("generic itds - overrides"); } public void testGenericItdsOverrides_pr222648_2() { runTest("generic itds - overrides - 2"); } public void testItdCallingGenericMethod_pr145391() { runTest("itd calling generic method");} diff --git a/tests/src/org/aspectj/systemtest/ajc162/ajc162.xml b/tests/src/org/aspectj/systemtest/ajc162/ajc162.xml index 17f3ec741..bdea360d1 100644 --- a/tests/src/org/aspectj/systemtest/ajc162/ajc162.xml +++ b/tests/src/org/aspectj/systemtest/ajc162/ajc162.xml @@ -3,6 +3,11 @@ <!-- AspectJ v1.6.2 Tests --> <suite> + <ajc-test dir="bugs162/pr244830" title="ptw initFailureCause"> + <compile files="PTW.java" options="-1.5"/> + <run class="PTW"/> + </ajc-test> + <ajc-test dir="bugs162/pr222648" title="generic itds - overrides"> <compile files="DataAspect.aj DataInterface.java Foo.java FooBase.java Marker.java Resource.java" options="-1.5"/> </ajc-test> |