Gradle checkstyleTest fails "CheckstyleException: Property 'allowMissingPropertyJavadoc' does not exist"

Viewed 8881

I get this error while running checkstyle on my custom test configuration - functionalTest.

Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: cannot initialize module TreeWalker - cannot initialize module JavadocMethod - Property 'allowMissingPropertyJavadoc' does not exist, please check the documentation at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:477) at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:198) at com.puppycrawl.tools.checkstyle.ant.CheckstyleAntTask.createRootModule(CheckstyleAntTask.java:412) ... 117 more Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: cannot initialize module JavadocMethod - Property 'allowMissingPropertyJavadoc' does not exist, please check the documentation at com.puppycrawl.tools.checkstyle.TreeWalker.setupChild(TreeWalker.java:136) at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:198) at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:472) ... 119 more Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: Property 'allowMissingPropertyJavadoc' does not exist, please check the documentation at com.puppycrawl.tools.checkstyle.api.AutomaticBean.tryCopyProperty(AutomaticBean.java:223) at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:191) at com.puppycrawl.tools.checkstyle.TreeWalker.setupChild(TreeWalker.java:131) ... 121 more

I see this field is set to true, in checkstyle.xml,

but I still get this error.

1 Answers

Property 'allowMissingPropertyJavadoc' does not exist

https://checkstyle.org/releasenotes.html#Release_8.25

The property was removed in 8.25 as the functionality was moved to a new check, MissingJavadocMethodCheck, in 8.20. Since it was moved, the original check just kept the property to not break configuration and be deprecated. It was now removed.

I suggest you add MissingJavadocMethodCheck to continue the same behavior as before. for example:

<module name="MissingJavadocMethodCheck">
  <property name="allowMissingPropertyJavadoc" value="true"/>
</module>
Related