Class ControlFlowVisitor
java.lang.Object
com.sun.source.util.SimpleTreeVisitor<ControlFlowVisitor.Result,com.google.errorprone.refaster.ControlFlowVisitor.BreakContext>
com.google.errorprone.refaster.ControlFlowVisitor
- All Implemented Interfaces:
com.sun.source.tree.TreeVisitor<ControlFlowVisitor.Result,
com.google.errorprone.refaster.ControlFlowVisitor.BreakContext>
public class ControlFlowVisitor
extends com.sun.source.util.SimpleTreeVisitor<ControlFlowVisitor.Result,com.google.errorprone.refaster.ControlFlowVisitor.BreakContext>
Analyzes a series of statements to determine whether they don't, sometimes, or never return.
- Author:
- lowasser@google.com (Louis Wasserman)
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
The state of whether a sequence of statements may return, break out of the visited statements, or neither. -
Field Summary
Fields inherited from class com.sun.source.util.SimpleTreeVisitor
DEFAULT_VALUE
-
Method Summary
Modifier and TypeMethodDescriptionprotected ControlFlowVisitor.Result
defaultAction
(com.sun.source.tree.Tree node, com.google.errorprone.refaster.ControlFlowVisitor.BreakContext cxt) visitBlock
(com.sun.source.tree.BlockTree node, com.google.errorprone.refaster.ControlFlowVisitor.BreakContext cxt) visitBreak
(com.sun.source.tree.BreakTree node, com.google.errorprone.refaster.ControlFlowVisitor.BreakContext cxt) visitCase
(com.sun.source.tree.CaseTree node, com.google.errorprone.refaster.ControlFlowVisitor.BreakContext cxt) visitCatch
(com.sun.source.tree.CatchTree node, com.google.errorprone.refaster.ControlFlowVisitor.BreakContext cxt) visitContinue
(com.sun.source.tree.ContinueTree node, com.google.errorprone.refaster.ControlFlowVisitor.BreakContext cxt) visitDoWhileLoop
(com.sun.source.tree.DoWhileLoopTree node, com.google.errorprone.refaster.ControlFlowVisitor.BreakContext cxt) visitEnhancedForLoop
(com.sun.source.tree.EnhancedForLoopTree node, com.google.errorprone.refaster.ControlFlowVisitor.BreakContext cxt) visitExpressionStatement
(com.sun.source.tree.ExpressionStatementTree node, com.google.errorprone.refaster.ControlFlowVisitor.BreakContext cxt) visitForLoop
(com.sun.source.tree.ForLoopTree node, com.google.errorprone.refaster.ControlFlowVisitor.BreakContext cxt) visitIf
(com.sun.source.tree.IfTree node, com.google.errorprone.refaster.ControlFlowVisitor.BreakContext cxt) visitLabeledStatement
(com.sun.source.tree.LabeledStatementTree node, com.google.errorprone.refaster.ControlFlowVisitor.BreakContext cxt) visitReturn
(com.sun.source.tree.ReturnTree node, com.google.errorprone.refaster.ControlFlowVisitor.BreakContext cxt) visitStatement
(com.sun.source.tree.StatementTree node) visitStatements
(Iterable<? extends com.sun.source.tree.StatementTree> nodes) visitSwitch
(com.sun.source.tree.SwitchTree node, com.google.errorprone.refaster.ControlFlowVisitor.BreakContext cxt) visitSynchronized
(com.sun.source.tree.SynchronizedTree node, com.google.errorprone.refaster.ControlFlowVisitor.BreakContext cxt) visitThrow
(com.sun.source.tree.ThrowTree node, com.google.errorprone.refaster.ControlFlowVisitor.BreakContext cxt) visitTry
(com.sun.source.tree.TryTree node, com.google.errorprone.refaster.ControlFlowVisitor.BreakContext cxt) visitWhileLoop
(com.sun.source.tree.WhileLoopTree node, com.google.errorprone.refaster.ControlFlowVisitor.BreakContext cxt) Methods inherited from class com.sun.source.util.SimpleTreeVisitor
visit, visit, visitAnnotatedType, visitAnnotation, visitAnyPattern, visitArrayAccess, visitArrayType, visitAssert, visitAssignment, visitBinary, visitBindingPattern, visitClass, visitCompilationUnit, visitCompoundAssignment, visitConditionalExpression, visitConstantCaseLabel, visitDeconstructionPattern, visitDefaultCaseLabel, visitEmptyStatement, visitErroneous, visitExports, visitIdentifier, visitImport, visitInstanceOf, visitIntersectionType, visitLambdaExpression, visitLiteral, visitMemberReference, visitMemberSelect, visitMethod, visitMethodInvocation, visitModifiers, visitModule, visitNewArray, visitNewClass, visitOpens, visitOther, visitPackage, visitParameterizedType, visitParenthesized, visitPatternCaseLabel, visitPrimitiveType, visitProvides, visitRequires, visitSwitchExpression, visitTypeCast, visitTypeParameter, visitUnary, visitUnionType, visitUses, visitVariable, visitWildcard, visitYield
-
Field Details
-
INSTANCE
-
-
Method Details
-
visitStatement
-
visitStatements
public ControlFlowVisitor.Result visitStatements(Iterable<? extends com.sun.source.tree.StatementTree> nodes) -
defaultAction
protected ControlFlowVisitor.Result defaultAction(com.sun.source.tree.Tree node, com.google.errorprone.refaster.ControlFlowVisitor.BreakContext cxt) - Overrides:
defaultAction
in classcom.sun.source.util.SimpleTreeVisitor<ControlFlowVisitor.Result,
com.google.errorprone.refaster.ControlFlowVisitor.BreakContext>
-
visitBlock
public ControlFlowVisitor.Result visitBlock(com.sun.source.tree.BlockTree node, com.google.errorprone.refaster.ControlFlowVisitor.BreakContext cxt) - Specified by:
visitBlock
in interfacecom.sun.source.tree.TreeVisitor<ControlFlowVisitor.Result,
com.google.errorprone.refaster.ControlFlowVisitor.BreakContext> - Overrides:
visitBlock
in classcom.sun.source.util.SimpleTreeVisitor<ControlFlowVisitor.Result,
com.google.errorprone.refaster.ControlFlowVisitor.BreakContext>
-
visitDoWhileLoop
public ControlFlowVisitor.Result visitDoWhileLoop(com.sun.source.tree.DoWhileLoopTree node, com.google.errorprone.refaster.ControlFlowVisitor.BreakContext cxt) - Specified by:
visitDoWhileLoop
in interfacecom.sun.source.tree.TreeVisitor<ControlFlowVisitor.Result,
com.google.errorprone.refaster.ControlFlowVisitor.BreakContext> - Overrides:
visitDoWhileLoop
in classcom.sun.source.util.SimpleTreeVisitor<ControlFlowVisitor.Result,
com.google.errorprone.refaster.ControlFlowVisitor.BreakContext>
-
visitWhileLoop
public ControlFlowVisitor.Result visitWhileLoop(com.sun.source.tree.WhileLoopTree node, com.google.errorprone.refaster.ControlFlowVisitor.BreakContext cxt) - Specified by:
visitWhileLoop
in interfacecom.sun.source.tree.TreeVisitor<ControlFlowVisitor.Result,
com.google.errorprone.refaster.ControlFlowVisitor.BreakContext> - Overrides:
visitWhileLoop
in classcom.sun.source.util.SimpleTreeVisitor<ControlFlowVisitor.Result,
com.google.errorprone.refaster.ControlFlowVisitor.BreakContext>
-
visitForLoop
public ControlFlowVisitor.Result visitForLoop(com.sun.source.tree.ForLoopTree node, com.google.errorprone.refaster.ControlFlowVisitor.BreakContext cxt) - Specified by:
visitForLoop
in interfacecom.sun.source.tree.TreeVisitor<ControlFlowVisitor.Result,
com.google.errorprone.refaster.ControlFlowVisitor.BreakContext> - Overrides:
visitForLoop
in classcom.sun.source.util.SimpleTreeVisitor<ControlFlowVisitor.Result,
com.google.errorprone.refaster.ControlFlowVisitor.BreakContext>
-
visitEnhancedForLoop
public ControlFlowVisitor.Result visitEnhancedForLoop(com.sun.source.tree.EnhancedForLoopTree node, com.google.errorprone.refaster.ControlFlowVisitor.BreakContext cxt) - Specified by:
visitEnhancedForLoop
in interfacecom.sun.source.tree.TreeVisitor<ControlFlowVisitor.Result,
com.google.errorprone.refaster.ControlFlowVisitor.BreakContext> - Overrides:
visitEnhancedForLoop
in classcom.sun.source.util.SimpleTreeVisitor<ControlFlowVisitor.Result,
com.google.errorprone.refaster.ControlFlowVisitor.BreakContext>
-
visitSwitch
public ControlFlowVisitor.Result visitSwitch(com.sun.source.tree.SwitchTree node, com.google.errorprone.refaster.ControlFlowVisitor.BreakContext cxt) - Specified by:
visitSwitch
in interfacecom.sun.source.tree.TreeVisitor<ControlFlowVisitor.Result,
com.google.errorprone.refaster.ControlFlowVisitor.BreakContext> - Overrides:
visitSwitch
in classcom.sun.source.util.SimpleTreeVisitor<ControlFlowVisitor.Result,
com.google.errorprone.refaster.ControlFlowVisitor.BreakContext>
-
visitCase
public ControlFlowVisitor.Result visitCase(com.sun.source.tree.CaseTree node, com.google.errorprone.refaster.ControlFlowVisitor.BreakContext cxt) - Specified by:
visitCase
in interfacecom.sun.source.tree.TreeVisitor<ControlFlowVisitor.Result,
com.google.errorprone.refaster.ControlFlowVisitor.BreakContext> - Overrides:
visitCase
in classcom.sun.source.util.SimpleTreeVisitor<ControlFlowVisitor.Result,
com.google.errorprone.refaster.ControlFlowVisitor.BreakContext>
-
visitSynchronized
public ControlFlowVisitor.Result visitSynchronized(com.sun.source.tree.SynchronizedTree node, com.google.errorprone.refaster.ControlFlowVisitor.BreakContext cxt) - Specified by:
visitSynchronized
in interfacecom.sun.source.tree.TreeVisitor<ControlFlowVisitor.Result,
com.google.errorprone.refaster.ControlFlowVisitor.BreakContext> - Overrides:
visitSynchronized
in classcom.sun.source.util.SimpleTreeVisitor<ControlFlowVisitor.Result,
com.google.errorprone.refaster.ControlFlowVisitor.BreakContext>
-
visitTry
public ControlFlowVisitor.Result visitTry(com.sun.source.tree.TryTree node, com.google.errorprone.refaster.ControlFlowVisitor.BreakContext cxt) - Specified by:
visitTry
in interfacecom.sun.source.tree.TreeVisitor<ControlFlowVisitor.Result,
com.google.errorprone.refaster.ControlFlowVisitor.BreakContext> - Overrides:
visitTry
in classcom.sun.source.util.SimpleTreeVisitor<ControlFlowVisitor.Result,
com.google.errorprone.refaster.ControlFlowVisitor.BreakContext>
-
visitCatch
public ControlFlowVisitor.Result visitCatch(com.sun.source.tree.CatchTree node, com.google.errorprone.refaster.ControlFlowVisitor.BreakContext cxt) - Specified by:
visitCatch
in interfacecom.sun.source.tree.TreeVisitor<ControlFlowVisitor.Result,
com.google.errorprone.refaster.ControlFlowVisitor.BreakContext> - Overrides:
visitCatch
in classcom.sun.source.util.SimpleTreeVisitor<ControlFlowVisitor.Result,
com.google.errorprone.refaster.ControlFlowVisitor.BreakContext>
-
visitIf
public ControlFlowVisitor.Result visitIf(com.sun.source.tree.IfTree node, com.google.errorprone.refaster.ControlFlowVisitor.BreakContext cxt) - Specified by:
visitIf
in interfacecom.sun.source.tree.TreeVisitor<ControlFlowVisitor.Result,
com.google.errorprone.refaster.ControlFlowVisitor.BreakContext> - Overrides:
visitIf
in classcom.sun.source.util.SimpleTreeVisitor<ControlFlowVisitor.Result,
com.google.errorprone.refaster.ControlFlowVisitor.BreakContext>
-
visitExpressionStatement
public ControlFlowVisitor.Result visitExpressionStatement(com.sun.source.tree.ExpressionStatementTree node, com.google.errorprone.refaster.ControlFlowVisitor.BreakContext cxt) - Specified by:
visitExpressionStatement
in interfacecom.sun.source.tree.TreeVisitor<ControlFlowVisitor.Result,
com.google.errorprone.refaster.ControlFlowVisitor.BreakContext> - Overrides:
visitExpressionStatement
in classcom.sun.source.util.SimpleTreeVisitor<ControlFlowVisitor.Result,
com.google.errorprone.refaster.ControlFlowVisitor.BreakContext>
-
visitLabeledStatement
public ControlFlowVisitor.Result visitLabeledStatement(com.sun.source.tree.LabeledStatementTree node, com.google.errorprone.refaster.ControlFlowVisitor.BreakContext cxt) - Specified by:
visitLabeledStatement
in interfacecom.sun.source.tree.TreeVisitor<ControlFlowVisitor.Result,
com.google.errorprone.refaster.ControlFlowVisitor.BreakContext> - Overrides:
visitLabeledStatement
in classcom.sun.source.util.SimpleTreeVisitor<ControlFlowVisitor.Result,
com.google.errorprone.refaster.ControlFlowVisitor.BreakContext>
-
visitBreak
public ControlFlowVisitor.Result visitBreak(com.sun.source.tree.BreakTree node, com.google.errorprone.refaster.ControlFlowVisitor.BreakContext cxt) - Specified by:
visitBreak
in interfacecom.sun.source.tree.TreeVisitor<ControlFlowVisitor.Result,
com.google.errorprone.refaster.ControlFlowVisitor.BreakContext> - Overrides:
visitBreak
in classcom.sun.source.util.SimpleTreeVisitor<ControlFlowVisitor.Result,
com.google.errorprone.refaster.ControlFlowVisitor.BreakContext>
-
visitContinue
public ControlFlowVisitor.Result visitContinue(com.sun.source.tree.ContinueTree node, com.google.errorprone.refaster.ControlFlowVisitor.BreakContext cxt) - Specified by:
visitContinue
in interfacecom.sun.source.tree.TreeVisitor<ControlFlowVisitor.Result,
com.google.errorprone.refaster.ControlFlowVisitor.BreakContext> - Overrides:
visitContinue
in classcom.sun.source.util.SimpleTreeVisitor<ControlFlowVisitor.Result,
com.google.errorprone.refaster.ControlFlowVisitor.BreakContext>
-
visitReturn
public ControlFlowVisitor.Result visitReturn(com.sun.source.tree.ReturnTree node, com.google.errorprone.refaster.ControlFlowVisitor.BreakContext cxt) - Specified by:
visitReturn
in interfacecom.sun.source.tree.TreeVisitor<ControlFlowVisitor.Result,
com.google.errorprone.refaster.ControlFlowVisitor.BreakContext> - Overrides:
visitReturn
in classcom.sun.source.util.SimpleTreeVisitor<ControlFlowVisitor.Result,
com.google.errorprone.refaster.ControlFlowVisitor.BreakContext>
-
visitThrow
public ControlFlowVisitor.Result visitThrow(com.sun.source.tree.ThrowTree node, com.google.errorprone.refaster.ControlFlowVisitor.BreakContext cxt) - Specified by:
visitThrow
in interfacecom.sun.source.tree.TreeVisitor<ControlFlowVisitor.Result,
com.google.errorprone.refaster.ControlFlowVisitor.BreakContext> - Overrides:
visitThrow
in classcom.sun.source.util.SimpleTreeVisitor<ControlFlowVisitor.Result,
com.google.errorprone.refaster.ControlFlowVisitor.BreakContext>
-