diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2012-10-29 22:21:15 +0100 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2012-10-29 22:21:15 +0100 |
commit | d15d7228723ae5fa99036105c4df951ca9e40f1a (patch) | |
tree | eafbb1fe1b88d112dd8feabcd4f81c69460f5709 /src/core | |
parent | cec7dfd1908a92fa29763abf7d6a4faac7bd9d98 (diff) | |
download | lombok-d15d7228723ae5fa99036105c4df951ca9e40f1a.tar.gz lombok-d15d7228723ae5fa99036105c4df951ca9e40f1a.tar.bz2 lombok-d15d7228723ae5fa99036105c4df951ca9e40f1a.zip |
fix for issue #423: @ExtensionMethods failed with an NPE in the handler on javac if generated constructors are involved.
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/lombok/javac/handlers/HandleExtensionMethod.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/core/lombok/javac/handlers/HandleExtensionMethod.java b/src/core/lombok/javac/handlers/HandleExtensionMethod.java index 717afbc5..788a16a0 100644 --- a/src/core/lombok/javac/handlers/HandleExtensionMethod.java +++ b/src/core/lombok/javac/handlers/HandleExtensionMethod.java @@ -147,10 +147,15 @@ public class HandleExtensionMethod extends JavacAnnotationHandler<ExtensionMetho handleMethodCall((JCMethodInvocation) tree); return super.visitMethodInvocation(tree, p); } - + private void handleMethodCall(final JCMethodInvocation methodCall) { JavacNode methodCallNode = annotationNode.getAst().get(methodCall); + if (methodCallNode == null) { + // This should mean the node does not exist in the source at all. This is the case for generated nodes, such as implicit super() calls. + return; + } + JavacNode surroundingType = upToTypeNode(methodCallNode); TypeSymbol surroundingTypeSymbol = ((JCClassDecl)surroundingType.get()).sym; |