org.aspectj/tests/bugs162/pr246264/A.java
2008-09-04 19:07:22 +00:00

20 lines
364 B
Java

enum Color {R,G,B;}
@interface I { public Color a(); }
@interface J { public Color b() default Color.B; }
public class A {
@J
@I(a=Color.R)
public static void main(String []argv) {
}
}
aspect X {
before(Color var): execution(* main(..)) && @annotation(I(var)) {
if (var!=Color.R) {
throw new RuntimeException("Wrong! Was "+var);
}
}
}