2.x: @CheckReturnValue for public API
See original GitHub issueHow do you guys feel if the @CheckReturnValue
annotation was added to certain public API methods?
The one that would probably benefit the most in my opinion would be the subscribe
method where you get a Subscription
or Disposable
back. In 99% of the cases you want to handle it.
Also static analyze tools such as Error Prone could emit an error / warning.
Issue Analytics
- State:
- Created 7 years ago
- Comments:29 (9 by maintainers)
Top Results From Across the Web
javax.annotation.CheckReturnValue Java Examples
Prepares for a check that the subject is deadline within the given tolerance of an * expected value that will be provided in...
Read more >CheckReturnValue (SpotBugs 3.1.2 API) - javadoc.io
This annotation is used to denote a method whose return value should always be checked when invoking the method. The checker treats this...
Read more >Using annotation to ensure that value returned by method is ...
Having an annotation that would enforce clients to not ignore return values of certain methods, and having it enforced by the compiler at ......
Read more >UnsignedInts (Guava: Google Core Libraries for Java 19.0 API)
Returns a string representation of x, where x is treated as unsigned. toString. @CheckReturnValue public static String toString(int x, int radix). Returns a ......
Read more >JDABuilder (JDA 5.0.0-beta.2 API)
declaration: package: net.dv8tion.jda.api, class: JDABuilder. ... @Nonnull @CheckReturnValue public static JDABuilder createDefault(@Nullable String token).
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ugh. After updating to RxJava 2.1.12, I have awful yellow warning highlighting everywhere. My two cents – I hate
@CheckReturnValue
. I do the following, which works well for my project:I find this much more readable than
I don’t want to suppress that warning everywhere, so now I have to litter my code with local suppressions.
I love the
@CheckReturnValue
, but in some projects with RxLifecycle we do not actually need to care about this return value. In this case, we have to usesuppress
everywhere, 🤔…P.S. I finally found a perfect solution: https://github.com/uber/AutoDispose