Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

eclipse checkstyle error cannot initialize module TreeWalker - TreeWalker is not allowed as a parent of FileLength

I get the following error when I try to load a user defined check style template.

cannot initialize module TreeWalker - TreeWalker is not allowed as a parent of FileLength

I think it might be due to the incompatibilty with checkstyle version in my eclipse. How will I be able to find the appropriate checkstyle version with checkstyle xml file

like image 572
Anand B Avatar asked Jun 27 '13 12:06

Anand B


1 Answers

This is an error in the template, independent of the Checkstyle version. FileLength goes directly under Checker, not under TreeWalker.

Example:

<module name="Checker">     <property name="severity" value="warning"/>     <module name="TreeWalker">         <property name="tabWidth" value="4"/>         <module name="JavadocType"/>         <!-- many others -->     </module>     <module name="NewlineAtEndOfFile"/>     <module name="FileLength"/>     <module name="JavadocPackage"/>     <!-- others --> </module> 
like image 94
barfuin Avatar answered Oct 03 '22 22:10

barfuin