aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2013-08-06 21:22:48 +0200
committerReinier Zwitserloot <reinier@zwitserloot.com>2013-08-06 21:22:48 +0200
commitdf69425550d55da3de07f922fced3872432cd9d3 (patch)
treeb95e5fa73afd4d7d96873f1d03ea97aae515de31 /src/core/lombok
parent9ed14b8cbf8beb209f0d63e69e472bf81efe1d35 (diff)
downloadlombok-df69425550d55da3de07f922fced3872432cd9d3.tar.gz
lombok-df69425550d55da3de07f922fced3872432cd9d3.tar.bz2
lombok-df69425550d55da3de07f922fced3872432cd9d3.zip
position now set for all code generated by javac handlers;
this also solves the AssertionError in the Bits class on javac8-ea.
Diffstat (limited to 'src/core/lombok')
-rw-r--r--src/core/lombok/javac/handlers/JavacHandlerUtil.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/core/lombok/javac/handlers/JavacHandlerUtil.java b/src/core/lombok/javac/handlers/JavacHandlerUtil.java
index c245d506..65997f9a 100644
--- a/src/core/lombok/javac/handlers/JavacHandlerUtil.java
+++ b/src/core/lombok/javac/handlers/JavacHandlerUtil.java
@@ -97,6 +97,7 @@ public class JavacHandlerUtil {
}
@Override public void scan(JCTree tree) {
+ if (tree == null) return;
setGeneratedBy(tree, source);
super.scan(tree);
}
@@ -134,10 +135,12 @@ public class JavacHandlerUtil {
}
public static <T extends JCTree> T setGeneratedBy(T node, JCTree source) {
+ if (node == null) return null;
synchronized (generatedNodes) {
if (source == null) generatedNodes.remove(node);
else generatedNodes.put(node, new WeakReference<JCTree>(source));
}
+ if (source != null) node.pos = source.pos;
return node;
}