aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2010-11-29 20:44:16 +0100
committerReinier Zwitserloot <reinier@zwitserloot.com>2010-11-29 20:44:16 +0100
commitdd0fded2bfbd5c318913209e93d74a2bb06f3d14 (patch)
tree8b65231f22568f8b7dfa15395ed5b83e59640eb6 /src
parenta8e92af7b7bea0240825666520e74cc6550a4750 (diff)
downloadlombok-dd0fded2bfbd5c318913209e93d74a2bb06f3d14.tar.gz
lombok-dd0fded2bfbd5c318913209e93d74a2bb06f3d14.tar.bz2
lombok-dd0fded2bfbd5c318913209e93d74a2bb06f3d14.zip
some more work on why delombok isn't tracking changes due to val alone.
Diffstat (limited to 'src')
-rw-r--r--src/core/lombok/javac/handlers/HandleVal.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/core/lombok/javac/handlers/HandleVal.java b/src/core/lombok/javac/handlers/HandleVal.java
index 14b0b44e..63dedc49 100644
--- a/src/core/lombok/javac/handlers/HandleVal.java
+++ b/src/core/lombok/javac/handlers/HandleVal.java
@@ -68,6 +68,8 @@ public class HandleVal extends JavacASTAdapter {
return;
}
+ JavacHandlerUtil.deleteImportFromCompilationUnit(localNode, "lombok.val");
+
local.mods.flags |= Flags.FINAL;
local.vartype = JavacResolution.createJavaLangObject(localNode.getTreeMaker(), localNode.getAst());
@@ -102,9 +104,10 @@ public class HandleVal extends JavacASTAdapter {
if (replacement != null) {
local.vartype = replacement;
- localNode.getAst().setChanged();
+ } else {
+ local.vartype = JavacResolution.createJavaLangObject(localNode.getTreeMaker(), localNode.getAst());;
}
- else local.vartype = JavacResolution.createJavaLangObject(localNode.getTreeMaker(), localNode.getAst());;
+ localNode.getAst().setChanged();
} catch (JavacResolution.TypeNotConvertibleException e) {
localNode.addError("Cannot use 'val' here because initializer expression does not have a representable type: " + e.getMessage());
local.vartype = JavacResolution.createJavaLangObject(localNode.getTreeMaker(), localNode.getAst());;