Allow other NonNull/Nullable annotations for APT
@@ -96,11 +96,12 @@ public class ParamDefinition {
}
public boolean isNullable() {
- if (hasAnnotation("org.jetbrains.annotations.Nullable")
+ if (hasAnnotation(".Nullable")
|| hasAnnotation("javax.annotation.Nullable")) {
return true;
}
- boolean nonnull = hasAnnotation("org.jetbrains.annotations.NotNull")
+ boolean nonnull = hasAnnotation(".NotNull")
+ || hasAnnotation(".NonNull")
|| hasAnnotation("javax.annotation.Nonnull");
if (nonnull) {
return false;
@@ -110,7 +111,7 @@ public class ParamDefinition {
private boolean hasAnnotation(String type) {
for (AnnotationMirror annotation : parameter.getAnnotationMirrors()) {
- if (annotation.getAnnotationType().toString().equals(type)) {
+ if (annotation.getAnnotationType().toString().endsWith(type)) {
return true;
}
}
