Checkstyle Eclipse 插件不起作用
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12795935/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Checkstyle Eclipse plugin doesn't work
提问by Alex Objelean
I'm using eclipse checkstyle plugin with Juno Eclipse distribution. Anytime the code is checked for checkstyle error I get the following error:
我在 Juno Eclipse 发行版中使用 eclipse checkstyle 插件。每当检查代码是否存在 checkstyle 错误时,我都会收到以下错误:
cannot initialize module TreeWalker - Unable to instantiate DoubleCheckedLocking
Does anybody know how to fix this problem? Is it a plugin compatibility issue or something else?
有谁知道如何解决这个问题?是插件兼容性问题还是其他问题?
采纳答案by Torsten
The DoubleCheckedLocking check has been removed in Checkstyle 5.6 and must be manually removed from your Checkstyle configuration.
DoubleCheckedLocking 检查已在 Checkstyle 5.6 中删除,必须从 Checkstyle 配置中手动删除。
See also: http://sourceforge.net/tracker/index.php?func=detail&aid=3571442&group_id=29721&atid=397078
另见:http: //sourceforge.net/tracker/index.php?func=detail&aid=3571442&group_id=29721&atid=397078
回答by V.Y.
Open the Checkstyle preferences, create your own Check Configuration, go into your own check configuration, find the TreeWalker module, click it and then un-check the DoubleCheckedLocking. As simple as that.
打开 Checkstyle 首选项,创建您自己的检查配置,进入您自己的检查配置,找到 TreeWalker 模块,单击它,然后取消选中 DoubleCheckedLocking。就如此容易。
回答by gospodin
just comment or remove "DoubleCheckedLocking" from the checkstyle file and it will work
只需从 checkstyle 文件中注释或删除“DoubleCheckedLocking”,它就会起作用
回答by Martin Spamer
- Under your Eclipse Workspace Search for file internal_config__*.xml
Remove the following line from the file
<module name="DoubleCheckedLocking"/>
Reload Workspace.
- 在您的 Eclipse 工作区下搜索文件internal_config__*.xml
从文件中删除以下行
<模块名称="DoubleCheckedLocking"/>
重新加载工作区。
This will work for any discontinued module which produces the error message "Unable to instantiate"
这适用于任何产生错误消息“无法实例化”的已停产的模块