void (@NotNull Project project, @NotNull PsiElement element, @NotNull ModPsiUpdater updater) { final PsiElement docComment = element.getParent(); final StringBuilder newCommentText = new StringBuilder(); for (PsiElement child = docComment.getFirstChild(); child != null; child = child.getNextSibling()) { if (child instanceof PsiDocToken docToken) { final IElementType tokenType = docToken.getTokenType(); if (JavaDocTokenType.DOC_COMMENT_START.equals(tokenType)) { newCommentText.append("/*"); } else if (!JavaDocTokenType.DOC_COMMENT_LEADING_ASTERISKS.equals(tokenType)) { newCommentText.append(child.getText()); } } else { newCommentText.append(child.getText()); } } final PsiElementFactory factory = JavaPsiFacade.getElementFactory(project); final PsiComment newComment = factory.createCommentFromText(newCommentText.toString(), element); docComment.replace(newComment); }