blob: da53f520cad48a078c8f6e0d1c04953968a2fff2 (
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
25
26
27
28
29
30
31
|
import org.aspectj.lang.annotation.SuppressAjWarnings;
public aspect Code {
pointcut init(): initialization(Object+.new(..));
pointcut staticinit(): staticinitialization(Object+);
// Class around(String className): cflowbelow(init() || staticinit()) && call(Class Class.forName(String)) && args(className) {
// System.out.println("Test");
// return proceed(className);
// }
@SuppressAjWarnings("adviceDidNotMatch")
Integer around(int i): cflowbelow(init() || staticinit()) && call(Integer Integer.valueOf(int)) && args(i) {
System.out.println("Test");
return proceed(i);
}
public static void main(String[] argv) {
new SomeClass();
}
}
class SomeClass implements SomeInterface {
}
interface SomeInterface {
Integer i = 45;
}
|