blob: 5f71800355c22ee42e258a6e316666db96a2ce3e (
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 ValSimple field = new ValSimple();
private static final int CONSTANT = 20;
public void testReferencingOtherFiles() {
val shouldBeString = field.method();
val shouldBeInt = CONSTANT;
val lock = new Object();
synchronized (lock) {
val field = 20; //Shadowing
val inner = 10;
switch (field) {
case 5:
val shouldBeString2 = shouldBeString;
val innerInner = inner;
}
}
val shouldBeValSimple = field; //Unshadowing
}
}
|