diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/lombok/javac/TreeMirrorMaker.java | 10 |
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; + } } |