- Checks for redundant exceptions declared in a throws clause such as
- duplicates, unchecked exceptions or subclasses of another declared
- exception.
-
| name | -description | -type | -default value | -
|---|---|---|---|
| allowUnchecked | -whether unchecked exceptions in throws are allowed or not | -boolean | -false |
-
| allowSubclasses | -whether subclasses of another declared exception - are allowed in throws clause | -boolean | -false |
-
| logLoadErrors | -This check may need to load exception classes mentioned in
- the @throws tag to check whether they are RuntimeExceptions.
- If loading the class fails, this property allows controlling
- Checkstyle's error handling. If set to false a
- classpath configuration problem is assumed and the TreeWalker
- stops operating on the class completely.
- If set to true (the default), Checkstyle assumes a
- typo or refactoring problem in the
- javadoc and logs the problem in the normal Checkstyle report
- (potentially masking a configuration error). |
- boolean | -true |
-
| suppressLoadErrors | -When logLoadErrors is set to true, the TreeWalker completely - processes a class and displays any problems with loading exceptions - as Checkstyle violations. - When this property is set to true, the violations generated when - logLoadErrors is true are suppressed from being reported as - violations in the Checkstyle report. - | -boolean | -false |
-
- To configure the default check: -
-- To configure the check to allow unchecked exception in throws clause -
-- The classpath should be configured to locate the class - information. The classpath configuration is dependent on the - mechanism used to invoke Checkstyle. -
-- com.puppycrawl.tools.checkstyle.checks.coding -
-- TreeWalker -
-