void (@NotNull PsiMethod method) { super.visitMethod(method); final String name = method.getName(); final String fieldName; final boolean setter; final String extractedFieldName; if (nameStartsWith(name, "get")) { final PsiField getterField = PropertyUtil.getFieldOfGetter(method); if (getterField == null) { return; } fieldName = getterField.getName(); extractedFieldName = name.substring(3); setter = false; } else if (nameStartsWith(name, "is")) { final PsiField getterField = PropertyUtil.getFieldOfGetter(method); if (getterField == null) { return; } fieldName = getterField.getName(); extractedFieldName = name.substring(2); setter = false; } else if (nameStartsWith(name, "set")) { final PsiField setterField = PropertyUtil.getFieldOfSetter(method); if (setterField == null) { return; } fieldName = setterField.getName(); extractedFieldName = name.substring(3); setter = true; } else { return; } final JavaCodeStyleManager codeStyleManager = JavaCodeStyleManager.getInstance(method.getProject()); final String computedFieldName = codeStyleManager.propertyNameToVariableName(extractedFieldName, VariableKind.FIELD); final String computedStaticFieldName = codeStyleManager.propertyNameToVariableName(extractedFieldName, VariableKind.STATIC_FINAL_FIELD); if (fieldName.equalsIgnoreCase(computedFieldName) || fieldName.equalsIgnoreCase(computedStaticFieldName)) { return; } if (onlyWarnWhenFieldPresent) { final PsiClass aClass = method.getContainingClass(); if (aClass == null) { return; } if (aClass.findFieldByName(computedFieldName, true) == null && aClass.findFieldByName(computedStaticFieldName, true) == null) { return; } } registerMethodError(method, Boolean.valueOf(setter), fieldName); }