Class ReportVisitor
java.lang.Object
com.sun.source.util.TreeScanner<R,P>
com.sun.source.util.TreePathScanner<R,P>
org.checkerframework.framework.source.SourceVisitor<Void,Void>
org.checkerframework.common.basetype.BaseTypeVisitor<BaseAnnotatedTypeFactory>
org.checkerframework.common.util.report.ReportVisitor
- All Implemented Interfaces:
TreeVisitor<Void,
Void>
-
Nested Class Summary
Nested classes/interfaces inherited from class org.checkerframework.common.basetype.BaseTypeVisitor
BaseTypeVisitor.OverrideChecker
-
Field Summary
Fields inherited from class org.checkerframework.common.basetype.BaseTypeVisitor
atypeFactory, checker, DETERMINISTIC, IMPURE, methodTree, positions, PURE, qualHierarchy, showchecks, SIDE_EFFECT_FREE, TARGET, targetValueElement, typeValidator, unusedWhenElement
Fields inherited from class org.checkerframework.framework.source.SourceVisitor
elements, root, trees, treesWithSuppressWarnings, types
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected BaseTypeValidator
void
processClassTree
(ClassTree tree) Type-check classTree.visitArrayAccess
(ArrayAccessTree tree, Void p) visitAssignment
(AssignmentTree tree, Void p) Performs two checks: subtyping and assignability checks, usingBaseTypeVisitor.commonAssignmentCheck(Tree, ExpressionTree, String, Object[])
.visitIdentifier
(IdentifierTree tree, Void p) visitInstanceOf
(InstanceOfTree tree, Void p) visitMemberSelect
(MemberSelectTree tree, Void p) visitMethod
(MethodTree tree, Void p) Checks that the method or constructor obeys override and subtype rules to all overridden methods.Performs a method invocation check.visitModifiers
(ModifiersTree tree, Void p) visitNewArray
(NewArrayTree tree, Void p) visitNewClass
(NewClassTree tree, Void p) Performs a new class invocation check.visitTypeCast
(TypeCastTree tree, Void p) Methods inherited from class org.checkerframework.common.basetype.BaseTypeVisitor
checkAccess, checkAccessAllowed, checkArguments, checkArrayInitialization, checkConditionalPostcondition, checkConstructorInvocation, checkConstructorResult, checkContract, checkDefaultConstructor, checkExceptionParameter, checkExplicitAnnotationsOnIntersectionBounds, checkExtendsAndImplements, checkExtendsOrImplements, 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, enclosingMemberSelect, enclosingStatement, getExceptionParameterLowerBoundAnnotations, getThrowUpperBoundAnnotations, getTypeFactory, isTypeCastSafe, isValidUse, isValidUse, isValidUse, reportMethodInvocabilityError, reportPurityErrors, setRoot, shouldSkipUses, shouldWarnAboutIrrelevantJavaTypes, skipReceiverSubtypeCheck, testAnnotationInsertion, testJointJavacJavaParserVisitor, testTypevarContainment, typeCheckVectorCopyIntoArgument, validateType, validateTypeOf, visitAnnotatedType, visitAnnotatedType, visitAnnotation, visitCatch, visitClass, visitCompilationUnit, visitCompoundAssignment, visitConditionalExpression, visitEnhancedForLoop, visitLambdaExpression, visitMemberReference, visitReturn, visitSwitchExpression17, visitThrow, visitTypeParameter, visitUnary, visitVariable, warnAboutIrrelevantJavaTypes, warnRedundantAnnotations
Methods inherited from class org.checkerframework.framework.source.SourceVisitor
visit
Methods inherited from class com.sun.source.util.TreePathScanner
getCurrentPath, scan
Methods inherited from class com.sun.source.util.TreeScanner
reduce, scan, visitArrayType, visitAssert, visitBinary, visitBindingPattern, visitBlock, visitBreak, visitCase, visitContinue, visitDefaultCaseLabel, visitDoWhileLoop, visitEmptyStatement, visitErroneous, visitExports, visitExpressionStatement, visitForLoop, visitGuardedPattern, visitIf, visitImport, visitIntersectionType, visitLabeledStatement, visitLiteral, visitModule, visitOpens, visitOther, visitPackage, visitParameterizedType, visitParenthesized, visitParenthesizedPattern, visitPrimitiveType, visitProvides, visitRequires, visitSwitch, visitSwitchExpression, visitSynchronized, visitTry, visitUnionType, visitUses, visitWhileLoop, visitWildcard, visitYield
-
Constructor Details
-
ReportVisitor
-
-
Method Details
-
scan
- Overrides:
scan
in classBaseTypeVisitor<BaseAnnotatedTypeFactory>
-
processClassTree
Description copied from class:BaseTypeVisitor
Type-check classTree. Subclasses should override this method instead ofBaseTypeVisitor.visitClass(ClassTree, Void)
.- Overrides:
processClassTree
in classBaseTypeVisitor<BaseAnnotatedTypeFactory>
- Parameters:
tree
- class to check
-
visitMethod
Description copied from class:BaseTypeVisitor
Checks that the method or constructor obeys override and subtype rules to all overridden methods. (Uses the pseudo-assignment logic to do so.)The override rule specifies that a method, m1, may override a method m2 only if:
- m1 return type is a subtype of m2
- m1 receiver type is a supertype of m2
- m1 parameters are supertypes of corresponding m2 parameters
- Specified by:
visitMethod
in interfaceTreeVisitor<Void,
Void> - Overrides:
visitMethod
in classBaseTypeVisitor<BaseAnnotatedTypeFactory>
-
visitMethodInvocation
Description copied from class:BaseTypeVisitor
Performs a method invocation check.An invocation of a method, m, on the receiver, r is valid only if:
- passed arguments are subtypes of corresponding m parameters
- r is a subtype of m receiver type
- if m is generic, passed type arguments are subtypes of m type variables
- Specified by:
visitMethodInvocation
in interfaceTreeVisitor<Void,
Void> - Overrides:
visitMethodInvocation
in classBaseTypeVisitor<BaseAnnotatedTypeFactory>
-
visitMemberSelect
- Specified by:
visitMemberSelect
in interfaceTreeVisitor<Void,
Void> - Overrides:
visitMemberSelect
in classTreeScanner<Void,
Void>
-
visitIdentifier
- Specified by:
visitIdentifier
in interfaceTreeVisitor<Void,
Void> - Overrides:
visitIdentifier
in classBaseTypeVisitor<BaseAnnotatedTypeFactory>
-
visitAssignment
Description copied from class:BaseTypeVisitor
Performs two checks: subtyping and assignability checks, usingBaseTypeVisitor.commonAssignmentCheck(Tree, ExpressionTree, String, Object[])
.If the subtype check fails, it issues an "assignment" error.
- Specified by:
visitAssignment
in interfaceTreeVisitor<Void,
Void> - Overrides:
visitAssignment
in classBaseTypeVisitor<BaseAnnotatedTypeFactory>
-
visitArrayAccess
- Specified by:
visitArrayAccess
in interfaceTreeVisitor<Void,
Void> - Overrides:
visitArrayAccess
in classTreeScanner<Void,
Void>
-
visitNewClass
Description copied from class:BaseTypeVisitor
Performs a new class invocation check.An invocation of a constructor, c, is valid only if:
- passed arguments are subtypes of corresponding c parameters
- if c is generic, passed type arguments are subtypes of c type variables
- Specified by:
visitNewClass
in interfaceTreeVisitor<Void,
Void> - Overrides:
visitNewClass
in classBaseTypeVisitor<BaseAnnotatedTypeFactory>
-
visitNewArray
- Specified by:
visitNewArray
in interfaceTreeVisitor<Void,
Void> - Overrides:
visitNewArray
in classBaseTypeVisitor<BaseAnnotatedTypeFactory>
-
visitTypeCast
- Specified by:
visitTypeCast
in interfaceTreeVisitor<Void,
Void> - Overrides:
visitTypeCast
in classBaseTypeVisitor<BaseAnnotatedTypeFactory>
-
visitInstanceOf
- Specified by:
visitInstanceOf
in interfaceTreeVisitor<Void,
Void> - Overrides:
visitInstanceOf
in classBaseTypeVisitor<BaseAnnotatedTypeFactory>
-
visitModifiers
- Specified by:
visitModifiers
in interfaceTreeVisitor<Void,
Void> - Overrides:
visitModifiers
in classTreeScanner<Void,
Void>
-
createTypeValidator
- Overrides:
createTypeValidator
in classBaseTypeVisitor<BaseAnnotatedTypeFactory>
-