Checkstyle 6.2 issue with RedundantThrows check

1,577 views
Skip to first unread message

Neon Ngo

unread,
Jan 20, 2015, 11:39:23 AM1/20/15
to check...@googlegroups.com
This is not an issue in Checkstyle 6.1.1 only in 6.2.

I have a check configuration file that has RedundantThrows module specified, e.g.
    <module name="RedundantThrows">
      <property name="allowUnchecked" value="true"/>
      <property name="allowSubclasses" value="true"/>
      <property name="suppressLoadErrors" value="true"/>
    </module>

I get the following error / exception when running Checkstyle 6.2.

Unable to create Checker: cannot initialize module TreeWalker - Unable to instantiate RedundantThrows
com.puppycrawl.tools.checkstyle.api.CheckstyleException: cannot initialize module TreeWalker - Unable to instantiate RedundantThrows
    at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:179)
    at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:185)
    at com.puppycrawl.tools.checkstyle.Main.createChecker(Main.java:151)
    at com.puppycrawl.tools.checkstyle.Main.main(Main.java:128)
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: Unable to instantiate RedundantThrows
    at com.puppycrawl.tools.checkstyle.PackageObjectFactory.createModule(PackageObjectFactory.java:156)
    at com.puppycrawl.tools.checkstyle.TreeWalker.setupChild(TreeWalker.java:177)
    at com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:185)
    at com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:158)
    ... 3 more
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException: Unable to instantiate RedundantThrowsCheck
    at com.puppycrawl.tools.checkstyle.PackageObjectFactory.doMakeObject(PackageObjectFactory.java:98)
    at com.puppycrawl.tools.checkstyle.PackageObjectFactory.createModule(PackageObjectFactory.java:153)
    ... 6 more

Did the RedundantThrows check get removed or was not packaged in Checkstyle 6.2?

Regards,

Neon

Neon Ngo

unread,
Jan 20, 2015, 2:06:13 PM1/20/15
to check...@googlegroups.com
Ok, the Checkstyle 6.2 release notes does mention this. My initial search failed, since the RN had it as two words (Redundant Throws).

http://checkstyle.sourceforge.net/releasenotes.html

Release 6.2

...

Breaking backward compatibility:

  • Checkstyle is switched to jdk7. Author: Roman Ivanov. commit.
  • Abstract Aware Type Check marked as deprecated, removed Redundant Throws Check. Author: Alex Kravin #473
  • JUnitTestCaseCheck was removed from Checkstyle. Author: ychulovskyy #457
  • Remove StrictDuplicateCodeCheck and whole package. Author: Michal Kordas #523
  • removing ignoreDirectoryName option from PackageDeclarationCheck. Author: Ivan Sopov #209
I guess we have to remove RedundantThrows from our check configuration.
BTW: we got this error since we updated the Eclipse Checkstyle Plugin update (to version 6.2.0) after an update check.
Ideally, API/breakages like this should increment the major version number to signal breakages by using semantic version policy.

Regards,

Neon

Reply all
Reply to author
Forward
0 new messages