blob: e5e30c6f55b3823a6cde8a8a371a9297e9435deb (
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
34
35
36
37
38
|
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
public aspect Five {
public static void main(String[] args) {
C.b();
C.c();
C.d();
C.e();
}
before(): !within(Five) && call(* println(..)) { System.err.println("test");}
}
class C {
public static synchronized void b() {
System.err.println("hello");
}
public static void c() {
synchronized (C.class) {
System.err.println("hello");
}
}
public static void d() {
synchronized (String.class) {
System.err.println("hello");
}
}
public static void e() {
synchronized (Five.class) {
System.err.println("hello");
}
}
}
aspect FiveX { pointcut p(): unlock(); }
|