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
-
Nested Class Summary
Nested ClassesNested 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, methodTree, positions, PURE, SIDE_EFFECT_FREE, TARGET, targetValueElement, typeValidator, unusedWhenElementFields inherited from class org.checkerframework.framework.source.SourceVisitor
elements, root, trees, treesWithSuppressWarnings, types -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected BaseTypeValidatorvoidprocessClassTree(com.sun.source.tree.ClassTree node) Type-check classTree.visitArrayAccess(com.sun.source.tree.ArrayAccessTree node, Void p) visitAssignment(com.sun.source.tree.AssignmentTree node, Void p) Performs two checks: subtyping and assignability checks, usingBaseTypeVisitor.commonAssignmentCheck(Tree, ExpressionTree, String, Object[]).visitIdentifier(com.sun.source.tree.IdentifierTree node, Void p) visitInstanceOf(com.sun.source.tree.InstanceOfTree node, Void p) visitMemberSelect(com.sun.source.tree.MemberSelectTree node, Void p) visitMethod(com.sun.source.tree.MethodTree node, Void p) Checks that the method obeys override and subtype rules to all overridden methods.visitMethodInvocation(com.sun.source.tree.MethodInvocationTree node, Void p) Performs a method invocation check.visitModifiers(com.sun.source.tree.ModifiersTree node, Void p) visitNewArray(com.sun.source.tree.NewArrayTree node, Void p) visitNewClass(com.sun.source.tree.NewClassTree node, Void p) Performs a new class invocation check.visitTypeCast(com.sun.source.tree.TypeCastTree node, Void p) Methods inherited from class org.checkerframework.common.basetype.BaseTypeVisitor
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, 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, warnAboutIrrelevantJavaTypesMethods inherited from class org.checkerframework.framework.source.SourceVisitor
visitMethods inherited from class com.sun.source.util.TreePathScanner
getCurrentPath, scanMethods 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:
scanin classBaseTypeVisitor<BaseAnnotatedTypeFactory>
-
processClassTree
public void processClassTree(com.sun.source.tree.ClassTree node) Description copied from class:BaseTypeVisitorType-check classTree. Subclasses should override this method instead ofBaseTypeVisitor.visitClass(ClassTree, Void).- Overrides:
processClassTreein classBaseTypeVisitor<BaseAnnotatedTypeFactory>- Parameters:
node- class to check
-
visitMethod
Description copied from class:BaseTypeVisitorChecks that the method 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:
visitMethodin interfacecom.sun.source.tree.TreeVisitor<Void,Void> - Overrides:
visitMethodin classBaseTypeVisitor<BaseAnnotatedTypeFactory>
-
visitMethodInvocation
Description copied from class:BaseTypeVisitorPerforms 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:
visitMethodInvocationin interfacecom.sun.source.tree.TreeVisitor<Void,Void> - Overrides:
visitMethodInvocationin classBaseTypeVisitor<BaseAnnotatedTypeFactory>
-
visitMemberSelect
-
visitIdentifier
- Specified by:
visitIdentifierin interfacecom.sun.source.tree.TreeVisitor<Void,Void> - Overrides:
visitIdentifierin classBaseTypeVisitor<BaseAnnotatedTypeFactory>
-
visitAssignment
Description copied from class:BaseTypeVisitorPerforms two checks: subtyping and assignability checks, usingBaseTypeVisitor.commonAssignmentCheck(Tree, ExpressionTree, String, Object[]).If the subtype check fails, it issues a "assignment" error.
- Specified by:
visitAssignmentin interfacecom.sun.source.tree.TreeVisitor<Void,Void> - Overrides:
visitAssignmentin classBaseTypeVisitor<BaseAnnotatedTypeFactory>
-
visitArrayAccess
-
visitNewClass
Description copied from class:BaseTypeVisitorPerforms 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:
visitNewClassin interfacecom.sun.source.tree.TreeVisitor<Void,Void> - Overrides:
visitNewClassin classBaseTypeVisitor<BaseAnnotatedTypeFactory>
-
visitNewArray
- Specified by:
visitNewArrayin interfacecom.sun.source.tree.TreeVisitor<Void,Void> - Overrides:
visitNewArrayin classBaseTypeVisitor<BaseAnnotatedTypeFactory>
-
visitTypeCast
- Specified by:
visitTypeCastin interfacecom.sun.source.tree.TreeVisitor<Void,Void> - Overrides:
visitTypeCastin classBaseTypeVisitor<BaseAnnotatedTypeFactory>
-
visitInstanceOf
- Specified by:
visitInstanceOfin interfacecom.sun.source.tree.TreeVisitor<Void,Void> - Overrides:
visitInstanceOfin classBaseTypeVisitor<BaseAnnotatedTypeFactory>
-
visitModifiers
-
createTypeValidator
- Overrides:
createTypeValidatorin classBaseTypeVisitor<BaseAnnotatedTypeFactory>
-