Browse Source

test and fix for 169706: inherited annotations down a hierarchy greater than 2 deep

tags/Root_extensions
aclement 17 years ago
parent
commit
e9e52fea12

+ 8
- 0
tests/bugs160/pr169706/A.java View File

@@ -0,0 +1,8 @@
public class A {

@MyAnnotation
public void foo() {

}

}

+ 3
- 0
tests/bugs160/pr169706/B.java View File

@@ -0,0 +1,3 @@
public class B extends A {

}

+ 3
- 0
tests/bugs160/pr169706/C.java View File

@@ -0,0 +1,3 @@
public class C extends B {

}

+ 3
- 0
tests/bugs160/pr169706/MyAnnotation.java View File

@@ -0,0 +1,3 @@
import java.lang.annotation.*;

@Retention(RetentionPolicy.RUNTIME) @interface MyAnnotation {}

+ 16
- 0
tests/bugs160/pr169706/MyAspect.java View File

@@ -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 * *(..)) {
//
// }
}

+ 8
- 0
tests/bugs160/pr169706/Test.java View File

@@ -0,0 +1,8 @@
public class Test {

public static void main(String args[]) {
C c = new C();
c.foo();
}

}

+ 1
- 0
tests/src/org/aspectj/systemtest/ajc160/Ajc160Tests.java View File

@@ -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"); }

+ 6
- 0
tests/src/org/aspectj/systemtest/ajc160/ajc160.xml View File

@@ -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"/>

Loading…
Cancel
Save