public class LogicConditionNeedOptimizationCheck
extends com.puppycrawl.tools.checkstyle.api.AbstractCheck
This check prevents the placement of local variables and fields after calling methods and instanceof in '&&' and '||' conditions.
For example: if(getProperty() && property) ==> if(property && getProperty()), and similarly for any expression.
| Modifier and Type | Field and Description |
|---|---|
static String |
MSG_KEY
The key is pointing to the warning message text in "messages.properties"
file.
|
| Constructor and Description |
|---|
LogicConditionNeedOptimizationCheck() |
| Modifier and Type | Method and Description |
|---|---|
int[] |
getAcceptableTokens() |
int[] |
getDefaultTokens() |
int[] |
getRequiredTokens() |
void |
visitToken(com.puppycrawl.tools.checkstyle.api.DetailAST detailAST) |
beginTree, clearMessages, destroy, finishTree, getFileContents, getLine, getLines, getMessages, getTabWidth, getTokenNames, init, isCommentNodesRequired, leaveToken, log, log, log, setFileContents, setTabWidth, setTokensfinishLocalSetup, getCustomMessages, getId, getMessageBundle, getSeverity, getSeverityLevel, setId, setSeveritypublic static final String MSG_KEY
public int[] getDefaultTokens()
getDefaultTokens in class com.puppycrawl.tools.checkstyle.api.AbstractCheckpublic int[] getAcceptableTokens()
getAcceptableTokens in class com.puppycrawl.tools.checkstyle.api.AbstractCheckpublic int[] getRequiredTokens()
getRequiredTokens in class com.puppycrawl.tools.checkstyle.api.AbstractCheckpublic void visitToken(com.puppycrawl.tools.checkstyle.api.DetailAST detailAST)
visitToken in class com.puppycrawl.tools.checkstyle.api.AbstractCheckCopyright © 2021. All rights reserved.