Skip to content

Commit

Permalink
2.x: remove variance from the input source of retryWhen (#4720)
Browse files Browse the repository at this point in the history
  • Loading branch information
akarnokd authored Oct 17, 2016
1 parent 57fde55 commit 19d83c1
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/main/java/io/reactivex/Completable.java
Original file line number Diff line number Diff line change
Expand Up @@ -1415,7 +1415,7 @@ public final Completable retry(Predicate<? super Throwable> predicate) {
* @throws NullPointerException if handler is null
*/
@SchedulerSupport(SchedulerSupport.NONE)
public final Completable retryWhen(Function<? super Flowable<? extends Throwable>, ? extends Publisher<Object>> handler) {
public final Completable retryWhen(Function<? super Flowable<Throwable>, ? extends Publisher<Object>> handler) {
return fromPublisher(toFlowable().retryWhen(handler));
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/reactivex/Flowable.java
Original file line number Diff line number Diff line change
Expand Up @@ -11105,7 +11105,7 @@ public final Flowable<T> retryUntil(final BooleanSupplier stop) {
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
public final Flowable<T> retryWhen(
final Function<? super Flowable<? extends Throwable>, ? extends Publisher<?>> handler) {
final Function<? super Flowable<Throwable>, ? extends Publisher<?>> handler) {
ObjectHelper.requireNonNull(handler, "handler is null");

return RxJavaPlugins.onAssembly(new FlowableRetryWhen<T>(this, handler));
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/reactivex/Maybe.java
Original file line number Diff line number Diff line change
Expand Up @@ -3390,7 +3390,7 @@ public final Maybe<T> retryUntil(final BooleanSupplier stop) {
*/
@SchedulerSupport(SchedulerSupport.NONE)
public final Maybe<T> retryWhen(
final Function<? super Flowable<? extends Throwable>, ? extends Publisher<?>> handler) {
final Function<? super Flowable<Throwable>, ? extends Publisher<?>> handler) {
return toFlowable().retryWhen(handler).singleElement();
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/reactivex/Observable.java
Original file line number Diff line number Diff line change
Expand Up @@ -9196,7 +9196,7 @@ public final Observable<T> retryUntil(final BooleanSupplier stop) {
*/
@SchedulerSupport(SchedulerSupport.NONE)
public final Observable<T> retryWhen(
final Function<? super Observable<? extends Throwable>, ? extends ObservableSource<?>> handler) {
final Function<? super Observable<Throwable>, ? extends ObservableSource<?>> handler) {
ObjectHelper.requireNonNull(handler, "handler is null");
return RxJavaPlugins.onAssembly(new ObservableRedo<T>(this, ObservableInternalHelper.retryWhenHandler(handler)));
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/reactivex/Single.java
Original file line number Diff line number Diff line change
Expand Up @@ -2396,7 +2396,7 @@ public final Single<T> retry(Predicate<? super Throwable> predicate) {
* @return the new Single instance
*/
@SchedulerSupport(SchedulerSupport.NONE)
public final Single<T> retryWhen(Function<? super Flowable<? extends Throwable>, ? extends Publisher<Object>> handler) {
public final Single<T> retryWhen(Function<? super Flowable<Throwable>, ? extends Publisher<Object>> handler) {
return toSingle(toFlowable().retryWhen(handler));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,10 @@ public boolean test(Notification<Object> t) throws Exception {

static final class RetryWhenInner
implements Function<Observable<Notification<Object>>, ObservableSource<?>> {
private final Function<? super Observable<? extends Throwable>, ? extends ObservableSource<?>> handler;
private final Function<? super Observable<Throwable>, ? extends ObservableSource<?>> handler;

RetryWhenInner(
Function<? super Observable<? extends Throwable>, ? extends ObservableSource<?>> handler) {
Function<? super Observable<Throwable>, ? extends ObservableSource<?>> handler) {
this.handler = handler;
}

Expand All @@ -293,7 +293,7 @@ public ObservableSource<?> apply(Observable<Notification<Object>> no) throws Exc
}
}

public static <T> Function<Observable<Notification<Object>>, ObservableSource<?>> retryWhenHandler(final Function<? super Observable<? extends Throwable>, ? extends ObservableSource<?>> handler) {
public static <T> Function<Observable<Notification<Object>>, ObservableSource<?>> retryWhenHandler(final Function<? super Observable<Throwable>, ? extends ObservableSource<?>> handler) {
return new RetryWhenInner(handler);
}

Expand Down

0 comments on commit 19d83c1

Please sign in to comment.