@@ -127,7 +127,7 @@ public static interface OnSubscribeFunc<T> extends Function {
127127 /**
128128 * Observable with Function to execute when subscribed to.
129129 * <p>
130- * NOTE: Use {@link #create(Func1 )} to create an Observable instead of this method unless you
130+ * NOTE: Use {@link #create(OnSubscribeFunc )} to create an Observable instead of this constructor unless you
131131 * specifically have a need for inheritance.
132132 *
133133 * @param onSubscribe
@@ -783,29 +783,28 @@ public static <T> Observable<T> never() {
783783 * the source Observable that emits Observables
784784 * @return an Observable that emits only the items emitted by the most recently published
785785 * Observable
786+ * @deprecated Being renamed to {@link #switchOnNext}
786787 */
788+ @ Deprecated
787789 public static <T > Observable <T > switchDo (Observable <? extends Observable <? extends T >> sequenceOfSequences ) {
788- // TODO should this static remain? I have left it because it is an Observable<Observable>
789790 return create (OperationSwitch .switchDo (sequenceOfSequences ));
790791 }
791792
792793 /**
793- * On an Observable that emits Observables, creates a single Observable that
794+ * Given an Observable that emits Observables, creates a single Observable that
794795 * emits the items emitted by the most recently published of those Observables.
795796 * <p>
796797 * <img width="640" src="https://github.com/Netflix/RxJava/wiki/images/rx-operators/switchDo.png">
797798 *
799+ * @param sequenceOfSequences
800+ * the source Observable that emits Observables
798801 * @return an Observable that emits only the items emitted by the most recently published
799802 * Observable
800- * @throws ClassCastException
801- * if sequence not of type {@code Observable<Observable<T>}
802803 */
803- @ SuppressWarnings ("unchecked" )
804- public Observable <T > switchDo () {
805- // TODO can we come up with a better name than this? It should be 'switch' but that is reserved.
806- // Perhaps 'switchOnNext'?
807- return create (OperationSwitch .switchDo ((Observable <? extends Observable <? extends T >>) this ));
804+ public static <T > Observable <T > switchOnNext (Observable <? extends Observable <? extends T >> sequenceOfSequences ) {
805+ return create (OperationSwitch .switchDo (sequenceOfSequences ));
808806 }
807+
809808
810809 /**
811810 * Accepts an Observable and wraps it in another Observable that ensures that the resulting
0 commit comments