aboutsummaryrefslogtreecommitdiff
path: root/test/transform/resource/before/InjectField.java
blob: e81cbc5a2fe35379d33ac44ea8f9c80f577eff21 (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
import java.util.logging.Level;
import lombok.extern.java.Log;
import lombok.Synchronized;

@Log
enum InjectField1 {
	A,
	B;

	private static final String LOG_MESSAGE = "static initializer";

	private String fieldA;

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

	private String fieldB;

	@Synchronized
	void generateLockField() {
		System.out.println("lock field");
	}

	@Synchronized
	static void generateStaticLockField() {
		System.out.println("static lock field");
	}
}

@Log
class InjectField2 {
	private static final String LOG_MESSAGE = "static initializer";

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

	@Synchronized
	void generateLockField() {
		System.out.println("lock field");
	}
}

@Log
class InjectField3 {
	static {
		log.log(Level.FINE, "static initializer");
	}
}