Skip to content
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

Can we support @Nonnull and @Nullable annotations in public method return values and parameters? #205

Open
hiteshsharma opened this issue Jan 27, 2019 · 3 comments

Comments

@hiteshsharma
Copy link
Contributor

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.

@mchen07
Copy link
Contributor

mchen07 commented Jan 30, 2019

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.

@hiteshsharma
Copy link
Contributor Author

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.

@mchen07
Copy link
Contributor

mchen07 commented Feb 21, 2019

How do you compare this annotation with Java Optional?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants