I have a problem with eclipse checkstyle plugin, i just installed this one and when i execute checkstyle-configuration with sun_checkstyle(eclipse) on java file, i have this error:
cannot initialize module TreeWalker - Token "WILDCARD_TYPE" was not found in Acceptable tokens list in check com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck@2261fbd cannot initialize module TreeWalker - Token "WILDCARD_TYPE" was not found in Acceptable tokens list in check com.puppycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck@2261fbd
But when i use checkstyle configuration : Sun Checks or Google Checks, it's works. Do you have a solution ? Thanks, Neyoh
The error is in the xml file sun_checks_eclipse.xml, found in your plugins folder for checkstyle (e.g. .\eclipse\plugins\net.sf.eclipsecs.core_xxxxxx):
<module name="WhitespaceAround">
<property name="tokens" value="ASSIGN,BAND,BAND_ASSIGN,BOR,BOR_ASSIGN,BSR,BSR_ASSIGN,BXOR,BXOR_ASSIGN,COLON,DIV,DIV_ASSIGN,EQUAL,GE,GT,LAND,LCURLY,LE,LITERAL_ASSERT,LITERAL_CATCH,LITERAL_DO,LITERAL_ELSE,LITERAL_FINALLY,LITERAL_FOR,LITERAL_IF,LITERAL_RETURN,LITERAL_SYNCHRONIZED,LITERAL_TRY,LITERAL_WHILE,LOR,LT,MINUS,MINUS_ASSIGN,MOD,MOD_ASSIGN,NOT_EQUAL,PLUS,PLUS_ASSIGN,QUESTION,RCURLY,SL,SLIST,SL_ASSIGN,SR,SR_ASSIGN,STAR,STAR_ASSIGN,LITERAL_ASSERT,TYPE_EXTENSION_AND,WILDCARD_TYPE"/>
</module>
Simply remove the last entry WILDCARD_TYPE
I suspect the people writing checkstyle assume something that isn't correct, e.g. a specific version of Eclipse.
Anyway, I had it 5 minutes ago, I changed the entry above and it works now.
Actually, there is not any "WILDCARD_TYPE" token available for WhitespaceAroundCheck.
List of the tokens which you can use are as below:
ASSIGN, BAND, BAND_ASSIGN, BOR, BOR_ASSIGN, BSR, BSR_ASSIGN, BXOR, BXOR_ASSIGN, COLON, DIV, DIV_ASSIGN, DO_WHILE, EQUAL, GE, GT, LAND, LCURLY, LE, LITERAL_ASSERT, LITERAL_CATCH, LITERAL_DO, LITERAL_ELSE, LITERAL_FINALLY, LITERAL_FOR, LITERAL_IF, LITERAL_RETURN, LITERAL_SWITCH, LITERAL_SYNCHRONIZED, LITERAL_TRY, LITERAL_WHILE, LOR, LT, MINUS, MINUS_ASSIGN, MOD, MOD_ASSIGN, NOT_EQUAL, PLUS, PLUS_ASSIGN, QUESTION, RCURLY, SL, SLIST, SL_ASSIGN, SR, SR_ASSIGN, STAR, STAR_ASSIGN, TYPE_EXTENSION_AND
For more information, you can have a look on our website: http://checkstyle.sourceforge.net/config_whitespace.html
Here, go to link, find "whitespacearound", you will find description for how to configure check for it. There is also information about each token if you want. just click on it.
If you have any other problem regarding, please let me know.
Thanks,
Bhavik
token was added accepted list, fix was released http://checkstyle.sourceforge.net/releasenotes.html#Release_6.5
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With