private int doEnumerate(Data value, boolean onlyCheckForExisting, boolean saveNewValue) throws IOException {
    if (myDoCaching && !saveNewValue) {
      int cachedId = PersistentEnumeratorCache.getCachedId(value, this);
      if (cachedId != NULL_ID) return cachedId;
    }

    int id = catchCorruption(() -> {
      return enumerateImpl(value, onlyCheckForExisting, saveNewValue);
    });

    if (myDoCaching && id != NULL_ID) {
      PersistentEnumeratorCache.cacheId(value, id, this);
    }

    return id;
  }
private int doEnumerate(Data value, boolean onlyCheckForExisting, boolean saveNewValue)