void (@NotNull PsiMethod source, @NotNull PsiMethod target, @NotNull JVMElementFactory factory) { final PsiElement navigationElement = source.getNavigationElement(); if (navigationElement instanceof PsiDocCommentOwner) { final PsiDocComment docComment = ((PsiDocCommentOwner)navigationElement).getDocComment(); if (docComment != null) { target.addAfter(factory.createDocCommentFromText(docComment.getText()), null); } } final PsiParameter[] sourceParameters = source.getParameterList().getParameters(); final PsiParameterList targetParameterList = target.getParameterList(); CommonJavaRefactoringUtil.fixJavadocsForParams(target, Set.of(targetParameterList.getParameters()), pair -> { final int parameterIndex = targetParameterList.getParameterIndex(pair.first); if (parameterIndex >= 0 && parameterIndex < sourceParameters.length) { return Comparing.strEqual(pair.second, sourceParameters[parameterIndex].getName()); } return false; }); }