NullableNotNullManager#getNullability created and used

This commit is contained in:
Tagir Valeev
2018-06-09 14:37:24 +07:00
parent 91453c1649
commit f042e70b7a
9 changed files with 44 additions and 52 deletions

View File

@@ -775,8 +775,9 @@ public class NullableStuffInspectionBase extends AbstractBaseJavaLocalInspection
fix);
}
if (isNotNullParameterOverridingNonAnnotated(nullableManager, parameter, superParameters)) {
PsiAnnotation notNullAnnotation = nullableManager.getNotNullAnnotation(parameter, false);
assert notNullAnnotation != null;
NullabilityAnnotationInfo info = nullableManager.findOwnNullabilityAnnotationInfo(parameter);
assert info != null;
PsiAnnotation notNullAnnotation = info.getAnnotation();
boolean physical = PsiTreeUtil.isAncestor(parameter, notNullAnnotation, true);
final LocalQuickFix fix = physical ? new RemoveAnnotationQuickFix(notNullAnnotation, parameter) : null;
holder.registerProblem(physical ? notNullAnnotation : parameter.getNameIdentifier(),