Skip to content

Commit 87e94d5

Browse files
authored
Merge pull request jooby-project#2380 from agentgt/2379-allow-other-nonnull
Allow other NonNull/Nullable annotations for APT
2 parents c48c352 + be3c16e commit 87e94d5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

modules/jooby-apt/src/main/java/io/jooby/internal/apt/ParamDefinition.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,12 @@ public boolean isNamed() {
100100
}
101101

102102
public boolean isNullable() {
103-
if (hasAnnotation("org.jetbrains.annotations.Nullable")
103+
if (hasAnnotation(".Nullable")
104104
|| hasAnnotation("javax.annotation.Nullable")) {
105105
return true;
106106
}
107-
boolean nonnull = hasAnnotation("org.jetbrains.annotations.NotNull")
107+
boolean nonnull = hasAnnotation(".NotNull")
108+
|| hasAnnotation(".NonNull")
108109
|| hasAnnotation("javax.annotation.Nonnull");
109110
if (nonnull) {
110111
return false;
@@ -114,7 +115,7 @@ public boolean isNullable() {
114115

115116
private boolean hasAnnotation(String type) {
116117
for (AnnotationMirror annotation : parameter.getAnnotationMirrors()) {
117-
if (annotation.getAnnotationType().toString().equals(type)) {
118+
if (annotation.getAnnotationType().toString().endsWith(type)) {
118119
return true;
119120
}
120121
}

0 commit comments

Comments
 (0)