You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

A.java 364B

12345678910111213141516171819
  1. enum Color {R,G,B;}
  2. @interface I { public Color a(); }
  3. @interface J { public Color b() default Color.B; }
  4. public class A {
  5. @J
  6. @I(a=Color.R)
  7. public static void main(String []argv) {
  8. }
  9. }
  10. aspect X {
  11. before(Color var): execution(* main(..)) && @annotation(I(var)) {
  12. if (var!=Color.R) {
  13. throw new RuntimeException("Wrong! Was "+var);
  14. }
  15. }
  16. }