added supporting of @var variables. The @var annotation has the same functionality as the @val except 'final' modifier.

This commit is contained in:
Bulgakov Alexander
2016-10-20 16:41:40 +03:00
parent 4d9da60f4f
commit 55619e8030
18 changed files with 321 additions and 106 deletions
@@ -0,0 +1,22 @@
import lombok.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
}
}