-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
2.x: add ParallelTransformer interface, params-validation #5197
Conversation
Codecov Report
@@ Coverage Diff @@
## 2.x #5197 +/- ##
============================================
- Coverage 95.96% 95.89% -0.07%
+ Complexity 5683 5682 -1
============================================
Files 621 621
Lines 40611 40611
Branches 5632 5632
============================================
- Hits 38973 38945 -28
- Misses 657 672 +15
- Partials 981 994 +13
Continue to review full report at Codecov.
|
public final <U> ParallelFlowable<U> compose(Function<? super ParallelFlowable<T>, ParallelFlowable<U>> composer) { | ||
return RxJavaPlugins.onAssembly(to(composer)); | ||
public final <U> ParallelFlowable<U> compose(@NonNull ParallelTransformer<T, U> composer) { | ||
return RxJavaPlugins.onAssembly(composer.apply(this)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing check here for composer being null?
@@ -611,7 +611,7 @@ protected final boolean validate(Subscriber<?>[] subscribers) { | |||
* @return the value returned by the converter function | |||
*/ | |||
@CheckReturnValue | |||
public final <U> U to(Function<? super ParallelFlowable<T>, U> converter) { | |||
public final <U> U to(@NonNull Function<? super ParallelFlowable<T>, U> converter) { | |||
try { | |||
return converter.apply(this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing check here for converter being null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dereference will throw NPE automatically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd still check it in order to be consistent and for the better error message knowing what exactly is null.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated this and all other methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome 👍
This PR adds the
ParallelTransformer
interface to match the otherXTransformer
interfaces, adds@NonNull
annotations to theParallelFlowable
operators and adds theParallelFlowable
class to the parameter validator test set.