public static void withBatchUpdate(Runnable runnable, CompletionProcess process) {
    if (isInBatchUpdate.get().booleanValue() || !(process instanceof CompletionProgressIndicator)) {
      runnable.run();
      return;
    }

    try {
      isInBatchUpdate.set(Boolean.TRUE);
      runnable.run();
      ProgressManager.checkCanceled();
      CompletionProgressIndicator currentIndicator = (CompletionProgressIndicator)process;
      CompletionThreadingBase threading = Objects.requireNonNull(currentIndicator.getCompletionThreading());
      threading.flushBatchResult(currentIndicator);
    } finally {
      isInBatchUpdate.set(Boolean.FALSE);
    }
  }
public static void withBatchUpdate(Runnable runnable, CompletionProcess process)