diff --git a/src/main/java/io/reactivex/Flowable.java b/src/main/java/io/reactivex/Flowable.java index 42c2082b10..2e9e6c20ba 100644 --- a/src/main/java/io/reactivex/Flowable.java +++ b/src/main/java/io/reactivex/Flowable.java @@ -5842,15 +5842,16 @@ public final T blockingSingle(T defaultItem) { } /** - * Returns a {@link Future} representing the single value emitted by this {@code Flowable}. + * Returns a {@link Future} representing the only value emitted by this {@code Flowable}. + *

+ * *

* If the {@link Flowable} emits more than one item, {@link java.util.concurrent.Future} will receive an - * {@link java.lang.IllegalArgumentException}. If the {@link Flowable} is empty, {@link java.util.concurrent.Future} - * will receive a {@link java.util.NoSuchElementException}. + * {@link java.lang.IndexOutOfBoundsException}. If the {@link Flowable} is empty, {@link java.util.concurrent.Future} + * will receive a {@link java.util.NoSuchElementException}. The {@code Flowable} source has to terminate in order + * for the returned {@code Future} to terminate as well. *

* If the {@code Flowable} may emit more than one item, use {@code Flowable.toList().toFuture()}. - *

- * *

*
Backpressure:
*
The operator consumes the source {@code Flowable} in an unbounded manner diff --git a/src/main/java/io/reactivex/Observable.java b/src/main/java/io/reactivex/Observable.java index 541c15215c..4c11350715 100644 --- a/src/main/java/io/reactivex/Observable.java +++ b/src/main/java/io/reactivex/Observable.java @@ -5340,15 +5340,16 @@ public final T blockingSingle(T defaultItem) { } /** - * Returns a {@link Future} representing the single value emitted by this {@code Observable}. + * Returns a {@link Future} representing the only value emitted by this {@code Observable}. + *

+ * *

* If the {@link Observable} emits more than one item, {@link java.util.concurrent.Future} will receive an - * {@link java.lang.IllegalArgumentException}. If the {@link Observable} is empty, {@link java.util.concurrent.Future} - * will receive an {@link java.util.NoSuchElementException}. + * {@link java.lang.IndexOutOfBoundsException}. If the {@link Observable} is empty, {@link java.util.concurrent.Future} + * will receive an {@link java.util.NoSuchElementException}. The {@code Observable} source has to terminate in order + * for the returned {@code Future} to terminate as well. *

* If the {@code Observable} may emit more than one item, use {@code Observable.toList().toFuture()}. - *

- * *

*
Scheduler:
*
{@code toFuture} does not operate by default on a particular {@link Scheduler}.