From 54c281a3d106da4f3bcf2f59271b1c9034683a60 Mon Sep 17 00:00:00 2001 From: Roman Wuattier Date: Tue, 3 Apr 2018 11:09:37 +0200 Subject: [PATCH] Fix Observable javadoc (#5944) (#5948) * Replace `doOnCancel` by `doOnDispose` --- src/main/java/io/reactivex/Observable.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/io/reactivex/Observable.java b/src/main/java/io/reactivex/Observable.java index 4a7db80741..bbc57d1d08 100644 --- a/src/main/java/io/reactivex/Observable.java +++ b/src/main/java/io/reactivex/Observable.java @@ -1736,8 +1736,8 @@ public static Observable fromCallable(Callable supplier) { *

* Important note: This ObservableSource is blocking; you cannot dispose it. *

- * Unlike 1.x, cancelling the Observable won't cancel the future. If necessary, one can use composition to achieve the - * cancellation effect: {@code futureObservableSource.doOnCancel(() -> future.cancel(true));}. + * Unlike 1.x, disposing the Observable won't cancel the future. If necessary, one can use composition to achieve the + * cancellation effect: {@code futureObservableSource.doOnDispose(() -> future.cancel(true));}. *

*
Scheduler:
*
{@code fromFuture} does not operate by default on a particular {@link Scheduler}.
@@ -1767,8 +1767,8 @@ public static Observable fromFuture(Future future) { * return value of the {@link Future#get} method of that object, by passing the object into the {@code from} * method. *

- * Unlike 1.x, cancelling the Observable won't cancel the future. If necessary, one can use composition to achieve the - * cancellation effect: {@code futureObservableSource.doOnCancel(() -> future.cancel(true));}. + * Unlike 1.x, disposing the Observable won't cancel the future. If necessary, one can use composition to achieve the + * cancellation effect: {@code futureObservableSource.doOnDispose(() -> future.cancel(true));}. *

* Important note: This ObservableSource is blocking; you cannot dispose it. *

@@ -1805,8 +1805,8 @@ public static Observable fromFuture(Future future, long time * return value of the {@link Future#get} method of that object, by passing the object into the {@code from} * method. *

- * Unlike 1.x, cancelling the Observable won't cancel the future. If necessary, one can use composition to achieve the - * cancellation effect: {@code futureObservableSource.doOnCancel(() -> future.cancel(true));}. + * Unlike 1.x, disposing the Observable won't cancel the future. If necessary, one can use composition to achieve the + * cancellation effect: {@code futureObservableSource.doOnDispose(() -> future.cancel(true));}. *

* Important note: This ObservableSource is blocking; you cannot dispose it. *

@@ -1846,8 +1846,8 @@ public static Observable fromFuture(Future future, long time * return value of the {@link Future#get} method of that object, by passing the object into the {@code from} * method. *

- * Unlike 1.x, cancelling the Observable won't cancel the future. If necessary, one can use composition to achieve the - * cancellation effect: {@code futureObservableSource.doOnCancel(() -> future.cancel(true));}. + * Unlike 1.x, disposing the Observable won't cancel the future. If necessary, one can use composition to achieve the + * cancellation effect: {@code futureObservableSource.doOnDispose(() -> future.cancel(true));}. *

*
Scheduler:
*
You specify which {@link Scheduler} this operator will use.
@@ -7497,7 +7497,7 @@ public final Observable delaySubscription(long delay, TimeUnit unit, Schedule * returned Observable cancels the flow and terminates with that type of terminal event: *

      * Observable.just(createOnNext(1), createOnComplete(), createOnNext(2))
-     * .doOnCancel(() -> System.out.println("Cancelled!"));
+     * .doOnDispose(() -> System.out.println("Cancelled!"));
      * .test()
      * .assertResult(1);
      *