void (@NotNull PsiMethod method, @NotNull ProblemsHolder holder, @NotNull Annotated annotated, @NotNull NullableNotNullManager nullableManager) { PsiParameter[] parameters = method.getParameterList().getParameters(); if (REPORT_ANNOTATION_NOT_PROPAGATED_TO_OVERRIDERS) { boolean[] checkParameter = new boolean[parameters.length]; boolean[] parameterQuickFixSuggested = new boolean[parameters.length]; boolean hasAnnotatedParameter = false; for (int i = 0; i < parameters.length; i++) { PsiParameter parameter = parameters[i]; checkParameter[i] = isNotNullNotInferred(parameter, false, false) && !hasInheritableNotNull(parameter) && !(parameter.getType() instanceof PsiPrimitiveType); hasAnnotatedParameter |= checkParameter[i]; } boolean checkReturnType = annotated.isDeclaredNotNull && !hasInheritableNotNull(method) && !(method.getReturnType() instanceof PsiPrimitiveType); if (hasAnnotatedParameter || checkReturnType) { final String defaultNotNull = nullableManager.getDefaultNotNull(); final boolean superMethodApplicable = AnnotationUtil.isAnnotatingApplicable(method, defaultNotNull); PsiMethod[] overridings = OverridingMethodsSearch.search(method).toArray(PsiMethod.EMPTY_ARRAY); boolean methodQuickFixSuggested = false; for (PsiMethod overriding : overridings) { if (shouldSkipOverriderAsGenerated(overriding)) continue; if (!methodQuickFixSuggested && checkReturnType && !isNotNullNotInferred(overriding, false, false) && (isNullableNotInferred(overriding, false) || !isNullableNotInferred(overriding, true)) && AddAnnotationPsiFix.isAvailable(overriding, defaultNotNull)) { PsiIdentifier identifier = method.getNameIdentifier();//load tree NullabilityAnnotationInfo info = nullableManager.findOwnNullabilityInfo(method); if (info != null) { PsiAnnotation annotation = info.getAnnotation(); final String[] annotationsToRemove = ArrayUtilRt.toStringArray(nullableManager.getNullables()); LocalQuickFix fix = AnnotationUtil.isAnnotatingApplicable(overriding, defaultNotNull) ? new MyAnnotateMethodFix(defaultNotNull, annotationsToRemove) : superMethodApplicable ? null : createChangeDefaultNotNullFix(nullableManager, method); PsiElement psiElement = annotation; if (!annotation.isPhysical() || !PsiTreeUtil.isAncestor(method, annotation, true)) { psiElement = identifier; if (psiElement == null) continue; } reportProblem(holder, psiElement, fix, "nullable.stuff.problems.overridden.methods.are.not.annotated"); methodQuickFixSuggested = true; } } if (hasAnnotatedParameter) { PsiParameter[] psiParameters = overriding.getParameterList().getParameters(); for (int i = 0; i < psiParameters.length; i++) { if (parameterQuickFixSuggested[i]) continue; PsiParameter parameter = psiParameters[i]; if (checkParameter[i] && !isNotNullNotInferred(parameter, false, false) && !isNullableNotInferred(parameter, false) && AddAnnotationPsiFix.isAvailable(parameter, defaultNotNull)) { PsiIdentifier identifier = parameters[i].getNameIdentifier(); //be sure that corresponding tree element available NullabilityAnnotationInfo info = nullableManager.findOwnNullabilityInfo(parameters[i]); PsiElement psiElement = info == null ? null : info.getAnnotation(); if (psiElement == null || !psiElement.isPhysical()) { psiElement = identifier; if (psiElement == null) continue; } LocalQuickFix fix = AnnotationUtil.isAnnotatingApplicable(parameter, defaultNotNull) ? new AnnotateOverriddenMethodParameterFix(Nullability.NOT_NULL, defaultNotNull) : createChangeDefaultNotNullFix(nullableManager, parameters[i]); reportProblem(holder, psiElement, fix, "nullable.stuff.problems.overridden.method.parameters.are.not.annotated"); parameterQuickFixSuggested[i] = true; } } } } } } }