Vous ne pouvez pas sélectionner plus de 25 sujets
Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
123456789101112131415161718192021222324 |
- import java.lang.reflect.*;
-
- public class PerThisFieldsAreSynthetic {
-
- public static void main(String[] args) throws Exception {
- new PerThisFieldsAreSynthetic().foo();
- Field[] fields = PerThisFieldsAreSynthetic.class.getDeclaredFields();
- for (Field f : fields) {
- if (!f.isSynthetic()) {
- System.out.println("Found unexpected non-synthetic field: " + f.getName());
- throw new IllegalStateException("non-synthetic field " + f.getName());
- }
- }
- }
-
- public void foo() {}
-
- }
-
- aspect PerThis perthis(execution(* PerThisFieldsAreSynthetic.*(..))) {
-
- before() : execution(* *(..)) { System.out.println("before"); }
-
- }
|