blob: 33c2ca1c132938205f506b79e88b4bc1f400b019 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
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"); }
}
|