Class InitializationParentAnnotatedTypeFactory.CommitmentTreeAnnotator
java.lang.Object
com.sun.source.util.SimpleTreeVisitor<Void,AnnotatedTypeMirror>
org.checkerframework.framework.type.treeannotator.TreeAnnotator
org.checkerframework.framework.type.treeannotator.PropagationTreeAnnotator
org.checkerframework.checker.initialization.InitializationParentAnnotatedTypeFactory.CommitmentTreeAnnotator
- All Implemented Interfaces:
TreeVisitor<Void,
AnnotatedTypeMirror>
- Enclosing class:
InitializationParentAnnotatedTypeFactory
protected class InitializationParentAnnotatedTypeFactory.CommitmentTreeAnnotator
extends PropagationTreeAnnotator
This tree annotator modifies the propagation tree annotator to add propagation rules for the
freedom-before-commitment system.
-
Field Summary
Fields inherited from class org.checkerframework.framework.type.treeannotator.TreeAnnotator
atypeFactory
Fields inherited from class com.sun.source.util.SimpleTreeVisitor
DEFAULT_VALUE
-
Constructor Summary
ConstructorsConstructorDescriptionCommitmentTreeAnnotator
(InitializationParentAnnotatedTypeFactory initializationAnnotatedTypeFactory) Creates a new CommitmentTreeAnnotator. -
Method Summary
Modifier and TypeMethodDescriptionvisitBinary
(BinaryTree tree, AnnotatedTypeMirror type) When overriding this method, getAnnotatedType on the left and right operands should only be called when absolutely necessary.visitLiteral
(LiteralTree tree, AnnotatedTypeMirror type) visitMemberSelect
(MemberSelectTree tree, AnnotatedTypeMirror annotatedTypeMirror) visitMethod
(MethodTree tree, AnnotatedTypeMirror p) This method is not called when checking a method invocation against its declaration.visitNewArray
(NewArrayTree tree, AnnotatedTypeMirror type) visitNewClass
(NewClassTree tree, AnnotatedTypeMirror p) visitUnary
(UnaryTree tree, AnnotatedTypeMirror type) Methods inherited from class org.checkerframework.framework.type.treeannotator.PropagationTreeAnnotator
visitCompoundAssignment, visitTypeCast
Methods inherited from class org.checkerframework.framework.type.treeannotator.TreeAnnotator
log
Methods inherited from class com.sun.source.util.SimpleTreeVisitor
defaultAction, visit, visit, visitAnnotatedType, visitAnnotation, visitAnyPattern, visitArrayAccess, visitArrayType, visitAssert, visitAssignment, visitBindingPattern, visitBlock, visitBreak, visitCase, visitCatch, visitClass, visitCompilationUnit, visitConditionalExpression, visitConstantCaseLabel, visitContinue, visitDeconstructionPattern, visitDefaultCaseLabel, visitDoWhileLoop, visitEmptyStatement, visitEnhancedForLoop, visitErroneous, visitExports, visitExpressionStatement, visitForLoop, visitIdentifier, visitIf, visitImport, visitInstanceOf, visitIntersectionType, visitLabeledStatement, visitLambdaExpression, visitMemberReference, visitMethodInvocation, visitModifiers, visitModule, visitOpens, visitOther, visitPackage, visitParameterizedType, visitParenthesized, visitPatternCaseLabel, visitPrimitiveType, visitProvides, visitRequires, visitReturn, visitStringTemplate, visitSwitch, visitSwitchExpression, visitSynchronized, visitThrow, visitTry, visitTypeParameter, visitUnionType, visitUses, visitVariable, visitWhileLoop, visitWildcard, visitYield
-
Constructor Details
-
CommitmentTreeAnnotator
public CommitmentTreeAnnotator(InitializationParentAnnotatedTypeFactory initializationAnnotatedTypeFactory) Creates a new CommitmentTreeAnnotator.- Parameters:
initializationAnnotatedTypeFactory
- this factory
-
-
Method Details
-
visitMethod
Description copied from class:TreeAnnotator
This method is not called when checking a method invocation against its declaration. So, instead of overriding this method, override TypeAnnotator.visitExecutable. TypeAnnotator.visitExecutable is called both when checking method declarations and method invocations.- Specified by:
visitMethod
in interfaceTreeVisitor<Void,
AnnotatedTypeMirror> - Overrides:
visitMethod
in classTreeAnnotator
- See Also:
-
visitNewClass
- Specified by:
visitNewClass
in interfaceTreeVisitor<Void,
AnnotatedTypeMirror> - Overrides:
visitNewClass
in classSimpleTreeVisitor<Void,
AnnotatedTypeMirror>
-
visitLiteral
- Specified by:
visitLiteral
in interfaceTreeVisitor<Void,
AnnotatedTypeMirror> - Overrides:
visitLiteral
in classSimpleTreeVisitor<Void,
AnnotatedTypeMirror>
-
visitNewArray
- Specified by:
visitNewArray
in interfaceTreeVisitor<Void,
AnnotatedTypeMirror> - Overrides:
visitNewArray
in classPropagationTreeAnnotator
-
visitMemberSelect
- Specified by:
visitMemberSelect
in interfaceTreeVisitor<Void,
AnnotatedTypeMirror> - Overrides:
visitMemberSelect
in classSimpleTreeVisitor<Void,
AnnotatedTypeMirror>
-
visitBinary
Description copied from class:TreeAnnotator
When overriding this method, getAnnotatedType on the left and right operands should only be called when absolutely necessary. Otherwise, the checker will be very slow on heavily nested binary trees. (For example, a + b + c + d + e + f + g + h.)If a checker's performance is still too slow, the types of binary trees could be computed in a subclass of
CFTransfer
. When computing the types in a transfer, look up the value in the store rather than the AnnotatedTypeFactory. Then this method should annotate binary trees with top so that the type applied in the transfer is always a subtype of the type the AnnotatedTypeFactory computes.- Specified by:
visitBinary
in interfaceTreeVisitor<Void,
AnnotatedTypeMirror> - Overrides:
visitBinary
in classPropagationTreeAnnotator
-
visitUnary
- Specified by:
visitUnary
in interfaceTreeVisitor<Void,
AnnotatedTypeMirror> - Overrides:
visitUnary
in classPropagationTreeAnnotator
-