void (@NotNull Project project, @NotNull PsiElement methodNameIdentifier, @NotNull ModPsiUpdater updater) { if (!(methodNameIdentifier.getParent() instanceof PsiMethod method)) return; PsiMethod superMethod = findSuperMethod(method); if (superMethod == null) return; PsiClassType requiredQualifier = findRequiredSuperQualifier(method.getContainingClass(), superMethod); String qualifier = requiredQualifier != null ? requiredQualifier.rawType().getCanonicalText() + ".super." : "super."; String parameters = StringUtil.join(superMethod.getParameterList().getParameters(), PsiParameter::getName, ","); String call = qualifier + method.getName() + "(" + parameters + ");"; if (!PsiTypes.voidType().equals(method.getReturnType())) { call = "return " + call; } PsiSubstitutor substitutor = getSuperSubstitutor(method, superMethod); if (substitutor == null) return; PsiParameterList parameterList = (PsiParameterList) superMethod.getParameterList().copy(); for (PsiParameter parameter: parameterList.getParameters()) { PsiTypeElement newType = PsiElementFactory.getInstance(project).createTypeElement(substitutor.substitute(parameter.getType())); PsiTypeElement oldType = parameter.getTypeElement(); assert oldType != null; oldType.replace(newType); } for (PsiParameter parameter: method.getParameterList().getParameters()) { PsiTypeElement newType = PsiElementFactory.getInstance(project).createTypeElement(substitutor.substitute(parameter.getType())); PsiTypeElement oldType = parameter.getTypeElement(); assert oldType != null; oldType.replace(newType); } method.getParameterList().replace(parameterList); PsiCodeBlock methodBody = method.getBody(); if (methodBody != null) { for (PsiStatement element : methodBody.getStatements()) { element.delete(); } PsiStatement statement = PsiElementFactory.getInstance(project).createStatementFromText(call, methodBody); methodBody.add(statement); } }