com.puppycrawl.tools.checkstyle.checks.coding

Class ParameterAssignmentCheck

Implemented Interfaces:
Configurable, Contextualizable

public final class ParameterAssignmentCheck
extends Check

Disallow assignment of parameters.

Rationale: Parameter assignment is often considered poor programming practice. Forcing developers to declare parameters as final is often onerous. Having a check ensure that parameters are never assigned would give the best of both worlds.

Author:
Simon Harris

Method Summary

void
beginTree(DetailAST aRootAST)
int[]
getDefaultTokens()
int[]
getRequiredTokens()
void
leaveToken(DetailAST aAST)
void
visitToken(DetailAST aAST)

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

beginTree

public void beginTree(DetailAST aRootAST)
Overrides:
beginTree in interface Check


getDefaultTokens

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


getRequiredTokens

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


leaveToken

public void leaveToken(DetailAST aAST)
Overrides:
leaveToken in interface Check


visitToken

public void visitToken(DetailAST aAST)
Overrides:
visitToken in interface Check