public class InnerAssignmentCheck extends Check
Checks for assignments in subexpressions, such as in
String s = Integer.toString(i = 2);.
Rationale: With the exception of for iterators, all assignments
should occur in their own toplevel statement to increase readability.
With inner assignments like the above it is difficult to see all places
where a variable is set.
| Constructor and Description |
|---|
InnerAssignmentCheck() |
| Modifier and Type | Method and Description |
|---|---|
int[] |
getDefaultTokens()
Returns the default token a check is interested in.
|
void |
visitToken(DetailAST aAST)
Called to process a token.
|
beginTree, destroy, finishTree, getAcceptableTokens, getClassLoader, getFileContents, getLines, getRequiredTokens, getTabWidth, getTokenNames, init, leaveToken, log, log, setClassLoader, setFileContents, setMessages, setTabWidth, setTokensgetCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, log, setId, setSeverityconfigure, contextualize, finishLocalSetup, getConfiguration, setupChildpublic int[] getDefaultTokens()
CheckgetDefaultTokens in class CheckTokenTypespublic void visitToken(DetailAST aAST)
CheckvisitToken in class CheckaAST - the token to processCopyright © 2001-2012. All Rights Reserved.