Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.x: Move nullability annotations into the type argument declaration #7303

Merged
merged 2 commits into from
Jul 24, 2021

Conversation

akarnokd
Copy link
Member

@akarnokd akarnokd commented Jul 23, 2021

This PR makes sure generic type argument declarations on methods include the @NonNull (or @Nullable) annotation as well as source-checking test code to verify the expected style.

Before:

public final <R> Maybe<R> map(@NonNull Function<? super T, ? extends R> mapper) {
// or
public final <R> Maybe<R> map(@NonNull Function<? super T, @NonNull ? extends R> mapper) {

After:

public final <@NonNull R> Maybe<R> map(@NonNull Function<? super T, ? extends R> mapper) {

Related #7302

@codecov
Copy link

codecov bot commented Jul 23, 2021

Codecov Report

Merging #7303 (14831e6) into 3.x (bb814d2) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##                3.x    #7303      +/-   ##
============================================
- Coverage     99.53%   99.50%   -0.03%     
+ Complexity     6783     6781       -2     
============================================
  Files           751      751              
  Lines         47489    47489              
  Branches       6378     6378              
============================================
- Hits          47266    47253      -13     
- Misses          102      110       +8     
- Partials        121      126       +5     
Impacted Files Coverage Δ
...in/java/io/reactivex/rxjava3/core/Completable.java 100.00% <ø> (ø)
.../main/java/io/reactivex/rxjava3/core/Flowable.java 100.00% <ø> (ø)
src/main/java/io/reactivex/rxjava3/core/Maybe.java 100.00% <ø> (ø)
...ain/java/io/reactivex/rxjava3/core/Observable.java 100.00% <ø> (ø)
...rc/main/java/io/reactivex/rxjava3/core/Single.java 100.00% <ø> (ø)
...rnal/subscriptions/DeferredScalarSubscription.java 100.00% <ø> (ø)
...o/reactivex/rxjava3/parallel/ParallelFlowable.java 100.00% <ø> (ø)
...o/reactivex/rxjava3/processors/AsyncProcessor.java 97.91% <ø> (ø)
.../reactivex/rxjava3/subscribers/SafeSubscriber.java 100.00% <ø> (ø)
...ernal/subscriptions/BasicIntQueueSubscription.java 100.00% <100.00%> (ø)
... and 24 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bb814d2...14831e6. Read the comment docs.

@ZacSweers
Copy link
Contributor

This is great!! Will be a big win for nullaway users and kotlin users starting in 1.5.30.

@akarnokd akarnokd merged commit 40ca8ef into ReactiveX:3.x Jul 24, 2021
@akarnokd akarnokd deleted the NonNullTypeDeclCheck branch July 24, 2021 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants