Skip to content

2.x: Cleanup test local variable names #5907

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/main/java/io/reactivex/Completable.java
Original file line number Diff line number Diff line change
Expand Up @@ -2286,9 +2286,9 @@ public final Completable unsubscribeOn(final Scheduler scheduler) {
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final TestObserver<Void> test() {
TestObserver<Void> ts = new TestObserver<Void>();
subscribe(ts);
return ts;
TestObserver<Void> to = new TestObserver<Void>();
subscribe(to);
return to;
}

/**
Expand All @@ -2305,12 +2305,12 @@ public final TestObserver<Void> test() {
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final TestObserver<Void> test(boolean cancelled) {
TestObserver<Void> ts = new TestObserver<Void>();
TestObserver<Void> to = new TestObserver<Void>();

if (cancelled) {
ts.cancel();
to.cancel();
}
subscribe(ts);
return ts;
subscribe(to);
return to;
}
}
14 changes: 7 additions & 7 deletions src/main/java/io/reactivex/Maybe.java
Original file line number Diff line number Diff line change
Expand Up @@ -4496,9 +4496,9 @@ public final <U, R> Maybe<R> zipWith(MaybeSource<? extends U> other, BiFunction<
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final TestObserver<T> test() {
TestObserver<T> ts = new TestObserver<T>();
subscribe(ts);
return ts;
TestObserver<T> to = new TestObserver<T>();
subscribe(to);
return to;
}

/**
Expand All @@ -4514,13 +4514,13 @@ public final TestObserver<T> test() {
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final TestObserver<T> test(boolean cancelled) {
TestObserver<T> ts = new TestObserver<T>();
TestObserver<T> to = new TestObserver<T>();

if (cancelled) {
ts.cancel();
to.cancel();
}

subscribe(ts);
return ts;
subscribe(to);
return to;
}
}
14 changes: 7 additions & 7 deletions src/main/java/io/reactivex/Observable.java
Original file line number Diff line number Diff line change
Expand Up @@ -15079,9 +15079,9 @@ public final <U, R> Observable<R> zipWith(ObservableSource<? extends U> other,
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final TestObserver<T> test() { // NoPMD
TestObserver<T> ts = new TestObserver<T>();
subscribe(ts);
return ts;
TestObserver<T> to = new TestObserver<T>();
subscribe(to);
return to;
}

/**
Expand All @@ -15099,11 +15099,11 @@ public final TestObserver<T> test() { // NoPMD
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final TestObserver<T> test(boolean dispose) { // NoPMD
TestObserver<T> ts = new TestObserver<T>();
TestObserver<T> to = new TestObserver<T>();
if (dispose) {
ts.dispose();
to.dispose();
}
subscribe(ts);
return ts;
subscribe(to);
return to;
}
}
14 changes: 7 additions & 7 deletions src/main/java/io/reactivex/Single.java
Original file line number Diff line number Diff line change
Expand Up @@ -3654,9 +3654,9 @@ public final <U, R> Single<R> zipWith(SingleSource<U> other, BiFunction<? super
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final TestObserver<T> test() {
TestObserver<T> ts = new TestObserver<T>();
subscribe(ts);
return ts;
TestObserver<T> to = new TestObserver<T>();
subscribe(to);
return to;
}

/**
Expand All @@ -3673,14 +3673,14 @@ public final TestObserver<T> test() {
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final TestObserver<T> test(boolean cancelled) {
TestObserver<T> ts = new TestObserver<T>();
TestObserver<T> to = new TestObserver<T>();

if (cancelled) {
ts.cancel();
to.cancel();
}

subscribe(ts);
return ts;
subscribe(to);
return to;
}

private static <T> Single<T> toSingle(Flowable<T> source) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ public static <U, R> Flowable<R> multicastSelector(
* Child Subscribers will observe the events of the ConnectableObservable on the
* specified scheduler.
* @param <T> the value type
* @param co the ConnectableFlowable to wrap
* @param cf the ConnectableFlowable to wrap
* @param scheduler the target scheduler
* @return the new ConnectableObservable instance
*/
public static <T> ConnectableFlowable<T> observeOn(final ConnectableFlowable<T> co, final Scheduler scheduler) {
final Flowable<T> observable = co.observeOn(scheduler);
return RxJavaPlugins.onAssembly(new ConnectableFlowableReplay<T>(co, observable));
public static <T> ConnectableFlowable<T> observeOn(final ConnectableFlowable<T> cf, final Scheduler scheduler) {
final Flowable<T> observable = cf.observeOn(scheduler);
return RxJavaPlugins.onAssembly(new ConnectableFlowableReplay<T>(cf, observable));
}

/**
Expand Down Expand Up @@ -1100,9 +1100,9 @@ static final class MulticastFlowable<R, U> extends Flowable<R> {

@Override
protected void subscribeActual(Subscriber<? super R> child) {
ConnectableFlowable<U> co;
ConnectableFlowable<U> cf;
try {
co = ObjectHelper.requireNonNull(connectableFactory.call(), "The connectableFactory returned null");
cf = ObjectHelper.requireNonNull(connectableFactory.call(), "The connectableFactory returned null");
} catch (Throwable e) {
Exceptions.throwIfFatal(e);
EmptySubscription.error(e, child);
Expand All @@ -1111,7 +1111,7 @@ protected void subscribeActual(Subscriber<? super R> child) {

Publisher<R> observable;
try {
observable = ObjectHelper.requireNonNull(selector.apply(co), "The selector returned a null Publisher");
observable = ObjectHelper.requireNonNull(selector.apply(cf), "The selector returned a null Publisher");
} catch (Throwable e) {
Exceptions.throwIfFatal(e);
EmptySubscription.error(e, child);
Expand All @@ -1122,7 +1122,7 @@ protected void subscribeActual(Subscriber<? super R> child) {

observable.subscribe(srw);

co.connect(new DisposableConsumer(srw));
cf.connect(new DisposableConsumer(srw));
}

final class DisposableConsumer implements Consumer<Disposable> {
Expand All @@ -1140,17 +1140,17 @@ public void accept(Disposable r) {
}

static final class ConnectableFlowableReplay<T> extends ConnectableFlowable<T> {
private final ConnectableFlowable<T> co;
private final ConnectableFlowable<T> cf;
private final Flowable<T> observable;

ConnectableFlowableReplay(ConnectableFlowable<T> co, Flowable<T> observable) {
this.co = co;
ConnectableFlowableReplay(ConnectableFlowable<T> cf, Flowable<T> observable) {
this.cf = cf;
this.observable = observable;
}

@Override
public void connect(Consumer<? super Disposable> connection) {
co.connect(connection);
cf.connect(connection);
}

@Override
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/io/reactivex/observers/TestObserver.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
import io.reactivex.disposables.Disposable;
import io.reactivex.functions.Consumer;
import io.reactivex.internal.disposables.DisposableHelper;
import io.reactivex.internal.fuseable.QueueDisposable;
import io.reactivex.internal.util.*;
import io.reactivex.internal.fuseable.*;
import io.reactivex.internal.util.ExceptionHelper;

/**
* An Observer that records events and allows making assertions about them.
Expand Down Expand Up @@ -309,9 +309,9 @@ final TestObserver<T> assertFusionMode(int mode) {

static String fusionModeToString(int mode) {
switch (mode) {
case QueueDisposable.NONE : return "NONE";
case QueueDisposable.SYNC : return "SYNC";
case QueueDisposable.ASYNC : return "ASYNC";
case QueueFuseable.NONE : return "NONE";
case QueueFuseable.SYNC : return "SYNC";
case QueueFuseable.ASYNC : return "ASYNC";
default: return "Unknown(" + mode + ")";
}
}
Expand Down
Loading