public class CalledMethodsVisitor extends AccumulationVisitor
BaseTypeVisitor.OverrideChecker
atypeFactory, checker, DETERMINISTIC, inferPurity, methodTree, positions, PURE, SIDE_EFFECT_FREE, TARGET, targetValueElement, typeValidator, unusedWhenElement
elements, root, trees, treesWithSuppressWarnings, types
Constructor and Description |
---|
CalledMethodsVisitor(BaseTypeChecker checker)
Creates a new CalledMethodsVisitor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
reportMethodInvocabilityError(MethodInvocationTree node,
AnnotatedTypeMirror found,
AnnotatedTypeMirror expected)
Turns some method.invocation errors into finalizer.invocation errors.
|
Void |
visitAnnotation(AnnotationTree node,
Void p)
Issue an error at every EnsuresCalledMethodsVarArgs annotation, because using it is unsound.
|
Void |
visitMethod(MethodTree node,
Void p)
Checks that the method obeys override and subtype rules to all overridden methods.
|
Void |
visitMethodInvocation(MethodInvocationTree node,
Void p)
Performs a method invocation check.
|
checkAccess, checkAccessAllowed, checkArguments, checkArrayInitialization, checkConditionalPostcondition, checkConstructorInvocation, checkConstructorResult, checkContract, checkDefaultConstructor, checkExceptionParameter, checkExplicitAnnotationsOnIntersectionBounds, checkExtendsImplements, checkFieldInvariantDeclarations, checkForPolymorphicQualifiers, checkForPolymorphicQualifiers, checkMethodInvocability, checkMethodReferenceAsOverride, checkOverride, checkOverride, checkPostcondition, checkPreconditions, checkPurity, checkQualifierParameter, checkSuperConstructorCall, checkThisConstructorCall, checkThisOrSuperConstructorCall, checkThrownExpression, checkTypeArguments, checkTypecastRedundancy, checkTypecastSafety, checkVarargs, commonAssignmentCheck, commonAssignmentCheck, commonAssignmentCheck, commonAssignmentCheckEndDiagnostic, commonAssignmentCheckEndDiagnostic, commonAssignmentCheckStartDiagnostic, createOverrideChecker, createTypeFactory, createTypeFactoryPublic, createTypeValidator, enclosingMemberSelect, enclosingStatement, getExceptionParameterLowerBoundAnnotations, getThrowUpperBoundAnnotations, getTypeFactory, isTypeCastSafe, isValidUse, isValidUse, isValidUse, processClassTree, reportPurityErrors, scan, setRoot, shouldSkipUses, skipReceiverSubtypeCheck, testAnnotationInsertion, testJointJavacJavaParserVisitor, testTypevarContainment, typeCheckVectorCopyIntoArgument, validateType, validateTypeOf, visitAnnotatedType, visitAnnotatedType, visitAssignment, visitCatch, visitClass, visitCompilationUnit, visitCompoundAssignment, visitConditionalExpression, visitEnhancedForLoop, visitIdentifier, visitInstanceOf, visitLambdaExpression, visitMemberReference, visitNewArray, visitNewClass, visitReturn, visitThrow, visitTypeCast, visitTypeParameter, visitUnary, visitVariable, warnAboutIrrelevantJavaTypes
visit
getCurrentPath, scan
reduce, scan, visitArrayAccess, visitArrayType, visitAssert, visitBinary, visitBlock, visitBreak, visitCase, visitContinue, visitDoWhileLoop, visitEmptyStatement, visitErroneous, visitExports, visitExpressionStatement, visitForLoop, visitIf, visitImport, visitIntersectionType, visitLabeledStatement, visitLiteral, visitMemberSelect, visitModifiers, visitModule, visitOpens, visitOther, visitPackage, visitParameterizedType, visitParenthesized, visitPrimitiveType, visitProvides, visitRequires, visitSwitch, visitSynchronized, visitTry, visitUnionType, visitUses, visitWhileLoop, visitWildcard
public CalledMethodsVisitor(BaseTypeChecker checker)
checker
- the type-checker associated with this visitorpublic Void visitAnnotation(AnnotationTree node, Void p)
visitAnnotation
in interface TreeVisitor<Void,Void>
visitAnnotation
in class AccumulationVisitor
public Void visitMethod(MethodTree node, Void p)
BaseTypeVisitor
The override rule specifies that a method, m1, may override a method m2 only if:
visitMethod
in interface TreeVisitor<Void,Void>
visitMethod
in class BaseTypeVisitor<AccumulationAnnotatedTypeFactory>
public Void visitMethodInvocation(MethodInvocationTree node, Void p)
BaseTypeVisitor
An invocation of a method, m, on the receiver, r is valid only if:
visitMethodInvocation
in interface TreeVisitor<Void,Void>
visitMethodInvocation
in class BaseTypeVisitor<AccumulationAnnotatedTypeFactory>
protected void reportMethodInvocabilityError(MethodInvocationTree node, AnnotatedTypeMirror found, AnnotatedTypeMirror expected)
reportMethodInvocabilityError
in class BaseTypeVisitor<AccumulationAnnotatedTypeFactory>
node
- the AST node at which to report the errorfound
- the actual type of the receiverexpected
- the expected type of the receiver