Checkstyle eclipse plugin: error cannot initialize Toner module of TreeWalker tree "WILDCARD_TYPE"

I have a problem with the eclipse checkstyle plugin, I just installed this, and when I do the checkstyle configuration using sun_checkstyle (eclipse) in the java file, I have this error:

cannot initialize TreeWalker module - token "WILDCARD_TYPE" was not found in the list of acceptable tokens com.pupp ycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck@ 2261fbd cannot initialize TreeWalker module - token "WILDCARD_TYPE" was not found in the list of acceptable tokens com.pupp ycrawl.tools.checkstyle.checks.whitespace.WhitespaceAroundCheck@ 2261fbd

But when I use the checkstyle configuration: Sun Checks or Google Checks, it works. Do you have a solution? Thanks Neyoh

+7
java eclipse eclipse-plugin checkstyle
source share
3 answers

Error in the xml file sun_checks_eclipse.xml found in your plugins folder for checkstyle (for example,. \ 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> 

Just delete the last entry WILDCARD_TYPE

I suspect that people writing control style are suggesting something is wrong, for example. specific version of Eclipse.

In any case, I had it 5 minutes ago, I changed the record above, and now it works.

+6
source share

In fact, there is no WILDCARD_TYPE token for WhitespaceAroundCheck.

The list of tokens you can use is as follows:

Assignment 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, QUESTIGN, SLESTIGN

For more information, please visit our website: http://checkstyle.sourceforge.net/config_whitespace.html

Here, follow the link, find "whitespacearound", you will find a description of how to configure verification for it. There is also information about each token if you want. just click on it.

If you have other problems, let me know.

Thanks,

Bhavik

+3
source share

the accepted list was added, the release of http://checkstyle.sourceforge.net/releasenotes.html#Release_6.5 fixed

+1
source share

All Articles