Skip to content

Commit

Permalink
Remove @NonNull annotation from Collector container type paramete…
Browse files Browse the repository at this point in the history
…r. (#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?>`.
  • Loading branch information
cpovirk authored Aug 23, 2023
1 parent 9975460 commit 9ebf221
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/io/reactivex/rxjava3/core/Flowable.java
Original file line number Diff line number Diff line change
Expand Up @@ -20394,7 +20394,7 @@ public final TestSubscriber<T> test(long initialRequest, boolean cancel) { // No
@BackpressureSupport(BackpressureKind.UNBOUNDED_IN)
@SchedulerSupport(SchedulerSupport.NONE)
@NonNull
public final <@NonNull R, @NonNull A> Single<R> collect(@NonNull Collector<? super T, A, R> collector) {
public final <@NonNull R, @Nullable A> Single<R> collect(@NonNull Collector<? super T, A, R> collector) {
Objects.requireNonNull(collector, "collector is null");
return RxJavaPlugins.onAssembly(new FlowableCollectWithCollectorSingle<>(this, collector));
}
Expand Down

0 comments on commit 9ebf221

Please sign in to comment.