void (Project project, @NotNull PsiMethod psiMethod) { SmartList<PsiMethod> methodsToModify = new SmartList<>(psiMethod); if (!ProgressManager.getInstance().runProcessWithProgressSynchronously(() -> { methodsToModify.addAll(OverridingMethodsSearch.search(psiMethod).findAll()); }, JavaBundle.message("psi.search.overriding.progress"), true, project)) { return; } if (!FileModificationService.getInstance().preparePsiElementsForWrite(methodsToModify)) return; var csp = JavaRefactoringFactory.getInstance(project) .createChangeSignatureProcessor(psiMethod, false, null, psiMethod.getName(), PsiTypes.voidType(), ParameterInfoImpl.fromMethod(psiMethod), null, null, null, infos -> { for (final PsiMethod method : methodsToModify) { replaceReturnStatements(method); } }); csp.run(); }