Skip to content

Commit

Permalink
Remove exceptions from signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
ZacSweers committed Nov 17, 2017
1 parent 68a14b9 commit 5c0dec5
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 48 deletions.
7 changes: 1 addition & 6 deletions src/main/java/io/reactivex/Completable.java
Original file line number Diff line number Diff line change
Expand Up @@ -927,12 +927,7 @@ public final Completable andThen(CompletableSource next) {
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final <R> R as(@NonNull CompletableConverter<? extends R> converter) {
try {
return ObjectHelper.requireNonNull(converter, "converter is null").apply(this);
} catch (Throwable ex) {
Exceptions.throwIfFatal(ex);
throw ExceptionHelper.wrapOrThrow(ex);
}
return ObjectHelper.requireNonNull(converter, "converter is null").apply(this);
}

/**
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/io/reactivex/CompletableConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ public interface CompletableConverter<R> {
*
* @param upstream the upstream Completable instance
* @return the converted value
* @throws Exception on error
*/
@NonNull
R apply(@NonNull Completable upstream) throws Exception;
R apply(@NonNull Completable upstream);
}
7 changes: 1 addition & 6 deletions src/main/java/io/reactivex/Flowable.java
Original file line number Diff line number Diff line change
Expand Up @@ -5259,12 +5259,7 @@ public final Single<Boolean> any(Predicate<? super T> predicate) {
@BackpressureSupport(BackpressureKind.SPECIAL)
@SchedulerSupport(SchedulerSupport.NONE)
public final <R> R as(@NonNull FlowableConverter<T, ? extends R> converter) {
try {
return ObjectHelper.requireNonNull(converter, "converter is null").apply(this);
} catch (Throwable ex) {
Exceptions.throwIfFatal(ex);
throw ExceptionHelper.wrapOrThrow(ex);
}
return ObjectHelper.requireNonNull(converter, "converter is null").apply(this);
}

/**
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/io/reactivex/FlowableConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ public interface FlowableConverter<T, R> {
*
* @param upstream the upstream Flowable instance
* @return the converted value
* @throws Exception on error
*/
@NonNull
R apply(@NonNull Flowable<T> upstream) throws Exception;
R apply(@NonNull Flowable<T> upstream);
}
7 changes: 1 addition & 6 deletions src/main/java/io/reactivex/Maybe.java
Original file line number Diff line number Diff line change
Expand Up @@ -2008,12 +2008,7 @@ public final Maybe<T> ambWith(MaybeSource<? extends T> other) {
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final <R> R as(@NonNull MaybeConverter<T, ? extends R> converter) {
try {
return ObjectHelper.requireNonNull(converter, "converter is null").apply(this);
} catch (Throwable ex) {
Exceptions.throwIfFatal(ex);
throw ExceptionHelper.wrapOrThrow(ex);
}
return ObjectHelper.requireNonNull(converter, "converter is null").apply(this);
}

/**
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/io/reactivex/MaybeConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ public interface MaybeConverter<T, R> {
*
* @param upstream the upstream Maybe instance
* @return the converted value
* @throws Exception on error
*/
@NonNull
R apply(@NonNull Maybe<T> upstream) throws Exception;
R apply(@NonNull Maybe<T> upstream);
}
7 changes: 1 addition & 6 deletions src/main/java/io/reactivex/Observable.java
Original file line number Diff line number Diff line change
Expand Up @@ -4819,12 +4819,7 @@ public final Single<Boolean> any(Predicate<? super T> predicate) {
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final <R> R as(@NonNull ObservableConverter<T, ? extends R> converter) {
try {
return ObjectHelper.requireNonNull(converter, "converter is null").apply(this);
} catch (Throwable ex) {
Exceptions.throwIfFatal(ex);
throw ExceptionHelper.wrapOrThrow(ex);
}
return ObjectHelper.requireNonNull(converter, "converter is null").apply(this);
}

/**
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/io/reactivex/ObservableConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ public interface ObservableConverter<T, R> {
*
* @param upstream the upstream Observable instance
* @return the converted value
* @throws Exception on error
*/
@NonNull
R apply(@NonNull Observable<T> upstream) throws Exception;
R apply(@NonNull Observable<T> upstream);
}
7 changes: 1 addition & 6 deletions src/main/java/io/reactivex/Single.java
Original file line number Diff line number Diff line change
Expand Up @@ -1541,12 +1541,7 @@ public final Single<T> ambWith(SingleSource<? extends T> other) {
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final <R> R as(@NonNull SingleConverter<T, ? extends R> converter) {
try {
return ObjectHelper.requireNonNull(converter, "converter is null").apply(this);
} catch (Throwable ex) {
Exceptions.throwIfFatal(ex);
throw ExceptionHelper.wrapOrThrow(ex);
}
return ObjectHelper.requireNonNull(converter, "converter is null").apply(this);
}

/**
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/io/reactivex/SingleConverter.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ public interface SingleConverter<T, R> {
*
* @param upstream the upstream Single instance
* @return the converted value
* @throws Exception on error
*/
@NonNull
R apply(@NonNull Single<T> upstream) throws Exception;
R apply(@NonNull Single<T> upstream);
}
7 changes: 1 addition & 6 deletions src/main/java/io/reactivex/parallel/ParallelFlowable.java
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,7 @@ public static <T> ParallelFlowable<T> from(@NonNull Publisher<? extends T> sourc
@CheckReturnValue
@NonNull
public final <R> R as(@NonNull ParallelFlowableConverter<T, R> converter) {
try {
return ObjectHelper.requireNonNull(converter, "converter is null").apply(this);
} catch (Throwable ex) {
Exceptions.throwIfFatal(ex);
throw ExceptionHelper.wrapOrThrow(ex);
}
return ObjectHelper.requireNonNull(converter, "converter is null").apply(this);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ public interface ParallelFlowableConverter<T, R> {
*
* @param upstream the upstream ParallelFlowable instance
* @return the converted value
* @throws Exception on error
*/
@NonNull
R apply(@NonNull ParallelFlowable<T> upstream) throws Exception;
R apply(@NonNull ParallelFlowable<T> upstream);
}

0 comments on commit 5c0dec5

Please sign in to comment.