From 2b3b1260564cf3d4580771c5922c8aea8f213981 Mon Sep 17 00:00:00 2001 From: aclement Date: Tue, 19 Aug 2008 21:29:19 +0000 Subject: [PATCH] 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 --- tests/bugs162/pr241047/case2/SomeAspect.java | 12 ++++++++++++ tests/bugs162/pr241047/case2/SomeBaseClass.java | 12 ++++++++++++ tests/bugs162/pr241047/case2/SomeInterface.java | 1 + tests/bugs162/pr241047/case2/SomeSubClass.java | 8 ++++++++ .../org/aspectj/systemtest/ajc162/Ajc162Tests.java | 1 + tests/src/org/aspectj/systemtest/ajc162/ajc162.xml | 14 ++++++++++++++ 6 files changed, 48 insertions(+) create mode 100644 tests/bugs162/pr241047/case2/SomeAspect.java create mode 100644 tests/bugs162/pr241047/case2/SomeBaseClass.java create mode 100644 tests/bugs162/pr241047/case2/SomeInterface.java create mode 100644 tests/bugs162/pr241047/case2/SomeSubClass.java 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 { + + public void tag_someBaseMethod() { + System.out.println("some base method"); + } + + public static void main(String[] args) { + new SomeBaseClass().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 { + + // 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 @@ + + + + + + + + + + + + + + -- 2.39.5