mirror of
https://github.com/eclipse-aspectj/aspectj.git
synced 2024-08-13 14:13:07 +02:00
20 lines
364 B
Java
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);
|
|
}
|
|
}
|
|
}
|