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:
TreeVisitor<Void,
AnnotatedTypeMirror>
- Enclosing class:
- AccumulationAnnotatedTypeFactory
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
ConstructorDescriptionCreates an instance of this tree annotator for the given type factory. -
Method Summary
Modifier and TypeMethodDescriptionImplements rule RRA.Methods inherited from class org.checkerframework.framework.type.treeannotator.TreeAnnotator
log, 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
-
Constructor Details
-
AccumulationTreeAnnotator
Creates an instance of this tree annotator for the given type factory.- Parameters:
factory
- the type factory
-
-
Method Details
-
visitMethodInvocation
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 interfaceTreeVisitor<Void,
AnnotatedTypeMirror> - Overrides:
visitMethodInvocation
in classSimpleTreeVisitor<Void,
AnnotatedTypeMirror> - Parameters:
tree
- a method invocation treetype
- the type oftree
(i.e. the return type of the invoked method). Is (possibly) side-effected by this method.- Returns:
- nothing, works by side-effect on
type
-