diff options
author | aclement <aclement> | 2008-08-19 21:29:19 +0000 |
---|---|---|
committer | aclement <aclement> | 2008-08-19 21:29:19 +0000 |
commit | 2b3b1260564cf3d4580771c5922c8aea8f213981 (patch) | |
tree | 0b85540e488a65370219ef8a0a2e86ecc819c312 | |
parent | 5ba47c9d786a8959f7abb053fe1b0528780d5141 (diff) | |
download | aspectj-2b3b1260564cf3d4580771c5922c8aea8f213981.tar.gz aspectj-2b3b1260564cf3d4580771c5922c8aea8f213981.zip |
241047: test and fix: when pipelining we have to ask the generic type for its super interfaces as thats where they will be until it has gone through the pipeline
-rw-r--r-- | tests/bugs162/pr241047/case2/SomeAspect.java | 12 | ||||
-rw-r--r-- | tests/bugs162/pr241047/case2/SomeBaseClass.java | 12 | ||||
-rw-r--r-- | tests/bugs162/pr241047/case2/SomeInterface.java | 1 | ||||
-rw-r--r-- | tests/bugs162/pr241047/case2/SomeSubClass.java | 8 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java | 1 | ||||
-rw-r--r-- | tests/src/org/aspectj/systemtest/ajc162/ajc162.xml | 14 |
6 files changed, 48 insertions, 0 deletions
diff --git a/tests/bugs162/pr241047/case2/SomeAspect.java b/tests/bugs162/pr241047/case2/SomeAspect.java new file mode 100644 index 000000000..208129677 --- /dev/null +++ b/tests/bugs162/pr241047/case2/SomeAspect.java @@ -0,0 +1,12 @@ +public aspect SomeAspect { + declare parents: SomeBaseClass implements SomeInterface; + + before() : execution(* (SomeInterface+).tag*(..)) { + System.out.println("correct advice :-)"); + } + + before() : execution(* (!SomeInterface+).tag*(..)) { + System.out.println("this advice should never run..."); + } +} + diff --git a/tests/bugs162/pr241047/case2/SomeBaseClass.java b/tests/bugs162/pr241047/case2/SomeBaseClass.java new file mode 100644 index 000000000..c8514b264 --- /dev/null +++ b/tests/bugs162/pr241047/case2/SomeBaseClass.java @@ -0,0 +1,12 @@ +public class SomeBaseClass<Type extends Object> { + + public void tag_someBaseMethod() { + System.out.println("some base method"); + } + + public static void main(String[] args) { + new SomeBaseClass<Object>().tag_someBaseMethod(); + new SomeSubClass().tag_someMethod(); // this does not match correctly... + } +} + diff --git a/tests/bugs162/pr241047/case2/SomeInterface.java b/tests/bugs162/pr241047/case2/SomeInterface.java new file mode 100644 index 000000000..c6750f6a3 --- /dev/null +++ b/tests/bugs162/pr241047/case2/SomeInterface.java @@ -0,0 +1 @@ +public interface SomeInterface {} diff --git a/tests/bugs162/pr241047/case2/SomeSubClass.java b/tests/bugs162/pr241047/case2/SomeSubClass.java new file mode 100644 index 000000000..ac8f761a1 --- /dev/null +++ b/tests/bugs162/pr241047/case2/SomeSubClass.java @@ -0,0 +1,8 @@ +public class SomeSubClass extends SomeBaseClass<Integer> { + + // this method is not matched correctly... + public void tag_someMethod() { + System.out.println("some sub method"); + } +} + diff --git a/tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java b/tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java index 5fd23b027..a2abed7e6 100644 --- a/tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java +++ b/tests/src/org/aspectj/systemtest/ajc162/Ajc162Tests.java @@ -20,6 +20,7 @@ public class Ajc162Tests extends org.aspectj.testing.XMLBasedAjcTestCase { // AspectJ1.6.2 public void testGenericDecp_pr241047() { runTest("generic decp"); } + public void testGenericDecp_pr241047_2() { runTest("generic decp - 2"); } public void testGenericItds_pr242797_1() { runTest("generic itds - 1"); } public void testGenericItds_pr242797_2() { runTest("generic itds - 2"); } public void testGenericItds_pr242797_3() { runTest("generic itds - 3"); } diff --git a/tests/src/org/aspectj/systemtest/ajc162/ajc162.xml b/tests/src/org/aspectj/systemtest/ajc162/ajc162.xml index 8d71164b4..88abdb027 100644 --- a/tests/src/org/aspectj/systemtest/ajc162/ajc162.xml +++ b/tests/src/org/aspectj/systemtest/ajc162/ajc162.xml @@ -24,6 +24,20 @@ </run> </ajc-test> + <ajc-test dir="bugs162/pr241047/case2" title="generic decp - 2"> + <compile files="SomeAspect.java SomeSubClass.java SomeInterface.java SomeBaseClass.java" options=" -Xlint:ignore -1.5"> + </compile> + <run class="SomeBaseClass"> + <stdout> + <line text="correct advice :-)"/> + <line text="some base method"/> + <line text="correct advice :-)"/> + <line text="some sub method"/> + </stdout> + </run> + </ajc-test> + + <ajc-test dir="bugs162/pr242797/case1" title="generic itds - 1"> <compile files="ClassUtils.java CMEFinder.java Finder.java H2Deployment.java Localized.java LocalizedFinder.java OnetElement.java OnetFinder.java Partitioned.java PartitionedFinder.java" options="-1.5"> </compile> |