diff --git a/rxjava-core/src/main/java/rx/Observable.java b/rxjava-core/src/main/java/rx/Observable.java index dad2ca7286..667ab7181f 100644 --- a/rxjava-core/src/main/java/rx/Observable.java +++ b/rxjava-core/src/main/java/rx/Observable.java @@ -127,7 +127,7 @@ public static interface OnSubscribeFunc extends Function { /** * Observable with Function to execute when subscribed to. *

- * NOTE: Use {@link #create(Func1)} to create an Observable instead of this method unless you + * NOTE: Use {@link #create(OnSubscribeFunc)} to create an Observable instead of this constructor unless you * specifically have a need for inheritance. * * @param onSubscribe @@ -783,29 +783,28 @@ public static Observable never() { * the source Observable that emits Observables * @return an Observable that emits only the items emitted by the most recently published * Observable + * @deprecated Being renamed to {@link #switchOnNext} */ + @Deprecated public static Observable switchDo(Observable> sequenceOfSequences) { - // TODO should this static remain? I have left it because it is an Observable return create(OperationSwitch.switchDo(sequenceOfSequences)); } /** - * On an Observable that emits Observables, creates a single Observable that + * Given an Observable that emits Observables, creates a single Observable that * emits the items emitted by the most recently published of those Observables. *

* * + * @param sequenceOfSequences + * the source Observable that emits Observables * @return an Observable that emits only the items emitted by the most recently published * Observable - * @throws ClassCastException - * if sequence not of type {@code Observable} */ - @SuppressWarnings("unchecked") - public Observable switchDo() { - // TODO can we come up with a better name than this? It should be 'switch' but that is reserved. - // Perhaps 'switchOnNext'? - return create(OperationSwitch.switchDo((Observable>) this)); + public static Observable switchOnNext(Observable> sequenceOfSequences) { + return create(OperationSwitch.switchDo(sequenceOfSequences)); } + /** * Accepts an Observable and wraps it in another Observable that ensures that the resulting diff --git a/rxjava-core/src/main/java/rx/observables/BlockingObservable.java b/rxjava-core/src/main/java/rx/observables/BlockingObservable.java index 419a7e0c9d..aaf5b2adf8 100644 --- a/rxjava-core/src/main/java/rx/observables/BlockingObservable.java +++ b/rxjava-core/src/main/java/rx/observables/BlockingObservable.java @@ -109,7 +109,7 @@ private Subscription protectivelyWrapAndSubscribe(Observer observer) *

* NOTE: This will block even if the Observable is asynchronous. *

- * This is similar to {@link #subscribe(Observer)}, but it blocks. Because it blocks it does + * This is similar to {@link Observable#subscribe(Observer)}, but it blocks. Because it blocks it does * not need the {@link Observer#onCompleted()} or {@link Observer#onError(Throwable)} methods. *

*