aboutsummaryrefslogtreecommitdiff
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
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.
-rw-r--r--doc/changelog.markdown5
-rw-r--r--src/core/lombok/javac/handlers/HandleExtensionMethod.java7
2 files changed, 9 insertions, 3 deletions
diff --git a/doc/changelog.markdown b/doc/changelog.markdown
index 1212056f..e0fe2b2c 100644
--- a/doc/changelog.markdown
+++ b/doc/changelog.markdown
@@ -3,8 +3,9 @@ Lombok Changelog
### v0.11.5 (Edgy Guinea Pig)
* FEATURE: Lombok can be disabled entirely for any given compile run by using JVM switch `-Dlombok.disable`. This might be useful for code style checkers and such.
-* BUGFIX: {Delombok} Running delombok has been causing VerifyError errors when used with javac 1.7 since 0.11.0.
-* BUGFIX: A conflict between lombok and certain eclipse plugins would result in NullPointerExceptions in the log when using @Delegate.
+* BUGFIX: {Delombok} Running delombok has been causing VerifyError errors when used with javac 1.7 since 0.11.0. [Issue #422](http://code.google.com/p/projectlombok/issues/detail?id=422)
+* BUGFIX: A conflict between lombok and certain eclipse plugins would result in NullPointerExceptions in the log when using `@Delegate`.
+* BUGFIX: `NullPointerException in lombok.javac.handlers.JavacHandlerUtil.upToTypeNode(JavacHandlerUtil.java:978)` when compiling with `@ExtensionMethod` in javac and generated constructors are involved. [Issue #423](http://code.google.com/p/projectlombok/issues/detail?id=423)
### v0.11.4 (August 13th, 2012)
* FEATURE: {Experimental} `@Value`, `@Wither` and `@FieldDefaults` are now available. These are a lot like `@Data` but geared towards immutable classes. [Documentation on @Value](http://projectlombok.org/features/experimental/Value.html), [Documentation on @Wither](http://projectlombok.org/features/experimental/Wither.html) and [Documentation on @FieldDefaults](http://projectlombok.org/features/experimental/FieldDefaults.html).
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;