class UnnecessaryDefInVariableDeclarationRule extends AbstractAstVisitorRule
If a variable has a visibility modifier or a type declaration, then the def keyword is unneeded. For instance 'def private n = 2' is redundant and can be simplified to 'private n = 2'.
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 |
java.lang.String |
name |
int |
priority |
Constructor and description |
---|
UnnecessaryDefInVariableDeclarationRule
() |
Groovy Documentation