APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.tools.javac.comp

public Class CaptureScanner

extends TreeScanner
Class Inheritance
Known Direct Subclasses
com.sun.tools.javac.comp.LambdaToMethod.LambdaTranslationContext.LambdaCaptureScanner, com.sun.tools.javac.comp.Lower.FreeVarCollector
Imports
com.sun.tools.javac.code.Symbol, .Symbol.VarSymbol, com.sun.tools.javac.tree.JCTree, .TreeScanner, com.sun.tools.javac.util.List, java.util.HashSet, .LinkedHashSet, .SequencedSet, .Set

A visitor which collects the set of local variables "captured" by a given tree.

Field Summary

Modifier and TypeField and Description
private final SequencedSet<Symbol.VarSymbol>
fvs

The set of captured local variables accessed from within the tree under analysis.

private final Set<Symbol.VarSymbol>
seenVars

The set of local variable declarations encountered in the tree under analysis.

private final JCTree
tree

The tree under analysis.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
addFreeVar(Symbol.VarSymbol v)

Add free variable to fvs list unless it is already there.

pack-priv List<Symbol.VarSymbol>
analyzeCaptures()

Obtains the list of captured local variables in the tree under analysis.

public void
public void
Inherited from com.sun.tools.javac.tree.TreeScanner:
scanscanvisitAnnotatedTypevisitAnnotationvisitAnyPatternvisitApplyvisitAssertvisitAssignvisitAssignopvisitBinaryvisitBindingPatternvisitBlockvisitBreakvisitCasevisitCatchvisitClassDefvisitConditionalvisitConstantCaseLabelvisitContinuevisitDefaultCaseLabelvisitDoLoopvisitErroneousvisitExecvisitExportsvisitForeachLoopvisitForLoopvisitIfvisitImportvisitIndexedvisitLabelledvisitLambdavisitLetExprvisitLiteralvisitMethodDefvisitModifiersvisitModuleDefvisitModuleImportvisitNewArrayvisitNewClassvisitOpensvisitPackageDefvisitParensvisitPatternCaseLabelvisitProvidesvisitRecordPatternvisitReferencevisitRequiresvisitReturnvisitSelectvisitSkipvisitSwitchvisitSwitchExpressionvisitSynchronizedvisitThrowvisitTopLevelvisitTreevisitTryvisitTypeApplyvisitTypeArrayvisitTypeBoundKindvisitTypeCastvisitTypeIdentvisitTypeIntersectionvisitTypeParametervisitTypeTestvisitTypeUnionvisitUnaryvisitUsesvisitVarTypevisitWhileLoopvisitWildcardvisitYield

Field Detail

fvsback to summary
private final SequencedSet<Symbol.VarSymbol> fvs

The set of captured local variables accessed from within the tree under analysis.

seenVarsback to summary
private final Set<Symbol.VarSymbol> seenVars

The set of local variable declarations encountered in the tree under analysis.

treeback to summary
private final JCTree tree

The tree under analysis.

Constructor Detail

CaptureScannerback to summary
public CaptureScanner(JCTree ownerTree)

Method Detail

addFreeVarback to summary
protected void addFreeVar(Symbol.VarSymbol v)

Add free variable to fvs list unless it is already there.

analyzeCapturesback to summary
pack-priv List<Symbol.VarSymbol> analyzeCaptures()

Obtains the list of captured local variables in the tree under analysis.

visitIdentback to summary
public void visitIdent(JCTree.JCIdent tree)

Overrides com.sun.tools.javac.tree.TreeScanner.visitIdent.

Annotations
@Override
visitVarDefback to summary
public void visitVarDef(JCTree.JCVariableDecl tree)

Overrides com.sun.tools.javac.tree.TreeScanner.visitVarDef.

Annotations
@Override