From f1cf083890c223bf7245190264438740ee724bc9 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Wed, 3 Nov 2010 00:42:58 +0100 Subject: val in java, including tests and javac resolution utilities. --- test/transform/resource/before/ValComplex.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 test/transform/resource/before/ValComplex.java (limited to 'test/transform/resource/before/ValComplex.java') diff --git a/test/transform/resource/before/ValComplex.java b/test/transform/resource/before/ValComplex.java new file mode 100644 index 00000000..5f718003 --- /dev/null +++ b/test/transform/resource/before/ValComplex.java @@ -0,0 +1,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 + } +} \ No newline at end of file -- cgit