aboutsummaryrefslogtreecommitdiff
path: root/test/transform/resource/after-delombok/InjectField.java
blob: a9b4b1c496485206d77421c18494eb8577e12fda (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
import java.util.logging.Level;

enum InjectField1 {
	A,
	B;

	private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(InjectField1.class.getName());
	@java.lang.SuppressWarnings("all")
	private final java.lang.Object $lock = new java.lang.Object[0];
	@java.lang.SuppressWarnings("all")
	private static final java.lang.Object $LOCK = new java.lang.Object[0];

	private static final String LOG_MESSAGE = "static initializer";

	private String fieldA;

	static {
		log.log(Level.FINE, LOG_MESSAGE);
	}

	private String fieldB;

	void generateLockField() {
		synchronized (this.$lock) {
			System.out.println("lock field");
		}
	}

	static void generateStaticLockField() {
		synchronized (InjectField1.$LOCK) {
			System.out.println("static lock field");
		}
	}
}

class InjectField2 {
	private static final java.util.logging.Logger log = java.util.logging.Logger.getLogger(InjectField2.class.getName());
	@java.lang.SuppressWarnings("all")
	private final java.lang.Object $lock = new java.lang.Object[0];

	private static final String LOG_MESSAGE = "static initializer";

	static {
		log.log(Level.FINE, LOG_MESSAGE);
	}

	void generateLockField() {
		synchronized (this.$lock) {
			System.out.println("lock field");
		}
	}
}

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");
	}
}