Add CheckReturnValue annotation#4881
Add CheckReturnValue annotation#4881akarnokd merged 3 commits intoReactiveX:2.xfrom vanniktech:CheckReturnValue
Conversation
Current coverage is 95.74% (diff: 100%)@@ 2.x #4881 diff @@
==========================================
Files 581 581
Lines 37212 37212
Methods 0 0
Messages 0 0
Branches 5601 5601
==========================================
- Hits 35643 35628 -15
- Misses 647 654 +7
- Partials 922 930 +8
|
artem-zinnatullin
left a comment
There was a problem hiding this comment.
Gooooooood. Afaik Findbugs also able to process annotation with this name correctly.
| * | ||
| * @since 2.0.2 - experimental | ||
| */ | ||
| @Retention(RetentionPolicy.RUNTIME) |
There was a problem hiding this comment.
nit: static import makes it a little bit better
There was a problem hiding this comment.
Yes I know however for RxJava it's common to not static import them (look at BackpressureSupport & SchedulerSupport) so I left it that way. I leave the final decision up to David.
| */ | ||
| @Retention(RetentionPolicy.RUNTIME) | ||
| @Documented | ||
| @Target(ElementType.METHOD) |
|
I quickly checked findbugs and it does not seem like they pick up our annotation since they have their own |
| * | ||
| * @since 2.0.2 - experimental | ||
| */ | ||
| @Retention(RetentionPolicy.RUNTIME) |
|
Would you manually ignore methods like |
|
@artem-zinnatullin weird somehow findbugs didn't pick it up though. Could be a configuration error on my side. I'd argue that not annotating We're on the same point that static factory methods and operators such as flatMap, first(), last() etc should be annotated right? If so I'd apply those and then we can see which might need an annotation too. |
|
@akarnokd added the |
|
Yes. /cc @JakeWharton |
First draft on this.
So far I have only annotated
subscribeWith()andtest()methods.I checked this against Error Prone and their check is able of picking up the RxJava annotation.
How do you feel if I extend
BaseTypeAnnotationsto test for@CheckReturnValuetoo?Related #4878