Skip to content

Conversation

@cpovirk
Copy link
Contributor

@cpovirk cpovirk commented Aug 21, 2023

collect delegates to FlowableCollectWithCollectorSingle, which
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?>.

`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?>`.
@codecov
Copy link

codecov bot commented Aug 21, 2023

Codecov Report

Merging #7590 (76340d9) into 3.x (9975460) will increase coverage by 0.00%.
The diff coverage is n/a.

@@ Coverage Diff @@ ## 3.x #7590 +/- ## ========================================= Coverage 99.53% 99.53% + Complexity 6802 6801 -1  ========================================= Files 752 752 Lines 47706 47706 Branches 6401 6401 ========================================= + Hits 47482 47484 +2  + Misses 105 99 -6  - Partials 119 123 +4 
Files Changed Coverage Δ
.../main/java/io/reactivex/rxjava3/core/Flowable.java 100.00% <ø> (ø)

... and 11 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@akarnokd akarnokd added this to the 3.1-support milestone Aug 21, 2023
@cpovirk
Copy link
Contributor Author

cpovirk commented Aug 22, 2023

Wait, did I completely misread this? I need to have another look. Sorry....

@cpovirk
Copy link
Contributor Author

cpovirk commented Aug 22, 2023

OK, I might have it:

I think that this change still makes sense. But I got confused because I was looking at the other overload of collect. But... the other overload of collect appears to be the one that I was seeing the problem with in our code. And that overload does need a non-nullable value from its Supplier. So our code is buggy, and the current annotations caught it!

Next, I'm going to see if our code could get away with calling the overload that I'm changing in this PR. If it can, then I will still be interested in the PR, since I do think the annotations for this overload are unnecessarily strict.

@cpovirk
Copy link
Contributor Author

cpovirk commented Aug 22, 2023

Yes: Our code can be changed to call this overload. (The code was originally written for RxJava 2, when the Collector overload wasn't yet present.) That would eliminate our current nullness bug. We'd just need the annotation change of this PR so that kotlinc can tell that our old code is unsafe but our new code is safe.

@akarnokd akarnokd merged commit 9ebf221 into ReactiveX:3.x Aug 23, 2023
@cpovirk
Copy link
Contributor Author

cpovirk commented Aug 23, 2023

Thanks, and thank you for taking care of Observable, too.

github-merge-queue bot referenced this pull request in slackhq/circuit Aug 26, 2023
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [io.reactivex.rxjava3:rxjava](https://togithub.com/ReactiveX/RxJava) | dependencies | patch | `3.1.6` -> `3.1.7` | --- ### ⚠ Dependency Lookup Warnings ⚠ Warnings were logged while processing this repo. Please check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>ReactiveX/RxJava (io.reactivex.rxjava3:rxjava)</summary> ### [`v3.1.7`](https://togithub.com/ReactiveX/RxJava/releases/tag/v3.1.7) [Maven](http://search.maven.org/#artifactdetails%7Cio.reactivex.rxjava3%7Crxjava%7C3.1.7%7C) [JavaDocs](http://reactivex.io/RxJava/3.x/javadoc/3.1.7) ##### API changes - Add `onDropped` callback for `onBackpressureLatest`. (<a href='https://github.com/ReactiveX/RxJava/issues/7542'>[#&#8203;7542](https://togithub.com/ReactiveX/RxJava/issues/7542)</a>) - Add `onDropped` callback to `onBackpressureBuffer`. (<a href='https://github.com/ReactiveX/RxJava/issues/7567'>[#&#8203;7567](https://togithub.com/ReactiveX/RxJava/issues/7567)</a>) ##### Documentation - Change summary to caption, because summary is obsolete in HTML5. (<a href='https://github.com/ReactiveX/RxJava/issues/7534'>[#&#8203;7534](https://togithub.com/ReactiveX/RxJava/issues/7534)</a>) - Try using https to access the reactive streams javadoc. (<a href='https://github.com/ReactiveX/RxJava/issues/7535'>[#&#8203;7535](https://togithub.com/ReactiveX/RxJava/issues/7535)</a>) - Improve Javadoc of `Disposable`. ##### Other - Add minimum GitHub token permissions for workflows. (<a href='https://github.com/ReactiveX/RxJava/issues/7541'>[#&#8203;7541](https://togithub.com/ReactiveX/RxJava/issues/7541)</a>) - Create SECURITY.md (<a href='https://github.com/ReactiveX/RxJava/issues/7546'>[#&#8203;7546](https://togithub.com/ReactiveX/RxJava/issues/7546)</a>) - Add copyright and license to jar. (<a href='https://github.com/ReactiveX/RxJava/issues/7520'>[#&#8203;7520](https://togithub.com/ReactiveX/RxJava/issues/7520)</a>) - Convert `CompletableOnErrorComplete$onError` inner class to static. (<a href='https://github.com/ReactiveX/RxJava/issues/7575'>[#&#8203;7575](https://togithub.com/ReactiveX/RxJava/issues/7575)</a>) - Allow null accumulator type in the `collect(Collector)` operators. (<a href='https://github.com/ReactiveX/RxJava/issues/7590'>[#&#8203;7590](https://togithub.com/ReactiveX/RxJava/issues/7590)</a>) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi41Ny40IiwidXBkYXRlZEluVmVyIjoiMzYuNTcuNCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->
github-merge-queue bot referenced this pull request in slackhq/foundry Aug 28, 2023
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [io.reactivex.rxjava3:rxjava](https://togithub.com/ReactiveX/RxJava) | dependencies | patch | `3.1.6` -> `3.1.7` | --- ### ⚠ Dependency Lookup Warnings ⚠ Warnings were logged while processing this repo. Please check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>ReactiveX/RxJava (io.reactivex.rxjava3:rxjava)</summary> ### [`v3.1.7`](https://togithub.com/ReactiveX/RxJava/releases/tag/v3.1.7) [Maven](http://search.maven.org/#artifactdetails%7Cio.reactivex.rxjava3%7Crxjava%7C3.1.7%7C) [JavaDocs](http://reactivex.io/RxJava/3.x/javadoc/3.1.7) ##### API changes - Add `onDropped` callback for `onBackpressureLatest`. (<a href='https://github.com/ReactiveX/RxJava/issues/7542'>[#&#8203;7542](https://togithub.com/ReactiveX/RxJava/issues/7542)</a>) - Add `onDropped` callback to `onBackpressureBuffer`. (<a href='https://github.com/ReactiveX/RxJava/issues/7567'>[#&#8203;7567](https://togithub.com/ReactiveX/RxJava/issues/7567)</a>) ##### Documentation - Change summary to caption, because summary is obsolete in HTML5. (<a href='https://github.com/ReactiveX/RxJava/issues/7534'>[#&#8203;7534](https://togithub.com/ReactiveX/RxJava/issues/7534)</a>) - Try using https to access the reactive streams javadoc. (<a href='https://github.com/ReactiveX/RxJava/issues/7535'>[#&#8203;7535](https://togithub.com/ReactiveX/RxJava/issues/7535)</a>) - Improve Javadoc of `Disposable`. ##### Other - Add minimum GitHub token permissions for workflows. (<a href='https://github.com/ReactiveX/RxJava/issues/7541'>[#&#8203;7541](https://togithub.com/ReactiveX/RxJava/issues/7541)</a>) - Create SECURITY.md (<a href='https://github.com/ReactiveX/RxJava/issues/7546'>[#&#8203;7546](https://togithub.com/ReactiveX/RxJava/issues/7546)</a>) - Add copyright and license to jar. (<a href='https://github.com/ReactiveX/RxJava/issues/7520'>[#&#8203;7520](https://togithub.com/ReactiveX/RxJava/issues/7520)</a>) - Convert `CompletableOnErrorComplete$onError` inner class to static. (<a href='https://github.com/ReactiveX/RxJava/issues/7575'>[#&#8203;7575](https://togithub.com/ReactiveX/RxJava/issues/7575)</a>) - Allow null accumulator type in the `collect(Collector)` operators. (<a href='https://github.com/ReactiveX/RxJava/issues/7590'>[#&#8203;7590](https://togithub.com/ReactiveX/RxJava/issues/7590)</a>) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi41Ny40IiwidXBkYXRlZEluVmVyIjoiMzYuNTcuNCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->
ashdavies referenced this pull request in ashdavies/circuit Sep 14, 2023
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [io.reactivex.rxjava3:rxjava](https://togithub.com/ReactiveX/RxJava) | dependencies | patch | `3.1.6` -> `3.1.7` | --- ### ⚠ Dependency Lookup Warnings ⚠ Warnings were logged while processing this repo. Please check the Dependency Dashboard for more information. --- ### Release Notes <details> <summary>ReactiveX/RxJava (io.reactivex.rxjava3:rxjava)</summary> ### [`v3.1.7`](https://togithub.com/ReactiveX/RxJava/releases/tag/v3.1.7) [Maven](http://search.maven.org/#artifactdetails%7Cio.reactivex.rxjava3%7Crxjava%7C3.1.7%7C) [JavaDocs](http://reactivex.io/RxJava/3.x/javadoc/3.1.7) ##### API changes - Add `onDropped` callback for `onBackpressureLatest`. (<a href='https://github.com/ReactiveX/RxJava/issues/7542'>[#&#8203;7542](https://togithub.com/ReactiveX/RxJava/issues/7542)</a>) - Add `onDropped` callback to `onBackpressureBuffer`. (<a href='https://github.com/ReactiveX/RxJava/issues/7567'>[#&#8203;7567](https://togithub.com/ReactiveX/RxJava/issues/7567)</a>) ##### Documentation - Change summary to caption, because summary is obsolete in HTML5. (<a href='https://github.com/ReactiveX/RxJava/issues/7534'>[#&#8203;7534](https://togithub.com/ReactiveX/RxJava/issues/7534)</a>) - Try using https to access the reactive streams javadoc. (<a href='https://github.com/ReactiveX/RxJava/issues/7535'>[#&#8203;7535](https://togithub.com/ReactiveX/RxJava/issues/7535)</a>) - Improve Javadoc of `Disposable`. ##### Other - Add minimum GitHub token permissions for workflows. (<a href='https://github.com/ReactiveX/RxJava/issues/7541'>[#&#8203;7541](https://togithub.com/ReactiveX/RxJava/issues/7541)</a>) - Create SECURITY.md (<a href='https://github.com/ReactiveX/RxJava/issues/7546'>[#&#8203;7546](https://togithub.com/ReactiveX/RxJava/issues/7546)</a>) - Add copyright and license to jar. (<a href='https://github.com/ReactiveX/RxJava/issues/7520'>[#&#8203;7520](https://togithub.com/ReactiveX/RxJava/issues/7520)</a>) - Convert `CompletableOnErrorComplete$onError` inner class to static. (<a href='https://github.com/ReactiveX/RxJava/issues/7575'>[#&#8203;7575](https://togithub.com/ReactiveX/RxJava/issues/7575)</a>) - Allow null accumulator type in the `collect(Collector)` operators. (<a href='https://github.com/ReactiveX/RxJava/issues/7590'>[#&#8203;7590](https://togithub.com/ReactiveX/RxJava/issues/7590)</a>) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://togithub.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi41Ny40IiwidXBkYXRlZEluVmVyIjoiMzYuNTcuNCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->
nikclayton referenced this pull request in pachli/pachli-android Sep 27, 2023
…107) [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [io.reactivex.rxjava3:rxjava](https://togithub.com/ReactiveX/RxJava) | `3.1.6` -> `3.1.7` | [![age](https://developer.mend.io/api/mc/badges/age/maven/io.reactivex.rxjava3:rxjava/3.1.7?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.reactivex.rxjava3:rxjava/3.1.7?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.reactivex.rxjava3:rxjava/3.1.6/3.1.7?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.reactivex.rxjava3:rxjava/3.1.6/3.1.7?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>ReactiveX/RxJava (io.reactivex.rxjava3:rxjava)</summary> ### [`v3.1.7`](https://togithub.com/ReactiveX/RxJava/releases/tag/v3.1.7) [Maven](http://search.maven.org/#artifactdetails%7Cio.reactivex.rxjava3%7Crxjava%7C3.1.7%7C) [JavaDocs](http://reactivex.io/RxJava/3.x/javadoc/3.1.7) ##### API changes - Add `onDropped` callback for `onBackpressureLatest`. (<a href='https://github.com/ReactiveX/RxJava/issues/7542'>[#&#8203;7542](https://togithub.com/ReactiveX/RxJava/issues/7542)</a>) - Add `onDropped` callback to `onBackpressureBuffer`. (<a href='https://github.com/ReactiveX/RxJava/issues/7567'>[#&#8203;7567](https://togithub.com/ReactiveX/RxJava/issues/7567)</a>) ##### Documentation - Change summary to caption, because summary is obsolete in HTML5. (<a href='https://github.com/ReactiveX/RxJava/issues/7534'>[#&#8203;7534](https://togithub.com/ReactiveX/RxJava/issues/7534)</a>) - Try using https to access the reactive streams javadoc. (<a href='https://github.com/ReactiveX/RxJava/issues/7535'>[#&#8203;7535](https://togithub.com/ReactiveX/RxJava/issues/7535)</a>) - Improve Javadoc of `Disposable`. ##### Other - Add minimum GitHub token permissions for workflows. (<a href='https://github.com/ReactiveX/RxJava/issues/7541'>[#&#8203;7541](https://togithub.com/ReactiveX/RxJava/issues/7541)</a>) - Create SECURITY.md (<a href='https://github.com/ReactiveX/RxJava/issues/7546'>[#&#8203;7546](https://togithub.com/ReactiveX/RxJava/issues/7546)</a>) - Add copyright and license to jar. (<a href='https://github.com/ReactiveX/RxJava/issues/7520'>[#&#8203;7520](https://togithub.com/ReactiveX/RxJava/issues/7520)</a>) - Convert `CompletableOnErrorComplete$onError` inner class to static. (<a href='https://github.com/ReactiveX/RxJava/issues/7575'>[#&#8203;7575](https://togithub.com/ReactiveX/RxJava/issues/7575)</a>) - Allow null accumulator type in the `collect(Collector)` operators. (<a href='https://github.com/ReactiveX/RxJava/issues/7590'>[#&#8203;7590](https://togithub.com/ReactiveX/RxJava/issues/7590)</a>) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/pachli/pachli-android). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi4xMDcuMiIsInVwZGF0ZWRJblZlciI6IjM2LjEwNy4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
connyduck referenced this pull request in tuskyapp/Tusky Jan 3, 2024
…4092) [![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [io.reactivex.rxjava3:rxjava](https://togithub.com/ReactiveX/RxJava) | `3.1.6` -> `3.1.8` | [![age](https://developer.mend.io/api/mc/badges/age/maven/io.reactivex.rxjava3:rxjava/3.1.8?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.reactivex.rxjava3:rxjava/3.1.8?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.reactivex.rxjava3:rxjava/3.1.6/3.1.8?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.reactivex.rxjava3:rxjava/3.1.6/3.1.8?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>ReactiveX/RxJava (io.reactivex.rxjava3:rxjava)</summary> ### [`v3.1.8`](https://togithub.com/ReactiveX/RxJava/releases/tag/v3.1.8) [Maven](http://search.maven.org/#artifactdetails%7Cio.reactivex.rxjava3%7Crxjava%7C3.1.8%7C) [JavaDocs](http://reactivex.io/RxJava/3.x/javadoc/3.1.8) ##### Bugfixes - Fix `ObservableSwitchMap` `NullPointerException` due to cancel race. ([https://github.com/ReactiveX/RxJava/pull/7597](https://togithub.com/ReactiveX/RxJava/pull/7597)) ### [`v3.1.7`](https://togithub.com/ReactiveX/RxJava/releases/tag/v3.1.7) [Maven](http://search.maven.org/#artifactdetails%7Cio.reactivex.rxjava3%7Crxjava%7C3.1.7%7C) [JavaDocs](http://reactivex.io/RxJava/3.x/javadoc/3.1.7) ##### API changes - Add `onDropped` callback for `onBackpressureLatest`. (<a href='https://github.com/ReactiveX/RxJava/issues/7542'>[#&#8203;7542](https://togithub.com/ReactiveX/RxJava/issues/7542)</a>) - Add `onDropped` callback to `onBackpressureBuffer`. (<a href='https://github.com/ReactiveX/RxJava/issues/7567'>[#&#8203;7567](https://togithub.com/ReactiveX/RxJava/issues/7567)</a>) ##### Documentation - Change summary to caption, because summary is obsolete in HTML5. (<a href='https://github.com/ReactiveX/RxJava/issues/7534'>[#&#8203;7534](https://togithub.com/ReactiveX/RxJava/issues/7534)</a>) - Try using https to access the reactive streams javadoc. (<a href='https://github.com/ReactiveX/RxJava/issues/7535'>[#&#8203;7535](https://togithub.com/ReactiveX/RxJava/issues/7535)</a>) - Improve Javadoc of `Disposable`. ##### Other - Add minimum GitHub token permissions for workflows. (<a href='https://github.com/ReactiveX/RxJava/issues/7541'>[#&#8203;7541](https://togithub.com/ReactiveX/RxJava/issues/7541)</a>) - Create SECURITY.md (<a href='https://github.com/ReactiveX/RxJava/issues/7546'>[#&#8203;7546](https://togithub.com/ReactiveX/RxJava/issues/7546)</a>) - Add copyright and license to jar. (<a href='https://github.com/ReactiveX/RxJava/issues/7520'>[#&#8203;7520](https://togithub.com/ReactiveX/RxJava/issues/7520)</a>) - Convert `CompletableOnErrorComplete$onError` inner class to static. (<a href='https://github.com/ReactiveX/RxJava/issues/7575'>[#&#8203;7575](https://togithub.com/ReactiveX/RxJava/issues/7575)</a>) - Allow null accumulator type in the `collect(Collector)` operators. (<a href='https://github.com/ReactiveX/RxJava/issues/7590'>[#&#8203;7590](https://togithub.com/ReactiveX/RxJava/issues/7590)</a>) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/tuskyapp/Tusky). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMS41IiwidXBkYXRlZEluVmVyIjoiMzcuMTAzLjEiLCJ0YXJnZXRCcmFuY2giOiJkZXZlbG9wIn0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

2 participants