Class AccumulationAnnotatedTypeFactory.AccumulationTreeAnnotator
- java.lang.Object
-
- com.sun.source.util.SimpleTreeVisitor<java.lang.Void,AnnotatedTypeMirror>
-
- org.checkerframework.framework.type.treeannotator.TreeAnnotator
-
- org.checkerframework.common.accumulation.AccumulationAnnotatedTypeFactory.AccumulationTreeAnnotator
-
- All Implemented Interfaces:
com.sun.source.tree.TreeVisitor<java.lang.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
-
-
Constructor Summary
Constructors Constructor Description AccumulationTreeAnnotator(AccumulationAnnotatedTypeFactory factory)
Creates an instance of this tree annotator for the given type factory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Void
visitMethodInvocation(com.sun.source.tree.MethodInvocationTree tree, AnnotatedTypeMirror type)
Implements 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, visitBlock, visitBreak, visitCase, visitCatch, visitClass, visitCompilationUnit, visitCompoundAssignment, visitConditionalExpression, visitContinue, visitDoWhileLoop, visitEmptyStatement, visitEnhancedForLoop, visitErroneous, visitExports, visitExpressionStatement, visitForLoop, visitIdentifier, visitIf, visitImport, visitInstanceOf, visitIntersectionType, visitLabeledStatement, visitLambdaExpression, visitLiteral, visitMemberReference, visitMemberSelect, visitModifiers, visitModule, visitNewArray, visitNewClass, visitOpens, visitOther, visitPackage, visitParameterizedType, visitParenthesized, visitPrimitiveType, visitProvides, visitRequires, visitReturn, visitSwitch, visitSynchronized, visitThrow, visitTry, visitTypeCast, visitTypeParameter, visitUnary, visitUnionType, visitUses, visitVariable, visitWhileLoop, visitWildcard
-
-
-
-
Constructor Detail
-
AccumulationTreeAnnotator
public AccumulationTreeAnnotator(AccumulationAnnotatedTypeFactory factory)
Creates an instance of this tree annotator for the given type factory.- Parameters:
factory
- the type factory
-
-
Method Detail
-
visitMethodInvocation
public java.lang.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 interfacecom.sun.source.tree.TreeVisitor<java.lang.Void,AnnotatedTypeMirror>
- Overrides:
visitMethodInvocation
in classcom.sun.source.util.SimpleTreeVisitor<java.lang.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
-
-