开发者

How to apply Checkstyle check IllegalType only to static fields

I'm trying to use Checkstyle (this check) to raise a warning when a particular class is used as a type for static field. I'm doing it with this configuration and it doesn't work:

<module name="IllegalType"> <property name="format" value="myFullClassName"/> <property name="tokens" value="LITERAL_STATIC"/> </module>

The following configuration do work, but for all fields, not only static:

<module name="IllegalType"> <property name="format" value="myFullClassName"/> <property name="tokens" value="VA开发者_运维技巧RIABLE_DEF"/> </module>


From the doc, it looks like tokens have to be a subset of PARAMETER_DEF, VARIABLE_DEF and METHOD_DEF.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜