-
Notifications
You must be signed in to change notification settings - Fork 146
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
Add option to allow returning nullable from methods in Jsr305AnnotationCheck #887
Comments
Jsr305AnnotationCheck sevntu-checkstyle#887
@mbert, please review this request. As for me we do not need property, it is just a defect. |
I think this all comes from original recommendations from JSR305: e. g. javadoc for Nullable
But in fact I don't know. Personally for me it would work even without a property, but it would be a breaking change IMO. I can imagine a codestyle that requires |
http://sevntu-checkstyle.github.io/sevntu.checkstyle/apidocs/com/github/sevntu/checkstyle/checks/coding/Jsr305AnnotationsCheck.html
/var/tmp $ javac Test.java
/var/tmp $ cat Test.java
/var/tmp $ cat config.xml
For Linux users:
/var/tmp $ java -classpath checkstyle-10.1-all.jar:sevntu-checks-1.41.0.jar com.puppycrawl.tools.checkstyle.Main -c config.xml Test.java
For Windows users:
C:\tmp> java -classpath checkstyle-10.1-all.jar;sevntu-checks-1.41.0.jar com.puppycrawl.tools.checkstyle.Main -c config.xml Test.java
Describe what you expect in detail.
Expected:
A configuration option allowNullableReturnValue can be set, so that the following configuration could be used
And the result would be
Motivation is in fact using
@Nullable
is quite common practice, though I realize@CheckForNull
is recommended by most tools (including SonarQube)The text was updated successfully, but these errors were encountered: