public class SharedVariableCollector
extends ClassCodeVisitorSupport
A visitor which collects the list of variable expressions which are closure shared.
| Constructor and description |
|---|
SharedVariableCollector(SourceUnit unit)Creates a collector for the supplied source unit. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public Set<VariableExpression> |
getClosureSharedExpressions()Returns the collected closure-shared variable expressions. |
|
protected SourceUnit |
getSourceUnit()* Provides access to the SourceUnit for error reporting during visitation. * Implementations must override this method. * *
|
|
public void |
visitVariableExpression(VariableExpression expression)Records closure-shared variables while avoiding recursive closure traversal. |
Creates a collector for the supplied source unit.
Returns the collected closure-shared variable expressions.
* Provides access to the SourceUnit for error reporting during visitation. * Implementations must override this method. * *
Records closure-shared variables while avoiding recursive closure traversal.
Copyright © 2003-2026 The Apache Software Foundation. All rights reserved.