Skip to content

Commit 9ebf221

Browse files
authored
Remove @NonNull annotation from Collector container type parameter. (#7590)
`collect` delegates to `FlowableCollectWithCollectorSingle`, which does is not annotated to require a non-nullable type for its corresponding type parameter and whose implementation works fine with a null container. This PR lets Kotlin code pass a `Collector<T, A, R>`, where `A` is declared as `<A: Any?>`.
1 parent 9975460 commit 9ebf221

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -20394,7 +20394,7 @@ public final TestSubscriber<T> test(long initialRequest, boolean cancel) { // No
2039420394
@BackpressureSupport(BackpressureKind.UNBOUNDED_IN)
2039520395
@SchedulerSupport(SchedulerSupport.NONE)
2039620396
@NonNull
20397-
public final <@NonNull R, @NonNull A> Single<R> collect(@NonNull Collector<? super T, A, R> collector) {
20397+
public final <@NonNull R, @Nullable A> Single<R> collect(@NonNull Collector<? super T, A, R> collector) {
2039820398
Objects.requireNonNull(collector, "collector is null");
2039920399
return RxJavaPlugins.onAssembly(new FlowableCollectWithCollectorSingle<>(this, collector));
2040020400
}

0 commit comments

Comments
 (0)