diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2014-05-23 04:07:39 +0200 |
---|---|---|
committer | Reinier Zwitserloot <reinier@zwitserloot.com> | 2014-05-23 04:07:39 +0200 |
commit | 4b878f9ba996f852ce555c3024512ae34e34774e (patch) | |
tree | 51ac37ecbb2e5f35b62523f9eec896211f758072 /src/core/lombok/javac/handlers/HandleNonNull.java | |
parent | 57c92478a92360a1d1547794d5a5d0b5393f59f6 (diff) | |
download | lombok-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.java | 4 |
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. |