void (@NotNull final BeanProperty property, final String newName, @Nullable Editor editor, final boolean searchInComments, boolean isPreview) { final PsiElement psiElement = property.getPsiElement(); final RenameRefactoring rename = new JavaRenameRefactoringImpl(psiElement.getProject(), psiElement, newName, searchInComments, false); rename.setPreviewUsages(isPreview); final PsiMethod setter = property.getSetter(); final PsiElement setterSubstitutor = substituteElementToRename(setter, editor); if (setterSubstitutor != null) { if (setterSubstitutor == setter) { rename.addElement(setterSubstitutor, PropertyUtilBase.suggestSetterName(newName)); } else { rename.addElement(setterSubstitutor, newName); } final PsiParameter[] setterParameters = setter.getParameterList().getParameters(); if (setterParameters.length == 1) { final JavaCodeStyleManager manager = JavaCodeStyleManager.getInstance(psiElement.getProject()); final String suggestedParameterName = manager.propertyNameToVariableName(property.getName(), VariableKind.PARAMETER); if (suggestedParameterName.equals(setterParameters[0].getName())) { rename.addElement(setterParameters[0], manager.propertyNameToVariableName(newName, VariableKind.PARAMETER)); } } } final PsiMethod getter = property.getGetter(); final PsiElement getterSubstitutor = substituteElementToRename(getter, editor); if (getterSubstitutor != null) { if (getterSubstitutor == getter) { rename.addElement(getterSubstitutor, PropertyUtilBase.suggestGetterName(newName, getter.getReturnType())); } else { rename.addElement(getterSubstitutor, newName); } } rename.run(); }