void execute(@NotNull RefreshSessionImpl session) {
    ApplicationEx app;
    if (session.isAsynchronous()) {
      queueSession(session, session.getModality());
    }
    else if ((app = ApplicationManagerEx.getApplicationEx()).isWriteIntentLockAcquired()) {
      ((TransactionGuardImpl)TransactionGuard.getInstance()).assertWriteActionAllowed();
      var events = runRefreshSession(session, -1L);
      fireEvents(events, session);
    }
    else if (app.holdsReadLock() || EDT.isCurrentThreadEdt()) {
      LOG.error("Do not perform a synchronous refresh under read lock (causes deadlocks if there are events to fire)");
    }
    else {
      queueSession(session, session.getModality());
      session.waitFor();
    }
  }
void execute(@NotNull RefreshSessionImpl session)