aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs150/Pr114495.aj22
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java4
-rw-r--r--tests/src/org/aspectj/systemtest/ajc150/ajc150.xml13
3 files changed, 39 insertions, 0 deletions
diff --git a/tests/bugs150/Pr114495.aj b/tests/bugs150/Pr114495.aj
new file mode 100644
index 000000000..ebb7afcc5
--- /dev/null
+++ b/tests/bugs150/Pr114495.aj
@@ -0,0 +1,22 @@
+public class Pr114495 {
+ public static void main(String[] args) {
+ C.go();
+ }
+ static class C {
+ static void go() {}
+ }
+}
+
+abstract aspect AA_ParameterizedTypeInPointcut<Target> {
+ pointcut going() :call(void Target.go()) ;
+ before() : going() {
+ System.out.println("AA.going()");
+ }
+}
+aspect A_ParameterizedTypeInPointcut
+extends AA_ParameterizedTypeInPointcut<Pr114495.C> {
+ declare warning : going() : "going()"; // works fine
+ before() : going() { // advice not applied
+ System.out.println("A.going()");
+ }
+} \ No newline at end of file
diff --git a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
index 41960b5ae..c0ae27441 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
+++ b/tests/src/org/aspectj/systemtest/ajc150/Ajc150Tests.java
@@ -743,6 +743,10 @@ public class Ajc150Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
runTest("pertarget and negated pointcut");
}
+ public void testParameterizedPointcutAndAdvice() {
+ runTest("parameterized pointcut and advice");
+ }
+
/*
* Load-time weaving bugs
*/
diff --git a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
index 19a8c0f2f..a12482ec2 100644
--- a/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
+++ b/tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
@@ -27,6 +27,19 @@
</run>
</ajc-test>
+ <ajc-test dir="bugs150" pr="114495" title="parameterized pointcut and advice">
+ <compile files="Pr114495.aj" options="-1.5">
+ <message kind="warning" line="3" text="going()"/>
+ </compile>
+ <run class="Pr114495">
+ <stdout>
+ <line text="A.going()"/>
+ <line text="AA.going()"/>
+ </stdout>
+ </run>
+ </ajc-test>acj
+
+
<ajc-test dir="bugs150/pr114005" title="Annotated ITDFs - 2">
<compile files="Declaration2.java" options="-1.5"/>
<run class="Declaration2">