diff options
author | Roel Spilker <r.spilker@gmail.com> | 2016-11-21 21:06:37 +0100 |
---|---|---|
committer | Roel Spilker <r.spilker@gmail.com> | 2016-11-21 21:06:37 +0100 |
commit | 29e73a7915790ed27b2b68710dbe8e39f0e37e0d (patch) | |
tree | 6a2fda6b8714c7bef757ca35d4da8c010ece0eb9 /test/transform/resource/before/VarComplex.java | |
parent | 192c569128d1ffb879fb104f44483e394032a790 (diff) | |
parent | 69eeb9edc767bb3ceb0320bb5a0ea60dfabe827c (diff) | |
download | lombok-29e73a7915790ed27b2b68710dbe8e39f0e37e0d.tar.gz lombok-29e73a7915790ed27b2b68710dbe8e39f0e37e0d.tar.bz2 lombok-29e73a7915790ed27b2b68710dbe8e39f0e37e0d.zip |
Merge branch 'feature/var' of https://github.com/bulgakovalexander/lombok into bulgakovalexander-feature/var
Diffstat (limited to 'test/transform/resource/before/VarComplex.java')
-rw-r--r-- | test/transform/resource/before/VarComplex.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/transform/resource/before/VarComplex.java b/test/transform/resource/before/VarComplex.java new file mode 100644 index 00000000..bfaa8804 --- /dev/null +++ b/test/transform/resource/before/VarComplex.java @@ -0,0 +1,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 + } +}
\ No newline at end of file |