Class NullnessAnnotatedTypeFactory.NullnessTreeAnnotator

java.lang.Object
com.sun.source.util.SimpleTreeVisitor<Void,AnnotatedTypeMirror>
org.checkerframework.framework.type.treeannotator.TreeAnnotator
org.checkerframework.checker.nullness.NullnessAnnotatedTypeFactory.NullnessTreeAnnotator
All Implemented Interfaces:
com.sun.source.tree.TreeVisitor<Void,AnnotatedTypeMirror>
Enclosing class:
NullnessAnnotatedTypeFactory

protected class NullnessAnnotatedTypeFactory.NullnessTreeAnnotator extends TreeAnnotator
  • 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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    visitBinary(com.sun.source.tree.BinaryTree node, AnnotatedTypeMirror type)
    When overriding this method, getAnnotatedType on the left and right operands should only be called when absolutely necessary.
    visitCompoundAssignment(com.sun.source.tree.CompoundAssignmentTree node, AnnotatedTypeMirror type)
     
    visitIdentifier(com.sun.source.tree.IdentifierTree node, AnnotatedTypeMirror type)
     
    visitMemberSelect(com.sun.source.tree.MemberSelectTree node, AnnotatedTypeMirror type)
     
    visitMethodInvocation(com.sun.source.tree.MethodInvocationTree tree, AnnotatedTypeMirror type)
     
    visitNewArray(com.sun.source.tree.NewArrayTree node, AnnotatedTypeMirror type)
     
    visitNewClass(com.sun.source.tree.NewClassTree node, AnnotatedTypeMirror type)
     
    visitUnary(com.sun.source.tree.UnaryTree node, AnnotatedTypeMirror type)
     
    visitVariable(com.sun.source.tree.VariableTree node, AnnotatedTypeMirror type)
     

    Methods inherited from class org.checkerframework.framework.type.treeannotator.TreeAnnotator

    visitMethod

    Methods inherited from class com.sun.source.util.SimpleTreeVisitor

    defaultAction, visit, visit, visitAnnotatedType, visitAnnotation, visitArrayAccess, visitArrayType, visitAssert, visitAssignment, visitBindingPattern, visitBlock, visitBreak, visitCase, visitCatch, visitClass, visitCompilationUnit, visitConditionalExpression, visitContinue, visitDefaultCaseLabel, visitDoWhileLoop, visitEmptyStatement, visitEnhancedForLoop, visitErroneous, visitExports, visitExpressionStatement, visitForLoop, visitGuardedPattern, visitIf, visitImport, visitInstanceOf, visitIntersectionType, visitLabeledStatement, visitLambdaExpression, visitLiteral, visitMemberReference, visitModifiers, visitModule, visitOpens, visitOther, visitPackage, visitParameterizedType, visitParenthesized, visitParenthesizedPattern, visitPrimitiveType, visitProvides, visitRequires, visitReturn, visitSwitch, visitSwitchExpression, visitSynchronized, visitThrow, visitTry, visitTypeCast, visitTypeParameter, visitUnionType, visitUses, visitWhileLoop, visitWildcard, visitYield

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • visitMemberSelect

      public Void visitMemberSelect(com.sun.source.tree.MemberSelectTree node, AnnotatedTypeMirror type)
      Specified by:
      visitMemberSelect in interface com.sun.source.tree.TreeVisitor<Void,AnnotatedTypeMirror>
      Overrides:
      visitMemberSelect in class com.sun.source.util.SimpleTreeVisitor<Void,AnnotatedTypeMirror>
    • visitVariable

      public Void visitVariable(com.sun.source.tree.VariableTree node, AnnotatedTypeMirror type)
      Specified by:
      visitVariable in interface com.sun.source.tree.TreeVisitor<Void,AnnotatedTypeMirror>
      Overrides:
      visitVariable in class com.sun.source.util.SimpleTreeVisitor<Void,AnnotatedTypeMirror>
    • visitIdentifier

      public Void visitIdentifier(com.sun.source.tree.IdentifierTree node, AnnotatedTypeMirror type)
      Specified by:
      visitIdentifier in interface com.sun.source.tree.TreeVisitor<Void,AnnotatedTypeMirror>
      Overrides:
      visitIdentifier in class com.sun.source.util.SimpleTreeVisitor<Void,AnnotatedTypeMirror>
    • visitBinary

      public Void visitBinary(com.sun.source.tree.BinaryTree node, 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 interface com.sun.source.tree.TreeVisitor<Void,AnnotatedTypeMirror>
      Overrides:
      visitBinary in class TreeAnnotator
    • visitCompoundAssignment

      public Void visitCompoundAssignment(com.sun.source.tree.CompoundAssignmentTree node, AnnotatedTypeMirror type)
      Specified by:
      visitCompoundAssignment in interface com.sun.source.tree.TreeVisitor<Void,AnnotatedTypeMirror>
      Overrides:
      visitCompoundAssignment in class com.sun.source.util.SimpleTreeVisitor<Void,AnnotatedTypeMirror>
    • visitUnary

      public Void visitUnary(com.sun.source.tree.UnaryTree node, AnnotatedTypeMirror type)
      Specified by:
      visitUnary in interface com.sun.source.tree.TreeVisitor<Void,AnnotatedTypeMirror>
      Overrides:
      visitUnary in class com.sun.source.util.SimpleTreeVisitor<Void,AnnotatedTypeMirror>
    • visitNewClass

      public Void visitNewClass(com.sun.source.tree.NewClassTree node, AnnotatedTypeMirror type)
      Specified by:
      visitNewClass in interface com.sun.source.tree.TreeVisitor<Void,AnnotatedTypeMirror>
      Overrides:
      visitNewClass in class com.sun.source.util.SimpleTreeVisitor<Void,AnnotatedTypeMirror>
    • visitNewArray

      public Void visitNewArray(com.sun.source.tree.NewArrayTree node, AnnotatedTypeMirror type)
      Specified by:
      visitNewArray in interface com.sun.source.tree.TreeVisitor<Void,AnnotatedTypeMirror>
      Overrides:
      visitNewArray in class com.sun.source.util.SimpleTreeVisitor<Void,AnnotatedTypeMirror>
    • visitMethodInvocation

      public Void visitMethodInvocation(com.sun.source.tree.MethodInvocationTree tree, AnnotatedTypeMirror type)
      Specified by:
      visitMethodInvocation in interface com.sun.source.tree.TreeVisitor<Void,AnnotatedTypeMirror>
      Overrides:
      visitMethodInvocation in class com.sun.source.util.SimpleTreeVisitor<Void,AnnotatedTypeMirror>