Skip to content

Commit fbbae6c

Browse files
authored
2.x: Fix toFlowable marbles and descriptions (#6200)
* 2.x: Fix toFlowable marbles and descriptions * Adjust wording
1 parent e0532b7 commit fbbae6c

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

Diff for: src/main/java/io/reactivex/Flowable.java

+6-5
Original file line numberDiff line numberDiff line change
@@ -5842,15 +5842,16 @@ public final T blockingSingle(T defaultItem) {
58425842
}
58435843

58445844
/**
5845-
* Returns a {@link Future} representing the single value emitted by this {@code Flowable}.
5845+
* Returns a {@link Future} representing the only value emitted by this {@code Flowable}.
5846+
* <p>
5847+
* <img width="640" height="324" src="https://github.com/ReactiveX/RxJava/wiki/images/rx-operators/Flowable.toFuture.png" alt="">
58465848
* <p>
58475849
* If the {@link Flowable} emits more than one item, {@link java.util.concurrent.Future} will receive an
5848-
* {@link java.lang.IllegalArgumentException}. If the {@link Flowable} is empty, {@link java.util.concurrent.Future}
5849-
* will receive a {@link java.util.NoSuchElementException}.
5850+
* {@link java.lang.IndexOutOfBoundsException}. If the {@link Flowable} is empty, {@link java.util.concurrent.Future}
5851+
* will receive a {@link java.util.NoSuchElementException}. The {@code Flowable} source has to terminate in order
5852+
* for the returned {@code Future} to terminate as well.
58505853
* <p>
58515854
* If the {@code Flowable} may emit more than one item, use {@code Flowable.toList().toFuture()}.
5852-
* <p>
5853-
* <img width="640" height="395" src="https://github.com/ReactiveX/RxJava/wiki/images/rx-operators/B.toFuture.png" alt="">
58545855
* <dl>
58555856
* <dt><b>Backpressure:</b></dt>
58565857
* <dd>The operator consumes the source {@code Flowable} in an unbounded manner

Diff for: src/main/java/io/reactivex/Observable.java

+6-5
Original file line numberDiff line numberDiff line change
@@ -5340,15 +5340,16 @@ public final T blockingSingle(T defaultItem) {
53405340
}
53415341

53425342
/**
5343-
* Returns a {@link Future} representing the single value emitted by this {@code Observable}.
5343+
* Returns a {@link Future} representing the only value emitted by this {@code Observable}.
5344+
* <p>
5345+
* <img width="640" height="312" src="https://github.com/ReactiveX/RxJava/wiki/images/rx-operators/toFuture.o.png" alt="">
53445346
* <p>
53455347
* If the {@link Observable} emits more than one item, {@link java.util.concurrent.Future} will receive an
5346-
* {@link java.lang.IllegalArgumentException}. If the {@link Observable} is empty, {@link java.util.concurrent.Future}
5347-
* will receive an {@link java.util.NoSuchElementException}.
5348+
* {@link java.lang.IndexOutOfBoundsException}. If the {@link Observable} is empty, {@link java.util.concurrent.Future}
5349+
* will receive an {@link java.util.NoSuchElementException}. The {@code Observable} source has to terminate in order
5350+
* for the returned {@code Future} to terminate as well.
53485351
* <p>
53495352
* If the {@code Observable} may emit more than one item, use {@code Observable.toList().toFuture()}.
5350-
* <p>
5351-
* <img width="640" height="389" src="https://github.com/ReactiveX/RxJava/wiki/images/rx-operators/toFuture.o.png" alt="">
53525353
* <dl>
53535354
* <dt><b>Scheduler:</b></dt>
53545355
* <dd>{@code toFuture} does not operate by default on a particular {@link Scheduler}.</dd>

0 commit comments

Comments
 (0)