void (PsiField field, Annotated annotated, Project project, NullableNotNullManager manager, final String anno, final List<String> annoToRemove, @NotNull ProblemsHolder holder) { String propName = JavaCodeStyleManager.getInstance(project).variableNameToPropertyName(field.getName(), VariableKind.FIELD); final boolean isStatic = field.hasModifierProperty(PsiModifier.STATIC); final PsiMethod getter = PropertyUtilBase.findPropertyGetter(field.getContainingClass(), propName, isStatic, false); final PsiIdentifier nameIdentifier = getter == null ? null : getter.getNameIdentifier(); if (nameIdentifier != null && nameIdentifier.isPhysical()) { if (PropertyUtil.getFieldOfGetter(getter) == field) { LocalQuickFix getterAnnoFix = new AddAnnotationPsiFix(anno, getter, ArrayUtilRt.toStringArray(annoToRemove)); if (REPORT_NOT_ANNOTATED_GETTER) { if (!hasNullability(manager, getter) && !TypeConversionUtil.isPrimitiveAndNotNull(getter.getReturnType())) { reportProblem(holder, nameIdentifier, getterAnnoFix, "inspection.nullable.problems.annotated.field.getter.not.annotated", getPresentableAnnoName(field)); } } if (annotated.isDeclaredNotNull && isNullableNotInferred(getter, false) || annotated.isDeclaredNullable && isNotNullNotInferred(getter, false, false)) { reportProblem(holder, nameIdentifier, getterAnnoFix, "inspection.nullable.problems.annotated.field.getter.conflict", getPresentableAnnoName(field), getPresentableAnnoName(getter)); } } } final PsiClass containingClass = field.getContainingClass(); final PsiMethod setter = PropertyUtilBase.findPropertySetter(containingClass, propName, isStatic, false); if (setter != null && setter.isPhysical() && PropertyUtil.getFieldOfSetter(setter) == field) { final PsiParameter[] parameters = setter.getParameterList().getParameters(); assert parameters.length == 1 : setter.getText(); final PsiParameter parameter = parameters[0]; LOG.assertTrue(parameter != null, setter.getText()); AddAnnotationPsiFix addAnnoFix = createAddAnnotationFix(anno, annoToRemove, parameter); if (REPORT_NOT_ANNOTATED_GETTER && !hasNullability(manager, parameter) && !TypeConversionUtil.isPrimitiveAndNotNull(parameter.getType())) { final PsiIdentifier parameterName = parameter.getNameIdentifier(); assertValidElement(setter, parameter, parameterName); reportProblem(holder, parameterName, addAnnoFix, "inspection.nullable.problems.annotated.field.setter.parameter.not.annotated", getPresentableAnnoName(field)); } if (PropertyUtil.isSimpleSetter(setter)) { if (annotated.isDeclaredNotNull && isNullableNotInferred(parameter, false)) { final PsiIdentifier parameterName = parameter.getNameIdentifier(); assertValidElement(setter, parameter, parameterName); reportProblem(holder, parameterName, addAnnoFix, "inspection.nullable.problems.annotated.field.setter.parameter.conflict", getPresentableAnnoName(field), getPresentableAnnoName(parameter)); } } } }