private boolean useCache() {
    if (!isPhysical()) return false;
    if (ApplicationManager.getApplication().isDispatchThread()) return false;
    return getUserData(PsiFileEx.BATCH_REFERENCE_PROCESSING) == Boolean.TRUE;
  }
private boolean useCache()