aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/javac/handlers/HandleExtensionMethod.java
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2012-10-29 22:21:15 +0100
committerReinier Zwitserloot <reinier@zwitserloot.com>2012-10-29 22:21:15 +0100
commitd15d7228723ae5fa99036105c4df951ca9e40f1a (patch)
treeeafbb1fe1b88d112dd8feabcd4f81c69460f5709 /src/core/lombok/javac/handlers/HandleExtensionMethod.java
parentcec7dfd1908a92fa29763abf7d6a4faac7bd9d98 (diff)
downloadlombok-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/lombok/javac/handlers/HandleExtensionMethod.java')
-rw-r--r--src/core/lombok/javac/handlers/HandleExtensionMethod.java7
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;