parseq
parseq copied to clipboard
Can we support @Nonnull and @Nullable annotations in public method return values and parameters?
Can we support @Nonnull and @Nullable annotations in public method return values and parameters? Adding these can help parseq users write accurate Parseq code more easily by getting help from IDE in null detection wherever applicable.
If agreed, I can take this task and submit a review.
This is a question raised before. The problem is that there are multiple versions of @nonull and @nullable annotations, as well as several static analysis tools to handle these annotations like findBugs, Android IDE, etc. When you mention IDE here, do you mean Android developer IDE? Typical IntelliJ IDE will not do null detection for you until you hook up with some static analysis checker tool.
Yeah I agree there are multiple versions. We should stick to Java versions (javax.annotation.Nonnull
and Nullable
). Both IntelliJ and Eclipse have built-in support for null detection using these annotations. No plugin or stylecheck addition required.
These annotations are useful even for developers without IDE as they serve as a good documentation and set right expectations for the API.
How do you compare this annotation with Java Optional?