--- /dev/null
+public class A {
+
+ @MyAnnotation
+ public void foo() {
+
+ }
+
+}
--- /dev/null
+public class B extends A {
+
+}
--- /dev/null
+public class C extends B {
+
+}
--- /dev/null
+import java.lang.annotation.*;
+
+@Retention(RetentionPolicy.RUNTIME) @interface MyAnnotation {}
--- /dev/null
+public aspect MyAspect {
+
+ // this throws an exception
+ before(MyAnnotation myAnnotation) :
+ //call(* *..*.*(..)) &&
+ call(@MyAnnotation * *(..)) &&
+ @annotation(myAnnotation) {
+
+ }
+
+ // this, however, works fine
+// before() :
+ // call(@MyAnnotation * *(..)) {
+ //
+ // }
+}
--- /dev/null
+public class Test {
+
+ public static void main(String args[]) {
+ C c = new C();
+ c.foo();
+ }
+
+}
*/
public class Ajc160Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
+ public void testInheritedAnnotations_pr169706() { runTest("inherited annotations");}
public void testGenericFieldNPE_pr165885() { runTest("generic field npe");}
public void testIncorrectOptimizationOfIstore_pr166084() { runTest("incorrect optimization of istore"); }
public void testDualParameterizationsNotAllowed_pr165631() { runTest("dual parameterizations not allowed"); }
<suite>
<!-- first section - dont need a 1.6 vm but fixed in the 1.6 branch of AspectJ -->
+ <ajc-test dir="bugs160/pr169706" title="inherited annotations">
+ <compile files="A.java,B.java,C.java,MyAspect.java,MyAnnotation.java,Test.java" options="-1.5 -showWeaveInfo">
+ <message kind="weave" text="Join point 'method-call(void C.foo())' in Type 'Test' (Test.java:5) advised by before advice from 'MyAspect' (MyAspect.java:4)"/>
+ </compile>
+ </ajc-test>
+
<ajc-test dir="bugs160/pr165885" title="generic field npe">
<compile files="Concrete.java,Abstract.java,Aspect.java" options="-1.5">
<message kind="warning" line="8" text="foo"/>