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.

PerThisFieldsAreSynthetic.aj 659B

123456789101112131415161718192021222324
  1. import java.lang.reflect.*;
  2. public class PerThisFieldsAreSynthetic {
  3. public static void main(String[] args) throws Exception {
  4. new PerThisFieldsAreSynthetic().foo();
  5. Field[] fields = PerThisFieldsAreSynthetic.class.getDeclaredFields();
  6. for (Field f : fields) {
  7. if (!f.isSynthetic()) {
  8. System.out.println("Found unexpected non-synthetic field: " + f.getName());
  9. throw new IllegalStateException("non-synthetic field " + f.getName());
  10. }
  11. }
  12. }
  13. public void foo() {}
  14. }
  15. aspect PerThis perthis(execution(* PerThisFieldsAreSynthetic.*(..))) {
  16. before() : execution(* *(..)) { System.out.println("before"); }
  17. }