PsiAnnotation (@NotNull PsiModifierListOwner listOwner, @NotNull String annotationFQN) { if (!(listOwner instanceof PsiCompiledElement)) { return null; } if (annotationFQN.equals(myNullabilityManager.getDefaultNotNull()) || annotationFQN.equals(myNullabilityManager.getDefaultNullable()) || annotationFQN.equals(JavaMethodContractUtil.ORG_JETBRAINS_ANNOTATIONS_CONTRACT)) { PsiAnnotation[] annotations = findInferredAnnotations(listOwner); for (PsiAnnotation annotation : annotations) { if (annotation.hasQualifiedName(annotationFQN)) { return annotation; } } } return null; }