private @NotNull StubBase<?> instantiateStub(int index) {
    LazyStubData data = myData;
    if (data == null) {
      StubBase<?> stub = getCachedStub(index);
      if (stub != null) return stub;

      throw new IllegalStateException("Not all (" + mySize + ") stubs are instantiated (" + myInstantiated + "), but data for them is missing");
    }

    try {
      StubBase<?> parent = get(data.getParentIndex(index));
      StubBase<?> stub = data.deserializeStub(index, parent, getStubType(index));
      stub.id = index;
      return stub;
    }
    catch (ProcessCanceledException e) {
      throw e;
    }
    catch (Exception | Error e) {
      throw new RuntimeException(StubSerializationUtil.brokenStubFormat(myRootSerializer), e);
    }
  }
private @NotNull StubBase<?> instantiateStub(int index)