Class NullnessNoInitAnnotatedTypeFactory.NullnessPropagationTreeAnnotator
- java.lang.Object
-
- com.sun.source.util.SimpleTreeVisitor<java.lang.Void,AnnotatedTypeMirror>
-
- org.checkerframework.framework.type.treeannotator.TreeAnnotator
-
- org.checkerframework.framework.type.treeannotator.PropagationTreeAnnotator
-
- org.checkerframework.checker.nullness.NullnessNoInitAnnotatedTypeFactory.NullnessPropagationTreeAnnotator
-
- All Implemented Interfaces:
com.sun.source.tree.TreeVisitor<java.lang.Void,AnnotatedTypeMirror>
- Enclosing class:
- NullnessNoInitAnnotatedTypeFactory
protected class NullnessNoInitAnnotatedTypeFactory.NullnessPropagationTreeAnnotator extends PropagationTreeAnnotator
Adds nullness-specific propagation rules
-
-
Field Summary
-
Fields inherited from class org.checkerframework.framework.type.treeannotator.TreeAnnotator
atypeFactory
-
-
Constructor Summary
Constructors Constructor Description NullnessPropagationTreeAnnotator(AnnotatedTypeFactory atypeFactory)
Creates a NullnessPropagationTreeAnnotator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Void
visitBinary(com.sun.source.tree.BinaryTree tree, AnnotatedTypeMirror type)
When overriding this method, getAnnotatedType on the left and right operands should only be called when absolutely necessary.java.lang.Void
visitCompoundAssignment(com.sun.source.tree.CompoundAssignmentTree tree, AnnotatedTypeMirror type)
java.lang.Void
visitIdentifier(com.sun.source.tree.IdentifierTree tree, AnnotatedTypeMirror type)
java.lang.Void
visitMemberSelect(com.sun.source.tree.MemberSelectTree tree, AnnotatedTypeMirror type)
java.lang.Void
visitMethodInvocation(com.sun.source.tree.MethodInvocationTree tree, AnnotatedTypeMirror type)
java.lang.Void
visitNewArray(com.sun.source.tree.NewArrayTree tree, AnnotatedTypeMirror type)
java.lang.Void
visitNewClass(com.sun.source.tree.NewClassTree tree, AnnotatedTypeMirror type)
java.lang.Void
visitTypeCast(com.sun.source.tree.TypeCastTree tree, AnnotatedTypeMirror type)
java.lang.Void
visitUnary(com.sun.source.tree.UnaryTree tree, AnnotatedTypeMirror type)
java.lang.Void
visitVariable(com.sun.source.tree.VariableTree tree, AnnotatedTypeMirror type)
-
Methods inherited from class org.checkerframework.framework.type.treeannotator.TreeAnnotator
log, visitMethod
-
Methods inherited from class com.sun.source.util.SimpleTreeVisitor
defaultAction, visit, visit, visitAnnotatedType, visitAnnotation, visitArrayAccess, visitArrayType, visitAssert, visitAssignment, visitBlock, visitBreak, visitCase, visitCatch, visitClass, visitCompilationUnit, visitConditionalExpression, visitContinue, visitDoWhileLoop, visitEmptyStatement, visitEnhancedForLoop, visitErroneous, visitExports, visitExpressionStatement, visitForLoop, visitIf, visitImport, visitInstanceOf, visitIntersectionType, visitLabeledStatement, visitLambdaExpression, visitLiteral, visitMemberReference, visitModifiers, visitModule, visitOpens, visitOther, visitPackage, visitParameterizedType, visitParenthesized, visitPrimitiveType, visitProvides, visitRequires, visitReturn, visitSwitch, visitSynchronized, visitThrow, visitTry, visitTypeParameter, visitUnionType, visitUses, visitWhileLoop, visitWildcard
-
-
-
-
Constructor Detail
-
NullnessPropagationTreeAnnotator
public NullnessPropagationTreeAnnotator(AnnotatedTypeFactory atypeFactory)
Creates a NullnessPropagationTreeAnnotator.- Parameters:
atypeFactory
- this factory
-
-
Method Detail
-
visitTypeCast
public java.lang.Void visitTypeCast(com.sun.source.tree.TypeCastTree tree, AnnotatedTypeMirror type)
- Specified by:
visitTypeCast
in interfacecom.sun.source.tree.TreeVisitor<java.lang.Void,AnnotatedTypeMirror>
- Overrides:
visitTypeCast
in classPropagationTreeAnnotator
-
visitMemberSelect
public java.lang.Void visitMemberSelect(com.sun.source.tree.MemberSelectTree tree, AnnotatedTypeMirror type)
- Specified by:
visitMemberSelect
in interfacecom.sun.source.tree.TreeVisitor<java.lang.Void,AnnotatedTypeMirror>
- Overrides:
visitMemberSelect
in classcom.sun.source.util.SimpleTreeVisitor<java.lang.Void,AnnotatedTypeMirror>
-
visitVariable
public java.lang.Void visitVariable(com.sun.source.tree.VariableTree tree, AnnotatedTypeMirror type)
- Specified by:
visitVariable
in interfacecom.sun.source.tree.TreeVisitor<java.lang.Void,AnnotatedTypeMirror>
- Overrides:
visitVariable
in classcom.sun.source.util.SimpleTreeVisitor<java.lang.Void,AnnotatedTypeMirror>
-
visitIdentifier
public java.lang.Void visitIdentifier(com.sun.source.tree.IdentifierTree tree, AnnotatedTypeMirror type)
- Specified by:
visitIdentifier
in interfacecom.sun.source.tree.TreeVisitor<java.lang.Void,AnnotatedTypeMirror>
- Overrides:
visitIdentifier
in classcom.sun.source.util.SimpleTreeVisitor<java.lang.Void,AnnotatedTypeMirror>
-
visitBinary
public java.lang.Void visitBinary(com.sun.source.tree.BinaryTree tree, AnnotatedTypeMirror type)
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 interfacecom.sun.source.tree.TreeVisitor<java.lang.Void,AnnotatedTypeMirror>
- Overrides:
visitBinary
in classPropagationTreeAnnotator
-
visitCompoundAssignment
public java.lang.Void visitCompoundAssignment(com.sun.source.tree.CompoundAssignmentTree tree, AnnotatedTypeMirror type)
- Specified by:
visitCompoundAssignment
in interfacecom.sun.source.tree.TreeVisitor<java.lang.Void,AnnotatedTypeMirror>
- Overrides:
visitCompoundAssignment
in classPropagationTreeAnnotator
-
visitUnary
public java.lang.Void visitUnary(com.sun.source.tree.UnaryTree tree, AnnotatedTypeMirror type)
- Specified by:
visitUnary
in interfacecom.sun.source.tree.TreeVisitor<java.lang.Void,AnnotatedTypeMirror>
- Overrides:
visitUnary
in classPropagationTreeAnnotator
-
visitNewClass
public java.lang.Void visitNewClass(com.sun.source.tree.NewClassTree tree, AnnotatedTypeMirror type)
- Specified by:
visitNewClass
in interfacecom.sun.source.tree.TreeVisitor<java.lang.Void,AnnotatedTypeMirror>
- Overrides:
visitNewClass
in classcom.sun.source.util.SimpleTreeVisitor<java.lang.Void,AnnotatedTypeMirror>
-
visitNewArray
public java.lang.Void visitNewArray(com.sun.source.tree.NewArrayTree tree, AnnotatedTypeMirror type)
- Specified by:
visitNewArray
in interfacecom.sun.source.tree.TreeVisitor<java.lang.Void,AnnotatedTypeMirror>
- Overrides:
visitNewArray
in classPropagationTreeAnnotator
-
visitMethodInvocation
public java.lang.Void visitMethodInvocation(com.sun.source.tree.MethodInvocationTree tree, AnnotatedTypeMirror type)
- Specified by:
visitMethodInvocation
in interfacecom.sun.source.tree.TreeVisitor<java.lang.Void,AnnotatedTypeMirror>
- Overrides:
visitMethodInvocation
in classcom.sun.source.util.SimpleTreeVisitor<java.lang.Void,AnnotatedTypeMirror>
-
-