blob: bfaa88044daf07cb74b51321b8e33a70471eb0c9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
//CONF: lombok.var.flagUsage = ALLOW
import lombok.experimental.var;
public class VarComplex {
private String field = "";
private static final int CONSTANT = 20;
public void testComplex() {
var shouldBeCharArray = field.toCharArray();
var shouldBeInt = CONSTANT;
var lock = new Object();
synchronized (lock) {
var field = 20; //Shadowing
var inner = 10;
switch (field) {
case 5:
var shouldBeCharArray2 = shouldBeCharArray;
var innerInner = inner;
}
}
var shouldBeString = field; //Unshadowing
}
}
|