Community
Participate
Working Groups
This code works: --- import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; public class X { public static void main(String[] args) { new X().run(); } public void run() { m(); } @Colored public void m() {} } @Retention(RetentionPolicy.RUNTIME) @interface Colored {} aspect Asp { void around(Colored c): execution(* X.m(..)) && @annotation(c) { proceed(c); } } --- But the proceed doesn't really need to take the 'c' as it doesn't modify the annotation on the join point when we proceed upon it. Same issue with annotation value binding and proceed. Also see this related stack trace from https://bugs.eclipse.org/bugs/show_bug.cgi?id=273628#c1 C:\temp\ajcSandbox\aspectj16_2\ajcTest30146.tmp\AnnotationAspect.java:0::0 Internal compiler error java.lang.ArrayIndexOutOfBoundsException: 1 at org.aspectj.weaver.bcel.BcelWeaver.validateSingleBranchRecursion(BcelWeaver.java:808) at org.aspectj.weaver.bcel.BcelWeaver.validateSingleBranchRecursion(BcelWeaver.java:791)