--- /dev/null
+import java.lang.reflect.Field;
+import java.lang.annotation.*;
+
+public aspect ChainedItd {
+ declare @field: long *.foo: @Deprecated;
+
+ declare @field: @Deprecated * *.foo: @MyAnnotation;
+ //uncomment the line below to prove our test should work
+ //declare @field: long *.foo: @MyAnnotation;
+
+ public static void main(String argz[]) throws Exception {
+ Field idField = Test.class.getDeclaredField("foo");
+ idField.setAccessible(true);
+ assert idField.getAnnotation(MyAnnotation.class) != null;
+ }
+}
+
+class Test {
+ private long foo;
+}
+
+@Retention(RetentionPolicy.RUNTIME)
+@interface MyAnnotation {
+}
public class Ajc162Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
// AspectJ1.6.2
+// public void testAdvisingInterfaces_pr163005() { runTest("advising joinpoints in interfaces"); }
+ public void testChainedItds_pr176905() { runTest("chained itds"); }
public void testDecAtAnnoDecP_pr198341() { runTest("dec atanno and decp"); }
// public void testStarInAnnoStyle_pr209951() { runTest("asterisk in at aj pointcut"); }
public void testMissingMarkers_pr197720() { runTest("missing markers on inherited annotated method"); }
<!-- AspectJ v1.6.2 Tests -->
<suite>
+
+ <ajc-test dir="bugs162/pr163005" title="advising joinpoints in interfaces">
+ <compile files="SomeClass.java SomeInterface.java ProblemAspect.java" options="-1.4">
+ <message kind="warning" text="Cannot advise join point 'method-call(java.lang.Class java.lang.Class.forName(java.lang.String))' in interface 'SomeInterface' with around advice from 'ProblemAspect.java' line '7' as it will lead to creation of code in an interface (compiler limitation, bug 163005)"/>
+ </compile>
+ <run class="SomeClass"/>
+ </ajc-test>
+
+ <ajc-test dir="bugs162/pr176905" title="chained itds">
+ <compile options="-1.5" files="ChainedItd.aj">
+ </compile>
+ <run class="ChainedItd">
+ <stderr/> <!-- no errors-->
+ </run>
+ </ajc-test>
<ajc-test dir="bugs162/pr198341" title="dec atanno and decp">
<compile options="-1.5 -showWeaveInfo" files="AnnotationAspect.java">
</compile>
</ajc-test>
-
<ajc-test dir="bugs162/pr209051" title="asterisk in at aj pointcut">
<compile options="-1.5" files="Bug.java"/>
<run class="Bug">