Java - Checkstyle - Redundant Throws

2020-08-09 05:58发布

问题:

I'm using STS and installed checkstyle plugin. Using install new software with this 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.

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

<module name="RedundantThrows">
            <property name="logLoadErrors" value="true" />
            <property name="suppressLoadErrors" value="true" />
        </module>

How to fix the problem?

Thanks.

回答1:

RedundantThrows was removed with version 6.2 (see https://github.com/checkstyle/checkstyle/issues/473)



回答2:

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