mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-16 00:15:01 +00:00
Fixes issue 205: NullPointerException in javac's Check$Validator with val
This commit is contained in:
1 parent
52e7100060
commit
12b0753336
1 file changed
+10
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user