Checks for: (1) An if statements where both the if and else blocks contain only a single return statement with a constant or literal value. (2) When the second-to-last statement in a block is an if statement with no else, where the block contains a single return statement, and the last statement in the block is a return statement, and both return statements return a constant or literal value. This checks can be disabled by setting checkLastStatementImplicitElse to false.
| Fields inherited from class | Fields |
|---|---|
class AbstractAstVisitorRule |
CLOSURE_TEXT, DEFAULT_CONST_NAME, DEFAULT_FIELD_NAME, DEFAULT_TEST_CLASS_NAMES, DEFAULT_TEST_FILES, DEFAULT_VAR_NAME |
| Type | Name and description |
|---|---|
java.lang.Class |
astVisitorClass |
boolean |
checkLastStatementImplicitElse |
java.lang.String |
name |
int |
priority |