aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/javac/handlers/HandleNonNull.java
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2014-05-23 04:07:39 +0200
committerReinier Zwitserloot <reinier@zwitserloot.com>2014-05-23 04:07:39 +0200
commit4b878f9ba996f852ce555c3024512ae34e34774e (patch)
tree51ac37ecbb2e5f35b62523f9eec896211f758072 /src/core/lombok/javac/handlers/HandleNonNull.java
parent57c92478a92360a1d1547794d5a5d0b5393f59f6 (diff)
downloadlombok-4b878f9ba996f852ce555c3024512ae34e34774e.tar.gz
lombok-4b878f9ba996f852ce555c3024512ae34e34774e.tar.bz2
lombok-4b878f9ba996f852ce555c3024512ae34e34774e.zip
Added confkey to make @NonNull generate a different exception because of the IllegalArgumentException vs. NullPointerException that we really don’t want to get into.
Diffstat (limited to 'src/core/lombok/javac/handlers/HandleNonNull.java')
-rw-r--r--src/core/lombok/javac/handlers/HandleNonNull.java4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/core/lombok/javac/handlers/HandleNonNull.java b/src/core/lombok/javac/handlers/HandleNonNull.java
index 172e70b3..cd8e3402 100644
--- a/src/core/lombok/javac/handlers/HandleNonNull.java
+++ b/src/core/lombok/javac/handlers/HandleNonNull.java
@@ -84,8 +84,6 @@ public class HandleNonNull extends JavacAnnotationHandler<NonNull> {
return;
}
-// if (JavacHandlerUtil.isGenerated(declaration)) return;
-
if (declaration.body == null) {
annotationNode.addWarning("@NonNull is meaningless on a parameter of an abstract method.");
return;
@@ -95,7 +93,7 @@ public class HandleNonNull extends JavacAnnotationHandler<NonNull> {
// and if they exist, create a new method in the class: 'private static <T> T lombok$nullCheck(T expr, String msg) {if (expr == null) throw NPE; return expr;}' and
// wrap all references to it in the super/this to a call to this method.
- JCStatement nullCheck = recursiveSetGeneratedBy(generateNullCheck(annotationNode.getTreeMaker(), annotationNode.up()), ast, annotationNode.getContext());
+ JCStatement nullCheck = recursiveSetGeneratedBy(generateNullCheck(annotationNode.getTreeMaker(), annotationNode.up(), annotationNode), ast, annotationNode.getContext());
if (nullCheck == null) {
// @NonNull applied to a primitive. Kinda pointless. Let's generate a warning.