[java-inspections] ReflectionForUnavailableAnnotation: fix NullPointerException

GitOrigin-RevId: 203ff77a14096913a4b9c8b07ee4eea9ea658cf6
This commit is contained in:
Andrey.Cherkasov
2021-10-18 10:46:12 +03:00
committed by intellij-monorepo-bot
parent 25b1f21fb7
commit 06369b2c81
3 changed files with 26 additions and 2 deletions

View File

@@ -0,0 +1,10 @@
// "Annotate annotation 'NotNull' as @Retention" "false"
import org.jetbrains.annotations.NotNull;
import java.lang.reflect.Method;
class Foo {
boolean bar(Method method) {
return method.getAnnotation(NotNull.class<caret>) != null;
}
}

View File

@@ -0,0 +1,10 @@
// "Annotate annotation 'Subst' as @Retention" "false"
import org.intellij.lang.annotations.Subst;
import java.lang.reflect.Method;
class Foo {
boolean bar(Method method) {
return method.getAnnotation(Subst.class<caret>) != null;
}
}