Skip to content

Commit

Permalink
spliterator-bugfix: Spliterator fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Lavrukov authored and nvamelichev committed Mar 4, 2024
1 parent 7003407 commit c5d0adc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ private QueueValue<V> poll() {
@Override
// (stream thread) called from stream engine for get new value.
public boolean tryAdvance(Consumer<? super V> action) {
if (closed) {
throw new IllegalStateException("Can't use closed YdbSpliterator");
}

// Stream API can call tryAdvance() once again even if tryAdvance() returned false
if (endData) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ private QueueValue<V> poll() {
@Override
// (stream thread) called from stream engine for get new value.
public boolean tryAdvance(Consumer<? super V> action) {
if (closed) {
throw new IllegalStateException("Can't use closed YdbSpliterator");
}

// Stream API can call tryAdvance() once again even if tryAdvance() returned false
if (endData) {
return false;
Expand Down

0 comments on commit c5d0adc

Please sign in to comment.