Package: org.codehaus.groovy.transform.tailrec

## [Java] Class ReturnAdderForClosures

- org.codehaus.groovy.transform.tailrec.ReturnAdderForClosures

-     public class ReturnAdderForClosures
      extends CodeVisitorSupport

  Adds explicit return statements to implicit return points in a closure. This is necessary since tail-recursion is detected by having the recursive call within the return statement.

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public void` | `visitClosureExpression(ClosureExpression expression)` * Visits a ClosureExpression, traversing parameter initializers and the closure code block. * * Parameters: `expression` - the closure expression
    `` | `public void` | `visitMethod(MethodNode method)` Adds explicit return statements to closures contained in the supplied method.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class CodeVisitorSupport` | `afterSwitchCaseStatementsVisited, afterSwitchCaseStatementsVisited, afterSwitchConditionExpressionVisited, afterSwitchConditionExpressionVisited, visitArgumentlistExpression, visitArrayExpression, visitAssertStatement, visitAttributeExpression, visitBinaryExpression, visitBitwiseNegationExpression, visitBlockStatement, visitBooleanExpression, visitBreakStatement, visitBytecodeExpression, visitCaseStatement, visitCastExpression, visitCatchStatement, visitClassExpression, visitClosureExpression, visitClosureListExpression, visitConstantExpression, visitConstructorCallExpression, visitContinueStatement, visitDeclarationExpression, visitDoWhileLoop, visitEmptyStatement, visitExpressionStatement, visitFieldExpression, visitForLoop, visitGStringExpression, visitIfElse, visitLambdaExpression, visitListExpression, visitMapEntryExpression, visitMapExpression, visitMethodCallExpression, visitMethodPointerExpression, visitMethodReferenceExpression, visitNotExpression, visitPostfixExpression, visitPrefixExpression, visitPropertyExpression, visitRangeExpression, visitReturnStatement, visitShortTernaryExpression, visitSpreadExpression, visitSpreadMapExpression, visitStaticMethodCallExpression, visitSwitch, visitSwitchExpression, visitSynchronizedStatement, visitTernaryExpression, visitThrowStatement, visitTryCatchFinally, visitTupleExpression, visitUnaryMinusExpression, visitUnaryPlusExpression, visitVariableExpression, visitWhileLoop, visitYieldStatement`

- - ### Method Detail

    - #### public void visitClosureExpression(ClosureExpression expression)

      * Visits a ClosureExpression, traversing parameter initializers and the closure code block. * *

      Parameters:
        `expression` - the closure expression

    - #### public void visitMethod(MethodNode method)

      Adds explicit return statements to closures contained in the supplied method.

      Parameters:
        `method` - the method whose closures should be normalized