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.

CaseSix.java 430B

1234567891011121314151617181920212223
  1. // CaseSix - not an execution join point - compiler limitation
  2. import java.lang.annotation.*;
  3. public class CaseSix {
  4. @Anno static String s;
  5. public static void main(String []argv) {
  6. s = "hello";
  7. }
  8. }
  9. enum Level { NONE; }
  10. @Retention(RetentionPolicy.RUNTIME)
  11. @interface Anno { Level value() default Level.NONE; }
  12. aspect X {
  13. before(Level l): set(@Anno * *) && @annotation(Anno(l)) {
  14. System.out.println(l);
  15. }
  16. }