@@ -0,0 +1,8 @@ | |||
public class A { | |||
@MyAnnotation | |||
public void foo() { | |||
} | |||
} |
@@ -0,0 +1,3 @@ | |||
public class B extends A { | |||
} |
@@ -0,0 +1,3 @@ | |||
public class C extends B { | |||
} |
@@ -0,0 +1,3 @@ | |||
import java.lang.annotation.*; | |||
@Retention(RetentionPolicy.RUNTIME) @interface MyAnnotation {} |
@@ -0,0 +1,16 @@ | |||
public aspect MyAspect { | |||
// this throws an exception | |||
before(MyAnnotation myAnnotation) : | |||
//call(* *..*.*(..)) && | |||
call(@MyAnnotation * *(..)) && | |||
@annotation(myAnnotation) { | |||
} | |||
// this, however, works fine | |||
// before() : | |||
// call(@MyAnnotation * *(..)) { | |||
// | |||
// } | |||
} |
@@ -0,0 +1,8 @@ | |||
public class Test { | |||
public static void main(String args[]) { | |||
C c = new C(); | |||
c.foo(); | |||
} | |||
} |
@@ -21,6 +21,7 @@ import junit.framework.Test; | |||
*/ | |||
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"); } |
@@ -4,6 +4,12 @@ | |||
<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"/> |