com.puppycrawl.tools.checkstyle.checks.coding
Class RedundantThrowsCheck
- Configurable, Contextualizable
public class 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>
- o_sukhodolsky
beginTree , getCurrentClassName , isSameType , isShortName , isSubclass , isUnchecked , leaveToken , logLoadError , processAST , resolveClass , tryLoadClass , visitToken |
beginTree , destroy , finishTree , getAcceptableTokens , getClassLoader , getDefaultTokens , getFileContents , getLines , getRequiredTokens , getTabWidth , getTokenNames , init , leaveToken , log , log , setClassLoader , setFileContents , setMessages , setTabWidth , setTokens , visitToken |
getMessageBundle , getSeverity , getSeverityLevel , log , log , log , log , log , log , log , log , log , log , log , setSeverity |
RedundantThrowsCheck
public RedundantThrowsCheck()
Create an object.
getDefaultTokens
public int[] getDefaultTokens()
- getDefaultTokens in interface Check
Check
logLoadError
protected final void logLoadError(FullIdent aIdent)
Logs error if unable to load class information.
- logLoadError in interface AbstractTypeAwareCheck
aIdent
- class name for which we can no load class.
processAST
protected final void processAST(DetailAST aAST)
Checks exceptions declared in throws for a method or constructor.
- processAST in interface AbstractTypeAwareCheck
aAST
- the tree node for the method or constructor.
setAllowSubclasses
public void setAllowSubclasses(boolean aAllowSubclasses)
Getter for allowSubclasses property.
aAllowSubclasses
- whether subclass of another declared
exception is allowed in throws clause
setAllowUnchecked
public void setAllowUnchecked(boolean aAllowUnchecked)
Getter for allowUnchecked property.
aAllowUnchecked
- whether unchecked excpetions in throws
are allowed or not