Skip to content

Commit 5c0dec5

Browse files
committed
Remove exceptions from signatures
1 parent 68a14b9 commit 5c0dec5

12 files changed

+12
-48
lines changed

src/main/java/io/reactivex/Completable.java

+1-6
Original file line numberDiff line numberDiff line change
@@ -927,12 +927,7 @@ public final Completable andThen(CompletableSource next) {
927927
@CheckReturnValue
928928
@SchedulerSupport(SchedulerSupport.NONE)
929929
public final <R> R as(@NonNull CompletableConverter<? extends R> converter) {
930-
try {
931-
return ObjectHelper.requireNonNull(converter, "converter is null").apply(this);
932-
} catch (Throwable ex) {
933-
Exceptions.throwIfFatal(ex);
934-
throw ExceptionHelper.wrapOrThrow(ex);
935-
}
930+
return ObjectHelper.requireNonNull(converter, "converter is null").apply(this);
936931
}
937932

938933
/**

src/main/java/io/reactivex/CompletableConverter.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ public interface CompletableConverter<R> {
2929
*
3030
* @param upstream the upstream Completable instance
3131
* @return the converted value
32-
* @throws Exception on error
3332
*/
3433
@NonNull
35-
R apply(@NonNull Completable upstream) throws Exception;
34+
R apply(@NonNull Completable upstream);
3635
}

src/main/java/io/reactivex/Flowable.java

+1-6
Original file line numberDiff line numberDiff line change
@@ -5259,12 +5259,7 @@ public final Single<Boolean> any(Predicate<? super T> predicate) {
52595259
@BackpressureSupport(BackpressureKind.SPECIAL)
52605260
@SchedulerSupport(SchedulerSupport.NONE)
52615261
public final <R> R as(@NonNull FlowableConverter<T, ? extends R> converter) {
5262-
try {
5263-
return ObjectHelper.requireNonNull(converter, "converter is null").apply(this);
5264-
} catch (Throwable ex) {
5265-
Exceptions.throwIfFatal(ex);
5266-
throw ExceptionHelper.wrapOrThrow(ex);
5267-
}
5262+
return ObjectHelper.requireNonNull(converter, "converter is null").apply(this);
52685263
}
52695264

52705265
/**

src/main/java/io/reactivex/FlowableConverter.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ public interface FlowableConverter<T, R> {
3030
*
3131
* @param upstream the upstream Flowable instance
3232
* @return the converted value
33-
* @throws Exception on error
3433
*/
3534
@NonNull
36-
R apply(@NonNull Flowable<T> upstream) throws Exception;
35+
R apply(@NonNull Flowable<T> upstream);
3736
}

src/main/java/io/reactivex/Maybe.java

+1-6
Original file line numberDiff line numberDiff line change
@@ -2008,12 +2008,7 @@ public final Maybe<T> ambWith(MaybeSource<? extends T> other) {
20082008
@CheckReturnValue
20092009
@SchedulerSupport(SchedulerSupport.NONE)
20102010
public final <R> R as(@NonNull MaybeConverter<T, ? extends R> converter) {
2011-
try {
2012-
return ObjectHelper.requireNonNull(converter, "converter is null").apply(this);
2013-
} catch (Throwable ex) {
2014-
Exceptions.throwIfFatal(ex);
2015-
throw ExceptionHelper.wrapOrThrow(ex);
2016-
}
2011+
return ObjectHelper.requireNonNull(converter, "converter is null").apply(this);
20172012
}
20182013

20192014
/**

src/main/java/io/reactivex/MaybeConverter.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ public interface MaybeConverter<T, R> {
3030
*
3131
* @param upstream the upstream Maybe instance
3232
* @return the converted value
33-
* @throws Exception on error
3433
*/
3534
@NonNull
36-
R apply(@NonNull Maybe<T> upstream) throws Exception;
35+
R apply(@NonNull Maybe<T> upstream);
3736
}

src/main/java/io/reactivex/Observable.java

+1-6
Original file line numberDiff line numberDiff line change
@@ -4819,12 +4819,7 @@ public final Single<Boolean> any(Predicate<? super T> predicate) {
48194819
@CheckReturnValue
48204820
@SchedulerSupport(SchedulerSupport.NONE)
48214821
public final <R> R as(@NonNull ObservableConverter<T, ? extends R> converter) {
4822-
try {
4823-
return ObjectHelper.requireNonNull(converter, "converter is null").apply(this);
4824-
} catch (Throwable ex) {
4825-
Exceptions.throwIfFatal(ex);
4826-
throw ExceptionHelper.wrapOrThrow(ex);
4827-
}
4822+
return ObjectHelper.requireNonNull(converter, "converter is null").apply(this);
48284823
}
48294824

48304825
/**

src/main/java/io/reactivex/ObservableConverter.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ public interface ObservableConverter<T, R> {
3030
*
3131
* @param upstream the upstream Observable instance
3232
* @return the converted value
33-
* @throws Exception on error
3433
*/
3534
@NonNull
36-
R apply(@NonNull Observable<T> upstream) throws Exception;
35+
R apply(@NonNull Observable<T> upstream);
3736
}

src/main/java/io/reactivex/Single.java

+1-6
Original file line numberDiff line numberDiff line change
@@ -1541,12 +1541,7 @@ public final Single<T> ambWith(SingleSource<? extends T> other) {
15411541
@CheckReturnValue
15421542
@SchedulerSupport(SchedulerSupport.NONE)
15431543
public final <R> R as(@NonNull SingleConverter<T, ? extends R> converter) {
1544-
try {
1545-
return ObjectHelper.requireNonNull(converter, "converter is null").apply(this);
1546-
} catch (Throwable ex) {
1547-
Exceptions.throwIfFatal(ex);
1548-
throw ExceptionHelper.wrapOrThrow(ex);
1549-
}
1544+
return ObjectHelper.requireNonNull(converter, "converter is null").apply(this);
15501545
}
15511546

15521547
/**

src/main/java/io/reactivex/SingleConverter.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ public interface SingleConverter<T, R> {
3030
*
3131
* @param upstream the upstream Single instance
3232
* @return the converted value
33-
* @throws Exception on error
3433
*/
3534
@NonNull
36-
R apply(@NonNull Single<T> upstream) throws Exception;
35+
R apply(@NonNull Single<T> upstream);
3736
}

src/main/java/io/reactivex/parallel/ParallelFlowable.java

+1-6
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,7 @@ public static <T> ParallelFlowable<T> from(@NonNull Publisher<? extends T> sourc
137137
@CheckReturnValue
138138
@NonNull
139139
public final <R> R as(@NonNull ParallelFlowableConverter<T, R> converter) {
140-
try {
141-
return ObjectHelper.requireNonNull(converter, "converter is null").apply(this);
142-
} catch (Throwable ex) {
143-
Exceptions.throwIfFatal(ex);
144-
throw ExceptionHelper.wrapOrThrow(ex);
145-
}
140+
return ObjectHelper.requireNonNull(converter, "converter is null").apply(this);
146141
}
147142

148143
/**

src/main/java/io/reactivex/parallel/ParallelFlowableConverter.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ public interface ParallelFlowableConverter<T, R> {
3030
*
3131
* @param upstream the upstream ParallelFlowable instance
3232
* @return the converted value
33-
* @throws Exception on error
3433
*/
3534
@NonNull
36-
R apply(@NonNull ParallelFlowable<T> upstream) throws Exception;
35+
R apply(@NonNull ParallelFlowable<T> upstream);
3736
}

0 commit comments

Comments
 (0)