|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.puppycrawl.tools.checkstyle.api.AutomaticBean
com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter
com.puppycrawl.tools.checkstyle.api.Check
com.puppycrawl.tools.checkstyle.checks.AbstractTypeAwareCheck
com.puppycrawl.tools.checkstyle.checks.coding.RedundantThrowsCheck
Checks for redundant exceptions declared in throws clause such as duplicates, unchecked exceptions or subclasses of another declared exception.
An example of how to configure the check is:
<module name="RedundantThrows">
<property name="allowUnchecked" value="true"/>
<property name="allowSubclasses" value="true"/>
</module>
| Nested Class Summary |
| Nested classes inherited from class com.puppycrawl.tools.checkstyle.checks.AbstractTypeAwareCheck |
AbstractTypeAwareCheck.ClassInfo |
| Constructor Summary | |
RedundantThrowsCheck()
Create an object. |
|
| Method Summary | |
int[] |
getDefaultTokens()
Returns the default token a check is interested in. |
protected void |
logLoadError(FullIdent aIdent)
Logs error if unable to load class information. |
protected void |
processAST(DetailAST aAST)
Checks exceptions declared in throws for a method or constructor. |
void |
setAllowSubclasses(boolean aAllowSubclasses)
Getter for allowSubclasses property. |
void |
setAllowUnchecked(boolean aAllowUnchecked)
Getter for allowUnchecked property. |
| Methods inherited from class com.puppycrawl.tools.checkstyle.checks.AbstractTypeAwareCheck |
beginTree, getCurrentClassName, isSameType, isShortName, isSubclass, isUnchecked, leaveToken, resolveClass, tryLoadClass, visitToken |
| Methods inherited from class com.puppycrawl.tools.checkstyle.api.Check |
destroy, finishTree, getAcceptableTokens, getClassLoader, getFileContents, getLines, getRequiredTokens, getTabWidth, getTokenNames, init, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokens |
| Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter |
getMessageBundle, getSeverity, getSeverityLevel, log, log, log, log, log, log, log, log, log, setSeverity |
| Methods inherited from class com.puppycrawl.tools.checkstyle.api.AutomaticBean |
configure, contextualize, finishLocalSetup, getConfiguration, setupChild |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public RedundantThrowsCheck()
| Method Detail |
public void setAllowUnchecked(boolean aAllowUnchecked)
aAllowUnchecked - whether unchecked excpetions in throws
are allowed or notpublic void setAllowSubclasses(boolean aAllowSubclasses)
aAllowSubclasses - whether subclass of another declared
exception is allowed in throws clausepublic int[] getDefaultTokens()
Check
getDefaultTokens in class CheckCheckprotected final void processAST(DetailAST aAST)
processAST in class AbstractTypeAwareCheckaAST - the tree node for the method or constructor.protected final void logLoadError(FullIdent aIdent)
logLoadError in class AbstractTypeAwareCheckaIdent - class name for which we can no load class.
|
Back to the Checkstyle Home Page | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||