blob: 54ef5c785e7175afd0dce6cc6488198e0cf94c15 (
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() {
final java.lang.String shouldBeString = field.method();
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 java.lang.String shouldBeString2 = shouldBeString;
final int innerInner = inner;
}
}
final ValSimple shouldBeValSimple = field; //Unshadowing
}
}
|