com.puppycrawl.tools.checkstyle.checks.usage

Class UnusedParameterCheck

Implemented Interfaces:
Configurable, Contextualizable

public class UnusedParameterCheck
extends AbstractUsageCheck

Checks that a parameter is used.

An example of how to configure the check is:

 <module name="usage.UnusedParameter"/>
 

Author:
Rick Giles

Method Summary

int[]
getDefaultTokens()
String
getErrorKey()
boolean
mustCheckReferenceCount(DetailAST aAST)
void
setIgnoreCatch(boolean aIgnoreCatch)
Control whether unused catch clause parameters are flagged.
void
setIgnoreNonLocal(boolean aIgnoreNonLocal)
Controls whether public/protected/paskage methods shouldn't be checked.

Methods inherited from class com.puppycrawl.tools.checkstyle.checks.usage.AbstractUsageCheck

applyTo, beginTree, finishTree, getASTManager, getErrorKey, getIgnoreFormat, getRegexp, logError, mustCheckReferenceCount, setIgnoreFormat, visitToken

Methods inherited from class com.puppycrawl.tools.checkstyle.api.Check

beginTree, destroy, finishTree, getAcceptableTokens, getClassLoader, getDefaultTokens, getFileContents, getLines, getRequiredTokens, getTabWidth, getTokenNames, init, leaveToken, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokens, visitToken

Methods inherited from class com.puppycrawl.tools.checkstyle.api.AbstractViolationReporter

getMessageBundle, getSeverity, getSeverityLevel, log, log, 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

Method Details

getDefaultTokens

public int[] getDefaultTokens()
Overrides:
getDefaultTokens in interface Check

See Also:
Check


getErrorKey

public String getErrorKey()
Overrides:
getErrorKey in interface AbstractUsageCheck

See Also:
AbstractUsageCheck


mustCheckReferenceCount

public boolean mustCheckReferenceCount(DetailAST aAST)
Overrides:
mustCheckReferenceCount in interface AbstractUsageCheck

See Also:
AbstractUsageCheck


setIgnoreCatch

public void setIgnoreCatch(boolean aIgnoreCatch)
Control whether unused catch clause parameters are flagged.

Parameters:
aIgnoreCatch - whether unused catch clause parameters should be flagged.


setIgnoreNonLocal

public void setIgnoreNonLocal(boolean aIgnoreNonLocal)
Controls whether public/protected/paskage methods shouldn't be checked.

Parameters:
aIgnoreNonLocal - whether we should check any other methods except static and private should be checked.