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: Verify the use of base interfaces in operator inputs & lambdas #6858

Merged
merged 2 commits into from Jan 22, 2020

Conversation

akarnokd
Copy link
Member

This PR adds a test that verifies standard operator methods use base interfaces as their input and lambdas capable of returning base types do as well. Consequently, it fixes two declarations of Flowable.buffer having the wrong input type.

Basically, detect the following declarations:

// direct use of the class, should be Publisher
    public void method1(Flowable<?> f)

// lambda returns the class, should return a Publisher
    public void method2(Callable<Flowable<?>> c)

// The inner Publisher emits the class, should emit Publisher
    public void method3(Supplier<Publisher<Flowable<?>>> c)

// Direct use of the class as array type, should be Publisher[]
    public void method4(Flowable<?>[] array)

// Lambda returns an array of the class, should return Publisher[]
    public void method5(Callable<Flowable<?>[]> c)

// The inner Publisher emits an array of the class, should emit Publisher[]
    public void method6(Callable<Publisher<Flowable<?>[]>> c)

@akarnokd akarnokd added this to the 3.0 milestone Jan 22, 2020
@codecov
Copy link

codecov bot commented Jan 22, 2020

Codecov Report

Merging #6858 into 3.x will decrease coverage by 0.01%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##                3.x    #6858      +/-   ##
============================================
- Coverage     98.26%   98.24%   -0.02%     
+ Complexity     6380     6379       -1     
============================================
  Files           715      715              
  Lines         46524    46524              
  Branches       6387     6387              
============================================
- Hits          45715    45707       -8     
+ Misses          293      290       -3     
- Partials        516      527      +11
Impacted Files Coverage Δ Complexity Δ
.../main/java/io/reactivex/rxjava3/core/Flowable.java 100% <ø> (ø) 576 <0> (ø) ⬇️
...l/operators/observable/ObservableFlatMapMaybe.java 85.91% <0%> (-4.23%) 2% <0%> (ø)
.../internal/disposables/ListCompositeDisposable.java 98% <0%> (-2%) 34% <0%> (-1%)
...tivex/rxjava3/disposables/CompositeDisposable.java 98.14% <0%> (-1.86%) 39% <0%> (-1%)
.../operators/observable/ObservableFlatMapSingle.java 94.44% <0%> (-1.59%) 2% <0%> (ø)
...ctivex/rxjava3/internal/util/QueueDrainHelper.java 98.61% <0%> (-1.39%) 57% <0%> (-1%)
...ternal/operators/completable/CompletableMerge.java 95.94% <0%> (-1.36%) 2% <0%> (ø)
...rnal/operators/observable/ObservableObserveOn.java 98.69% <0%> (-1.31%) 3% <0%> (ø)
...rnal/operators/flowable/FlowableFlatMapSingle.java 94.18% <0%> (-1.17%) 2% <0%> (ø)
...ava3/internal/operators/parallel/ParallelJoin.java 92.04% <0%> (-1.14%) 3% <0%> (ø)
... and 15 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 13ffa18...31cd8b8. Read the comment docs.

Copy link
Collaborator

@vanniktech vanniktech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really nice!

@akarnokd akarnokd merged commit b6aceec into ReactiveX:3.x Jan 22, 2020
@akarnokd akarnokd deleted the ArgumentsAreBaseInterfaces branch January 22, 2020 13:03
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.

None yet

2 participants