static void clearStaleIndexes(@NotNull IntSet staleIds) {
    IS_IN_STALE_IDS_DELETION.set(Boolean.TRUE);
    boolean unitTest = ApplicationManager.getApplication().isUnitTestMode();
    try {
      ProgressManager.getInstance().executeNonCancelableSection(() -> {
        final int maxLogCount = (unitTest || FileBasedIndexEx.TRACE_STUB_INDEX_UPDATES || LOG.isDebugEnabled()) ? Integer.MAX_VALUE : 10;
        int loggedCount = 0;
        for (int staleId : staleIds) {
          if (loggedCount < maxLogCount) {
            LOG.info("clearing stale id = " + staleId + ", path =  " + getRecordPath(staleId));
          }
          else if (loggedCount == maxLogCount) {
            LOG.info(
              "clearing more items (not logged due to logging limit). Use -Didea.trace.stub.index.update=true, " +
              "or enable debug log for: #" + StaleIndexesChecker.class.getName()
            );
          }
          loggedCount++;
          clearStaleIndexesForId(staleId);
        }
      });
    }
    finally {
      IS_IN_STALE_IDS_DELETION.remove();
    }
  }
static void clearStaleIndexes(@NotNull IntSet staleIds)