You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Starting audit...
[ERROR] C:\work\checkstyle\SpringTest.java:9:27:
No nullness Annotation for parameter
definition found. [Jsr305Annotations]
Audit done.
Checkstyle ends with 1 errors.
While actually there is definitely no defect in validation logic, it could be valueable to have configuration option to provide list of annotations, which mark parameters/return values as no needing validation. For example: Spring @Autowired injection checks for nullness by provided required argument (true by default).
This can also be used for some other nullness annotations like NotNull, used commonly in REST services, other Dependency Injection framework-related annotations, IDE specific nullness annotations such as org.jetbrains.annotations.NotNull and so on.
http://sevntu-checkstyle.github.io/sevntu.checkstyle/apidocs/com/github/sevntu/checkstyle/checks/coding/Jsr305AnnotationsCheck.html
/var/tmp $ cat SpringTest.java
/var/tmp $ cat config.xml
For Linux users:
java -classpath checkstyle-10.1-all.jar:sevntu-checks-1.41.0.jar com.puppycrawl.tools.checkstyle.Main -c config.xml SpringTest.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 SpringTest.java
While actually there is definitely no defect in validation logic, it could be valueable to have configuration option to provide list of annotations, which mark parameters/return values as no needing validation. For example: Spring
@Autowired
injection checks for nullness by providedrequired
argument (true
by default).This can also be used for some other nullness annotations like NotNull, used commonly in REST services, other Dependency Injection framework-related annotations, IDE specific nullness annotations such as
org.jetbrains.annotations.NotNull
and so on.Could be similar to Checkstyle JavadocType configuration
The text was updated successfully, but these errors were encountered: