blob: 83d9e5fa5782003efa17e660a089723b8123236e (
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
import java.util.logging.Level;
import lombok.extern.java.Log;
import lombok.Synchronized;
@Log enum InjectField1 {
A(),
B(),
private final java.lang.Object $lock = new java.lang.Object[0];
private static final java.lang.Object $LOCK = new java.lang.Object[0];
private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(InjectField1.class.getName());
private static final String LOG_MESSAGE = "static initializer";
private String fieldA;
static {
log.log(Level.FINE, LOG_MESSAGE);
}
private String fieldB;
<clinit>() {
}
InjectField1() {
super();
}
@Synchronized void generateLockField() {
synchronized (this.$lock)
{
System.out.println("lock field");
}
}
static @Synchronized void generateStaticLockField() {
synchronized (InjectField1.$LOCK)
{
System.out.println("static lock field");
}
}
}
@Log class InjectField2 {
private final java.lang.Object $lock = new java.lang.Object[0];
private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(InjectField2.class.getName());
private static final String LOG_MESSAGE = "static initializer";
static {
log.log(Level.FINE, LOG_MESSAGE);
}
<clinit>() {
}
InjectField2() {
super();
}
@Synchronized void generateLockField() {
synchronized (this.$lock)
{
System.out.println("lock field");
}
}
}
@Log class InjectField3 {
private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(InjectField3.class.getName());
static {
log.log(Level.FINE, "static initializer");
}
<clinit>() {
}
InjectField3() {
super();
}
}
|