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.

Code.java 391B

12345678910111213141516171819202122232425
  1. import java.lang.annotation.*;
  2. public class Code {
  3. @Anno
  4. int i=0;
  5. @Anno(name="foobar")
  6. int j=0;
  7. public void m() {
  8. i = i+1;
  9. j = j+1;
  10. }
  11. }
  12. @Retention(RetentionPolicy.RUNTIME)
  13. @interface Anno {
  14. String name() default "";
  15. }
  16. aspect X {
  17. declare warning: get(@Anno(name="") * *) : "name is empty1";
  18. declare warning: get(@Anno(name="foobar") * *) : "name is empty2";
  19. }