Java - Checkstyle - Redundant投掷

iCo*_*ode 25 java checkstyle

我正在使用STS并安装了checkstyle插件.使用此URL http://eclipse-cs.sourceforge.net/update 安装新软件.

我的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
Run Code Online (Sandbox Code Playgroud)

这是我的RedundantThrows的checkstyle规则

<module name="RedundantThrows">
            <property name="logLoadErrors" value="true" />
            <property name="suppressLoadErrors" value="true" />
        </module>
Run Code Online (Sandbox Code Playgroud)

如何解决问题?

谢谢.

Joa*_*hde 41

版本6.2删除了RedundantThrows(请参阅https://github.com/checkstyle/checkstyle/issues/473)

  • 嗨这是我的STS问题.我删除了`redundantThrows`模块,然后我关闭并打开了STS.现在工作正常 (2认同)
  • 对于新的公司:转到你的checkstyle xml并注释掉<module name ="RedundantThrows">标签 (2认同)