core/src/main/java/com/orientechnologies/orient/core/index/OIndexChangesWrapper.java
@Override
  public Set<Object> toKeys() {
    if (source.isRebuilding())
      throwRebuildException();

    final Set<Object> keys = delegate.toKeys();

    if (source.getRebuildVersion() != indexRebuildVersion)
      throwRebuildException();

    return keys;
  }
@Override
  public Set<Object> toKeys() {
    if (source.isRebuilding())
      throwRebuildException();

    final Set<Object> keys = delegate.toKeys();

    if (source.getRebuildVersion() != indexRebuildVersion)
      throwRebuildException();

    return keys;
  }
{@inheritDoc}