-
Notifications
You must be signed in to change notification settings - Fork 129
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
Annotation CheckReturnValue for subscribe() and other builder-like methods #704
Comments
The corresponding issue in IntelliJ IDEA: https://youtrack.jetbrains.com/issue/IDEA-277014 I believe it would be better to maintain such rules right in the framework to help all editors and IDEs with these usages. |
Do we have any standard for such annotations? |
IntelliJ IDEA recognizes any annotation with short name |
Ok so we can create our own right? |
Yes, you may simply create your own, no dependencies required |
This sounds like a really worthwhile thing to do. |
Planned for 1.2.0 🚀 |
+1, sounds like a great idea and will improve the user experience. Once defined in mutiny I would pull the annotation in the Vert.x bindings and annotate all methods returning a Uni or a Multi (how many times did we call a method returning a Uni and nothing happens?). @Sanne This could be interesting for Hibernate Reactive too. |
|
Please be careful with methods that receive lambdas with effect, e.g. |
Yes look nice. But how does it work, is it an annotation processor? I would prefer an annotation processor (or similar) over trying to rely on IDEA specific conventions. |
This is simply inspection in IntelliJ IDEA ) I believe it provides faster feedback loop than compiling everything to see this kind of errors. |
AFAIK this kind of checks cannot be implemented as annotation processor, only if you use something like ByteBuddy enhancer that visits all the code. |
Ok I would have preferred something that works in all IDEs (and no IDE) but I suppose it's still very nice to have this in IDEA. Funny, reminds me of an old tool we had explored to identify (and take advantage of) code which would do a Map#put but ignored the return value: https://github.com/infinispan/jokre (it's pretty much dead though, just somewhat related) |
See #729 |
Popular reactive libraries such as RxJava has
@CheckReturnValue
annotation on methods returning objects without side-effects, so developers may rely on IDE to check that there are no calls with ignored return value.It would be great if Mutiny APIs would be annotated with this kind of annotation.
Example:
Problem example:
Once methods are annotated IDE can help here:
The text was updated successfully, but these errors were encountered: