Class AccumulationAnnotatedTypeFactory.AccumulationTreeAnnotator

java.lang.Object
com.sun.source.util.SimpleTreeVisitor<Void,AnnotatedTypeMirror>
org.checkerframework.framework.type.treeannotator.TreeAnnotator
org.checkerframework.common.accumulation.AccumulationAnnotatedTypeFactory.AccumulationTreeAnnotator
All Implemented Interfaces:
com.sun.source.tree.TreeVisitor<Void,AnnotatedTypeMirror>
Enclosing class:
AccumulationAnnotatedTypeFactory

protected class AccumulationAnnotatedTypeFactory.AccumulationTreeAnnotator extends TreeAnnotator
This tree annotator implements the following rule(s):
RRA
If a method returns its receiver, and the receiver has an accumulation type, then the default type of the method's return value is the type of the receiver.
  • 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
    Creates an instance of this tree annotator for the given type factory.
  • Method Summary

    Modifier and Type
    Method
    Description
    visitMethodInvocation(com.sun.source.tree.MethodInvocationTree tree, AnnotatedTypeMirror type)
    Implements rule RRA.

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

    visitBinary, 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, visitCompoundAssignment, visitConditionalExpression, visitContinue, visitDefaultCaseLabel, visitDoWhileLoop, visitEmptyStatement, visitEnhancedForLoop, visitErroneous, visitExports, visitExpressionStatement, visitForLoop, visitGuardedPattern, visitIdentifier, visitIf, visitImport, visitInstanceOf, visitIntersectionType, visitLabeledStatement, visitLambdaExpression, visitLiteral, visitMemberReference, visitMemberSelect, visitModifiers, visitModule, visitNewArray, visitNewClass, visitOpens, visitOther, visitPackage, visitParameterizedType, visitParenthesized, visitParenthesizedPattern, visitPrimitiveType, visitProvides, visitRequires, visitReturn, visitSwitch, visitSwitchExpression, visitSynchronized, visitThrow, visitTry, visitTypeCast, visitTypeParameter, visitUnary, visitUnionType, visitUses, visitVariable, visitWhileLoop, visitWildcard, visitYield

    Methods inherited from class java.lang.Object

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

    • AccumulationTreeAnnotator

      public AccumulationTreeAnnotator(AccumulationAnnotatedTypeFactory factory)
      Creates an instance of this tree annotator for the given type factory.
      Parameters:
      factory - the type factory
  • Method Details

    • visitMethodInvocation

      public Void visitMethodInvocation(com.sun.source.tree.MethodInvocationTree tree, AnnotatedTypeMirror type)
      Implements rule RRA.

      This implementation propagates types from the receiver to the return value, without change. Subclasses may override this method to also add additional properties, as appropriate.

      Specified by:
      visitMethodInvocation in interface com.sun.source.tree.TreeVisitor<Void,AnnotatedTypeMirror>
      Overrides:
      visitMethodInvocation in class com.sun.source.util.SimpleTreeVisitor<Void,AnnotatedTypeMirror>
      Parameters:
      tree - a method invocation tree
      type - the type of tree (i.e. the return type of the invoked method). Is (possibly) side-effected by this method.
      Returns:
      nothing, works by side-effect on type