protected void processActions(final boolean allowReplacement) throws IncorrectOperationException {
    WriteCommandAction.writeCommandAction(file.getProject()).withName(CopyrightBundle.message("command.name.update.copyright")).run(() -> {
      Document doc = FileDocumentManager.getInstance().getDocument(getRoot());
      if (doc != null) {
        PsiDocumentManager.getInstance(file.getProject()).doPostponedOperationsAndUnblockDocument(doc);
        for (CommentAction action : actions) {
          int start = action.getStart();
          int end = action.getEnd();

          switch (action.getType()) {
            case CommentAction.ACTION_INSERT -> {
              String comment = getCommentText(action.getPrefix(), action.getSuffix());
              if (!comment.isEmpty()) {
                doc.insertString(start, comment);
              }
            }
            case CommentAction.ACTION_REPLACE -> {
              if (allowReplacement) {
                String oldComment = doc.getText(new TextRange(start, end));
                doc.replaceString(start, end, getCommentText("", "", oldComment));
              }
            }
            case CommentAction.ACTION_DELETE -> {
              if (allowReplacement) doc.deleteString(start, end);
            }
          }
        }
        PsiDocumentManager.getInstance(file.getProject()).commitDocument(doc);
      }
    });
  }
protected void processActions(final boolean allowReplacement)