blob: f1a847d68ef4def4b4abe6509eb1a830fa77ee5b (
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
|
// In this program, the around advice calls foo() and foo is a private static field in
// class PrivateCall. When compiled the around() advice will be inlined and should call
// foo() through an inline accessor method.
public class PrivateCall {
public void test () {foo("test");}
private static void foo (String from) {
System.err.print(":"+from);
}
public static void main(String[] args) {
new PrivateCall().test();
}
private static aspect Aspect {
pointcut execTest () :
execution(* PrivateCall.test());
before () : execTest () {
foo("before");
}
void around () : execTest () {
foo("around");
}
}
}
|