aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPhilipp Eichhorn <peichhor@web.de>2011-05-16 20:34:17 +0200
committerRoel Spilker <r.spilker@gmail.com>2011-05-16 20:35:22 +0200
commit12b0753336e25aab11476234553b9058dc592eb2 (patch)
treebc53b0a059f1ef482f77f874ec279905b1fa9bd0 /src
parent52e710006028a7014a7b654d78c7bb3c2ff4f1c6 (diff)
downloadlombok-12b0753336e25aab11476234553b9058dc592eb2.tar.gz
lombok-12b0753336e25aab11476234553b9058dc592eb2.tar.bz2
lombok-12b0753336e25aab11476234553b9058dc592eb2.zip
Fixes issue 205: NullPointerException in javac's Check$Validator with val
Diffstat (limited to 'src')
-rw-r--r--src/core/lombok/javac/TreeMirrorMaker.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/lombok/javac/TreeMirrorMaker.java b/src/core/lombok/javac/TreeMirrorMaker.java
index d3f95b29..7354be97 100644
--- a/src/core/lombok/javac/TreeMirrorMaker.java
+++ b/src/core/lombok/javac/TreeMirrorMaker.java
@@ -5,7 +5,9 @@ import java.util.IdentityHashMap;
import java.util.Iterator;
import java.util.Map;
+import com.sun.source.tree.VariableTree;
import com.sun.tools.javac.tree.JCTree;
+import com.sun.tools.javac.tree.JCTree.JCVariableDecl;
import com.sun.tools.javac.tree.TreeCopier;
import com.sun.tools.javac.util.List;
@@ -51,4 +53,12 @@ public class TreeMirrorMaker extends TreeCopier<Void> {
public Map<JCTree, JCTree> getOriginalToCopyMap() {
return Collections.unmodifiableMap(originalToCopy);
}
+
+ // Fix for NPE in HandleVal. See http://code.google.com/p/projectlombok/issues/detail?id=205
+ // Maybe this should be done elsewhere...
+ @Override public JCTree visitVariable(VariableTree node, Void p) {
+ JCVariableDecl copy = (JCVariableDecl) super.visitVariable(node, p);
+ copy.sym = ((JCVariableDecl) node).sym;
+ return copy;
+ }
}