private static int addNumberOfRequestedRedetects(@NotNull Document document, int delta) {
    AtomicInteger oldData = document.getUserData(RUNNING_REDETECTS_KEY);
    if (oldData == null) {
      oldData = ((UserDataHolderEx)document).putUserDataIfAbsent(RUNNING_REDETECTS_KEY, new AtomicInteger());
    }
    return oldData.addAndGet(delta);
  }
private static int addNumberOfRequestedRedetects(@NotNull Document document, int delta)