private int locate(int valueHC, boolean split) throws IOException {
      int searched = 0;
      int parentAddress = 0;
      final int maxHeight = height + 1;

      while (true) {
        if (isFull()) {
          if (split) {
            parentAddress = splitNode(parentAddress);
            if (parentAddress != 0) setAddress(parentAddress);
            --searched;
          }
          else {
            myHasFullPagesAlongPath = true;
          }
        }

        int i = search(valueHC);

        ++searched;
        if (searched > maxHeight) throw new CorruptedException(storage.getPagedFileStorage().getFile());

        if (isIndexLeaf()) {
          height = Math.max(height, searched);
          return i;
        }

        int address = i < 0 ? addressAt(-i - 1) : addressAt(i + 1);
        parentAddress = this.address;
        setAddress(-address);
      }
    }
private int locate(int valueHC, boolean split)