void (@NotNull Project project, @NotNull PsiFile file, Editor editor, @NotNull PsiMethod method, @NotNull PsiType returnType) { if (myFixWholeHierarchy) { final PsiMethod superMethod = method.findDeepestSuperMethod(); final PsiType superReturnType = superMethod == null ? null : superMethod.getReturnType(); if (superReturnType != null && !Comparing.equal(returnType, superReturnType) && !changeClassTypeArgument(method, project, superReturnType, superMethod.getContainingClass(), editor, returnType)) { return; } } final List<PsiMethod> affectedMethods = changeReturnType(method, returnType); PsiElementFactory factory = JavaPsiFacade.getElementFactory(project); PsiReturnStatement statementToSelect = null; if (!PsiTypes.voidType().equals(returnType)) { final ReturnStatementAdder adder = new ReturnStatementAdder(factory, returnType); for (PsiMethod affectedMethod : affectedMethods) { PsiReturnStatement statement = adder.addReturnForMethod(file, affectedMethod); if (statement != null && affectedMethod == method) { statementToSelect = statement; } } } if (statementToSelect != null) { Editor editorForMethod = getEditorForMethod(method, project, editor, file); if (editorForMethod != null) { selectInEditor(statementToSelect.getReturnValue(), editorForMethod); } } }