blob: 0df87facc3e5fc7295a8a3e982a0b01076b533b9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
public class ValComplex {
private String field = "";
private static final int CONSTANT = 20;
public void testComplex() {
final char[] shouldBeCharArray = field.toCharArray();
final int shouldBeInt = CONSTANT;
final java.lang.Object lock = new Object();
synchronized (lock) {
final int field = 20; //Shadowing
final int inner = 10;
switch (field) {
case 5:
final char[] shouldBeCharArray2 = shouldBeCharArray;
final int innerInner = inner;
}
}
final java.lang.String shouldBeString = field; //Unshadowing
}
}
|