void (@NotNull final Project project, @NotNull final PsiFile file, @Nullable Editor editor, @NotNull PsiElement startElement, @NotNull PsiElement endElement) { final PsiMethod myMethod = (PsiMethod)startElement; if (!FileModificationService.getInstance().prepareFileForWrite(myMethod.getContainingFile())) return; try { PsiMethod method = myMethod; if (myFixWholeHierarchy) { method = myMethod.findDeepestSuperMethod(); if (method == null) method = myMethod; } final PsiMethod finalMethod = method; var processor = JavaRefactoringFactory.getInstance(project) .createChangeSignatureProcessor(finalMethod, false, null, finalMethod.getName(), finalMethod.getReturnType(), getNewParametersInfo(finalMethod), null, null, null, null); processor.run(); UndoUtil.markPsiFileForUndo(file); } catch (IncorrectOperationException e) { LOG.error(e); } }