Package: org.codehaus.groovy.classgen.asm

## [Java] Class ClosureWriter.CorrectAccessedVariableVisitor

- org.codehaus.groovy.classgen.asm.ClosureWriter.CorrectAccessedVariableVisitor

-     protected static class ClosureWriter.CorrectAccessedVariableVisitor
      extends CodeVisitorSupport

  Visitor that rewrites VariableExpression nodes whose accessed variable is a FieldNode in an outer class to instead reference the corresponding field in the generated closure inner class.

- - ### Constructor Summary

    Constructors
    Constructor and description
    `CorrectAccessedVariableVisitor(InnerClassNode icn)` Creates a visitor for the generated closure class.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public void` | `visitVariableExpression(VariableExpression expression)` * Visits a VariableExpression. No traversal is performed as variable expressions contain no child expressions. * * Parameters: `expression` - the variable expression

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class CodeVisitorSupport` | `afterSwitchCaseStatementsVisited, 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, visitSynchronizedStatement, visitTernaryExpression, visitThrowStatement, visitTryCatchFinally, visitTupleExpression, visitUnaryMinusExpression, visitUnaryPlusExpression, visitVariableExpression, visitWhileLoop`

- - ### Constructor Detail

    - #### public CorrectAccessedVariableVisitor(InnerClassNode icn)

      Creates a visitor for the generated closure class.

      Parameters:
        `icn` - the generated closure class

  - ### Method Detail

    - #### public void visitVariableExpression(VariableExpression expression)

      * Visits a VariableExpression. No traversal is performed as variable expressions contain no child expressions. * *

      Parameters:
        `expression` - the variable expression