blob: 6b2ccb3cd19e3f949fc117a8fe2ac7ee15f29f18 (
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
32
33
|
package tracing;
import org.aspectj.lang.annotation.*;
@Aspect abstract class Bug {
@Pointcut
public abstract void traced(Object thiz);
@Before("traced(o) && execution(* m(..))")
public void b1(Object o) {
System.out.println("o is '"+o+"'");
}
}
public @Aspect class Bug2 extends Bug {
@Pointcut("this(thiz)")
public void traced(Object thiz) {}
public static void main(String []argv) {
C.main(argv);
}
}
class C {
public static void main(String []argv) {
new C().m();
}
public void m() {
}
public String toString() { return "instance of C";}
}
|