diff options
Diffstat (limited to 'src/lombok/javac/handlers/PKG.java')
-rw-r--r-- | src/lombok/javac/handlers/PKG.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/lombok/javac/handlers/PKG.java b/src/lombok/javac/handlers/PKG.java index bc5b691c..ea794296 100644 --- a/src/lombok/javac/handlers/PKG.java +++ b/src/lombok/javac/handlers/PKG.java @@ -254,16 +254,19 @@ class PKG { return e; } - static JCAnnotation findNonNullAnnotation(Node fieldNode) { + static List<JCAnnotation> findNonNullAnnotations(Node fieldNode) { + List<JCAnnotation> result = List.nil(); for ( Node child : fieldNode.down() ) { if ( child.getKind() == Kind.ANNOTATION ) { JCAnnotation annotation = (JCAnnotation) child.get(); String name = annotation.annotationType.toString(); - if (name.equals("NonNull") || name.endsWith(".NonNull")) { - return annotation; + int idx = name.lastIndexOf("."); + String suspect = idx == -1 ? name : name.substring(idx + 1); + if (suspect.equalsIgnoreCase("NonNull") || suspect.equalsIgnoreCase("NotNull")) { + result = result.append(annotation); } } } - return null; + return result; } } |