Java - Checkstyle - 冗余抛出
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/27919444/
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
Java - Checkstyle - Redundant Throws
提问by iCode
I'm using STS and installed checkstyle plugin. Using install new softwarewith this URL http://eclipse-cs.sourceforge.net/update.
我正在使用 STS 并安装了 checkstyle 插件。使用此 URL http://eclipse-cs.sourceforge.net/update安装新软件。
I have my own checkstyle rule for my Java project. Whenever I change any code and save it shows the following error for me.
我的 Java 项目有自己的 checkstyle 规则。每当我更改任何代码并保存它时,都会为我显示以下错误。
Errors occurred during the build.
Errors running builder 'Checkstyle Builder' on project 'myproject'.
cannot initialize module TreeWalker - Unable to instantiate RedundantThrows
cannot initialize module TreeWalker - Unable to instantiate RedundantThrows
cannot initialize module TreeWalker - Unable to instantiate RedundantThrows
cannot initialize module TreeWalker - Unable to instantiate RedundantThrows
This is my checkstyle rule for RedundantThrows
这是我对 RedundantThrows 的 checkstyle 规则
<module name="RedundantThrows">
<property name="logLoadErrors" value="true" />
<property name="suppressLoadErrors" value="true" />
</module>
How to fix the problem?
如何解决问题?
Thanks.
谢谢。
回答by Joachim Rohde
RedundantThrows was removed with version 6.2 (see https://github.com/checkstyle/checkstyle/issues/473)
RedundantThrows 已在 6.2 版中删除(请参阅https://github.com/checkstyle/checkstyle/issues/473)
回答by Dosi Bingov
I experienced the same with IntelliJ IDEA What I did is I have switched to older version of the checkstyle plugin that can be found here: https://plugins.jetbrains.com/plugin/1065
我在 IntelliJ IDEA 中遇到了同样的情况我所做的是切换到旧版本的 checkstyle 插件,可以在这里找到:https: //plugins.jetbrains.com/plugin/1065