ST
- the flow state subclass that should be used.
If DefaultFlow is instantiated directly the type argument has to be DefaultFlowState.
In other cases, method createFlowState has to be overridden correctly!public class DefaultFlow<ST extends DefaultFlowState> extends AbstractFlow<ST>
alive, annoRelations, atypes, checker, debug, factory, flowResults, flowState, flowState_whenFalse, flowState_whenTrue, root
Constructor and Description |
---|
DefaultFlow(BaseTypeChecker checker,
@Nullable CompilationUnitTree root,
Set<@Nullable AnnotationMirror> annotations,
AnnotatedTypeFactory factory) |
Modifier and Type | Method and Description |
---|---|
protected void |
clearOnCall(@Nullable MethodTree enclMeth,
@NonNull ExecutableElement method)
Clear whatever part of the state that gets invalidated by
invoking the method.
|
protected ST |
createFlowState(Set<@Nullable AnnotationMirror> annotations)
Create the correct instance of FlowState.
|
protected void |
newVar(VariableTree tree)
Registers a new variable for flow tracking.
|
protected void |
propagate(@Nullable Tree lhs,
ExpressionTree rhs)
Moves bits as assignments are made.
|
protected void |
recordBitsImps(@Nullable Tree tree,
@Nullable Element elt) |
addFlowResult, checkArguments, containsKey, copyState, inferFromAssert, isNonFinalField, recordBits, removeFlowResult, scan, scan, scanCond, scanDef, scanExpr, scanStat, scanStats, setDebug, test, varDefHasAnnotation, visitAnnotation, visitArrayAccess, visitAssert, visitAssignment, visitBlock, visitBreak, visitClass, visitCompoundAssignment, visitConditionalExpression, visitContinue, visitDoWhileLoop, visitEnhancedForLoop, visitForLoop, visitIdentifier, visitIf, visitImport, visitMemberSelect, visitMethod, visitMethodEndCallback, visitMethodInvocation, visitReturn, visitThrow, visitTry, visitTypeCast, visitVariable, visitWhileLoop
getCurrentPath, scan
reduce, scan, visitAnnotatedType, visitArrayType, visitBinary, visitCase, visitCatch, visitCompilationUnit, visitEmptyStatement, visitErroneous, visitExpressionStatement, visitInstanceOf, visitLabeledStatement, visitLambdaExpression, visitLiteral, visitMemberReference, visitModifiers, visitNewArray, visitNewClass, visitOther, visitParameterizedType, visitParenthesized, visitPrimitiveType, visitSwitch, visitSynchronized, visitTypeParameter, visitUnary, visitUnionType, visitWildcard
public DefaultFlow(BaseTypeChecker checker, @Nullable CompilationUnitTree root, Set<@Nullable AnnotationMirror> annotations, AnnotatedTypeFactory factory)
protected ST createFlowState(Set<@Nullable AnnotationMirror> annotations)
AbstractFlow
createFlowState
in class AbstractFlow<ST extends DefaultFlowState>
annotations
- The annotations that can be inferred.protected void newVar(VariableTree tree)
AbstractFlow
newVar
in class AbstractFlow<ST extends DefaultFlowState>
tree
- the variable to registerprotected void propagate(@Nullable Tree lhs, ExpressionTree rhs)
AbstractFlow
If only type information (and not a Tree
) is available, use
AbstractFlow.propagateFromType(Tree, AnnotatedTypeMirror)
instead.
propagate
in class AbstractFlow<ST extends DefaultFlowState>
lhs
- the left-hand side of the assignmentrhs
- the right-hand side of the assignmentprotected void recordBitsImps(@Nullable Tree tree, @Nullable Element elt)
recordBitsImps
in class AbstractFlow<ST extends DefaultFlowState>
protected void clearOnCall(@Nullable MethodTree enclMeth, @NonNull ExecutableElement method)
AbstractFlow
clearOnCall
in class AbstractFlow<ST extends DefaultFlowState>
enclMeth
- The method within which "method" is called.
Might be null if the invocation is in a field initializer.method
- The invoked method.