2020import rx .Observer ;
2121import rx .Subscription ;
2222import rx .subscriptions .CompositeSubscription ;
23- import rx .subscriptions .MultipleAssignmentSubscription ;
23+ import rx .subscriptions .SerialSubscription ;
2424import rx .util .functions .Func1 ;
2525
2626/**
@@ -62,8 +62,7 @@ public Subscription onSubscribe(Observer<? super T> observer) {
6262 SafeObservableSubscription parent ;
6363 parent = new SafeObservableSubscription ();
6464
65- MultipleAssignmentSubscription child ;
66- child = new MultipleAssignmentSubscription ();
65+ SerialSubscription child = new SerialSubscription ();
6766
6867 parent .wrap (sequences .subscribe (new SwitchObserver <T >(observer , parent , child )));
6968
@@ -76,13 +75,13 @@ private static class SwitchObserver<T> implements Observer<Observable<? extends
7675 private final Object gate ;
7776 private final Observer <? super T > observer ;
7877 private final SafeObservableSubscription parent ;
79- private final MultipleAssignmentSubscription child ;
78+ private final SerialSubscription child ;
8079 private long latest ;
8180 private boolean stopped ;
8281 private boolean hasLatest ;
8382
8483 public SwitchObserver (Observer <? super T > observer , SafeObservableSubscription parent ,
85- MultipleAssignmentSubscription child ) {
84+ SerialSubscription child ) {
8685 this .observer = observer ;
8786 this .parent = parent ;
8887 this .child = child ;
0 commit comments