Groovy Documentation

Package org.codenarc.rule.basic

 

Class Summary
AbstractConstructorCallAstVisitor Abstract superclass for AST Visitor classes that deal with constructor calls
AbstractFinallyAstVisitor Abstract superclass for AST Visitor classes that check for conditions within a finally block
BooleanInstantiationAstVisitor
BooleanInstantiationRule Rule that checks for direct call to Boolean constructor - use Boolean.valueOf() instead.
CloneableWithoutCloneAstVisitor
CloneableWithoutCloneRule A class that implements Cloneable should define a clone() method.
ConstantIfExpressionAstVisitor
ConstantIfExpressionRule Rule that checks for if statement with a constant value for the if expression, such as:
  • if (true) { .. }
  • if (false) { .. }
  • if (Boolean.TRUE) { .. }
  • if (Boolean.FALSE) { .. }
  • if (null) { .. }
  • if (0) { .. }
  • if (99.7) { .. }
  • if ("") { .. }
  • if ("abc") { .. }
ConstantTernaryExpressionAstVisitor
ConstantTernaryExpressionRule Rule that checks for ternary expressions with a constant value for the boolean expression, such as:
  • true ?
EmptyCatchBlockAstVisitor
EmptyCatchBlockRule Rule that checks for empty catch blocks
EmptyElseBlockAstVisitor
EmptyElseBlockRule Rule that checks for empty else blocks
EmptyFinallyBlockAstVisitor
EmptyFinallyBlockRule Rule that checks for empty finally blocks
EmptyForStatementAstVisitor
EmptyForStatementRule Rule that checks for empty for statements
EmptyIfStatementAstVisitor
EmptyIfStatementRule Rule that checks for empty if statements
EmptySwitchStatementAstVisitor
EmptySwitchStatementRule Rule that checks for empty switch statements
EmptySynchronizedStatementAstVisitor
EmptySynchronizedStatementRule Rule that checks for empty synchronized statement
EmptyTryBlockAstVisitor
EmptyTryBlockRule Rule that checks for empty try blocks
EmptyWhileStatementAstVisitor
EmptyWhileStatementRule Rule that checks for empty while statements
EqualsAndHashCodeAstVisitor
EqualsAndHashCodeRule Rule that checks that if either the boolean equals(Object) or the int hashCode() methods are overridden within a class, then both must be overridden.
ReturnFromFinallyBlockAstVisitor
ReturnFromFinallyBlockRule Rule that checks for a return from within a finally block
ReturnFromFinallyRule
StringInstantiationAstVisitor
StringInstantiationRule Rule that checks for direct call to the String constructor that accepts a String literal.
ThrowExceptionFromFinallyBlockAstVisitor
ThrowExceptionFromFinallyBlockRule Rule that checks for throwing an exception from within a finally block
ThrowExceptionFromFinallyRule
UnnecessaryTernaryExpressionAstVisitor
UnnecessaryTernaryExpressionRule Rule that checks for ternary expressions where the conditional expression always evaluates to a boolean and the true and false expressions are merely returning true and false constants.
 


Groovy Documentation