Remove @NonNull annotations in BiConsumer method parameter#5257
Remove @NonNull annotations in BiConsumer method parameter#5257akarnokd merged 1 commit intoReactiveX:2.xfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## 2.x #5257 +/- ##
============================================
- Coverage 95.97% 95.94% -0.03%
+ Complexity 5751 5743 -8
============================================
Files 628 628
Lines 41077 41077
Branches 5699 5699
============================================
- Hits 39422 39412 -10
- Misses 664 668 +4
- Partials 991 997 +6
Continue to review full report at Codecov.
|
|
/cc @vanniktech I belive |
|
It's not that important. It just means nullability contracts need to be defined where |
|
Well, it's not in all context that @nonnull annotation is correct in |
|
Might make more sense to delete the annotations since the interface is used in different places where different parameters are sometimes null and sometimes not. Having different interfaces with different annotations tailored for each use case might be the best option although it wouldn't be backwards compatible at least not source and binary compatible. |
|
@vanniktech like this example? public void biconsumerWithCorrectNullableAnnotationInThrowable() {
Single.just(1).subscribe(new SingleBiConsumer<Integer, Throwable>() {
@Override
public void accept(@Nullable Integer integer, @Nullable Throwable throwable) throws Exception {
assertNull(throwable);
}
});
}Create a extesion of |
This PR is part of #5216
This PR remove @nonnull annotations from
BiConsumermethod parameters, there's no sense use these annotations inSinglecontext because in this caseBiConsumeralways brings you a null parameter.