public class ReportVisitor extends BaseTypeVisitor<BaseAnnotatedTypeFactory>
Modifier and Type | Class and Description |
---|---|
protected class |
ReportVisitor.ReportTypeValidator |
BaseTypeVisitor.OverrideChecker
atypeFactory, checker, contractsUtils, positions, TARGET, targetValueElement, typeValidator, visitorState
elements, root, trees, treesWithSuppressWarnings, types
Constructor and Description |
---|
ReportVisitor(BaseTypeChecker checker) |
Modifier and Type | Method and Description |
---|---|
protected BaseTypeValidator |
createTypeValidator() |
void |
processClassTree(com.sun.source.tree.ClassTree node)
Type-check classTree.
|
java.lang.Void |
scan(com.sun.source.tree.Tree tree,
java.lang.Void p) |
java.lang.Void |
visitArrayAccess(com.sun.source.tree.ArrayAccessTree node,
java.lang.Void p) |
java.lang.Void |
visitAssignment(com.sun.source.tree.AssignmentTree node,
java.lang.Void p)
Performs two checks: subtyping and assignability checks, using
BaseTypeVisitor.commonAssignmentCheck(Tree, ExpressionTree, String) . |
java.lang.Void |
visitIdentifier(com.sun.source.tree.IdentifierTree node,
java.lang.Void p) |
java.lang.Void |
visitInstanceOf(com.sun.source.tree.InstanceOfTree node,
java.lang.Void p) |
java.lang.Void |
visitMemberSelect(com.sun.source.tree.MemberSelectTree node,
java.lang.Void p) |
java.lang.Void |
visitMethod(com.sun.source.tree.MethodTree node,
java.lang.Void p)
Performs pseudo-assignment check: checks that the method obeys override and subtype rules to
all overridden methods.
|
java.lang.Void |
visitMethodInvocation(com.sun.source.tree.MethodInvocationTree node,
java.lang.Void p)
Performs a method invocation check.
|
java.lang.Void |
visitModifiers(com.sun.source.tree.ModifiersTree node,
java.lang.Void p) |
java.lang.Void |
visitNewArray(com.sun.source.tree.NewArrayTree node,
java.lang.Void p) |
java.lang.Void |
visitNewClass(com.sun.source.tree.NewClassTree node,
java.lang.Void p)
Performs a new class invocation check.
|
java.lang.Void |
visitTypeCast(com.sun.source.tree.TypeCastTree node,
java.lang.Void p) |
checkAccess, checkArguments, checkArrayInitialization, checkConditionalPostcondition, checkConstructorInvocation, checkConstructorResult, checkContract, checkDefaultConstructor, checkExceptionParameter, checkExtendsImplements, checkFieldInvariantDeclarations, checkForAnnotatedJdk, checkMethodInvocability, checkMethodReferenceAsOverride, checkOverride, checkOverride, checkPostcondition, checkPreconditions, checkSuperConstructorCall, checkThisConstructorCall, checkThisOrSuperConstructorCall, checkThrownExpression, checkTypeArguments, checkTypecastRedundancy, checkTypecastSafety, checkVarargs, commonAssignmentCheck, commonAssignmentCheck, commonAssignmentCheck, commonAssignmentCheckEndDiagnostic, commonAssignmentCheckStartDiagnostic, createOverrideChecker, createTypeFactory, enclosingMemberSelect, enclosingStatement, getExceptionParameterLowerBoundAnnotations, getThrowUpperBoundAnnotations, getTypeFactory, isAccessAllowed, isTypeCastSafe, isValidUse, isValidUse, isValidUse, reportPurityErrors, setRoot, shouldSkipUses, skipReceiverSubtypeCheck, testTypevarContainment, typeCheckVectorCopyIntoArgument, validateType, validateTypeOf, visitAnnotation, visitCatch, visitClass, visitCompilationUnit, visitCompoundAssignment, visitConditionalExpression, visitEnhancedForLoop, visitLambdaExpression, visitMemberReference, visitReturn, visitThrow, visitTypeParameter, visitUnary, visitVariable
visit
reduce, scan, visitAnnotatedType, visitArrayType, visitAssert, visitBinary, visitBlock, visitBreak, visitCase, visitContinue, visitDoWhileLoop, visitEmptyStatement, visitErroneous, visitExports, visitExpressionStatement, visitForLoop, visitIf, visitImport, visitIntersectionType, visitLabeledStatement, visitLiteral, visitModule, visitOpens, visitOther, visitPackage, visitParameterizedType, visitParenthesized, visitPrimitiveType, visitProvides, visitRequires, visitSwitch, visitSynchronized, visitTry, visitUnionType, visitUses, visitWhileLoop, visitWildcard
public ReportVisitor(BaseTypeChecker checker)
public java.lang.Void scan(com.sun.source.tree.Tree tree, java.lang.Void p)
scan
in class BaseTypeVisitor<BaseAnnotatedTypeFactory>
public void processClassTree(com.sun.source.tree.ClassTree node)
BaseTypeVisitor
BaseTypeVisitor.visitClass(ClassTree, Void)
.processClassTree
in class BaseTypeVisitor<BaseAnnotatedTypeFactory>
node
- class to checkpublic java.lang.Void visitMethod(com.sun.source.tree.MethodTree node, java.lang.Void p)
BaseTypeVisitor
The override rule specifies that a method, m1, may override a method m2 only if:
visitMethod
in interface com.sun.source.tree.TreeVisitor<java.lang.Void,java.lang.Void>
visitMethod
in class BaseTypeVisitor<BaseAnnotatedTypeFactory>
public java.lang.Void visitMethodInvocation(com.sun.source.tree.MethodInvocationTree node, java.lang.Void p)
BaseTypeVisitor
An invocation of a method, m, on the receiver, r is valid only if:
visitMethodInvocation
in interface com.sun.source.tree.TreeVisitor<java.lang.Void,java.lang.Void>
visitMethodInvocation
in class BaseTypeVisitor<BaseAnnotatedTypeFactory>
public java.lang.Void visitMemberSelect(com.sun.source.tree.MemberSelectTree node, java.lang.Void p)
visitMemberSelect
in interface com.sun.source.tree.TreeVisitor<java.lang.Void,java.lang.Void>
visitMemberSelect
in class com.sun.source.util.TreeScanner<java.lang.Void,java.lang.Void>
public java.lang.Void visitIdentifier(com.sun.source.tree.IdentifierTree node, java.lang.Void p)
visitIdentifier
in interface com.sun.source.tree.TreeVisitor<java.lang.Void,java.lang.Void>
visitIdentifier
in class BaseTypeVisitor<BaseAnnotatedTypeFactory>
public java.lang.Void visitAssignment(com.sun.source.tree.AssignmentTree node, java.lang.Void p)
BaseTypeVisitor
BaseTypeVisitor.commonAssignmentCheck(Tree, ExpressionTree, String)
.
If the subtype check fails, it issues a "assignment.type.incompatible" error.
visitAssignment
in interface com.sun.source.tree.TreeVisitor<java.lang.Void,java.lang.Void>
visitAssignment
in class BaseTypeVisitor<BaseAnnotatedTypeFactory>
public java.lang.Void visitArrayAccess(com.sun.source.tree.ArrayAccessTree node, java.lang.Void p)
visitArrayAccess
in interface com.sun.source.tree.TreeVisitor<java.lang.Void,java.lang.Void>
visitArrayAccess
in class BaseTypeVisitor<BaseAnnotatedTypeFactory>
public java.lang.Void visitNewClass(com.sun.source.tree.NewClassTree node, java.lang.Void p)
BaseTypeVisitor
An invocation of a constructor, c, is valid only if:
visitNewClass
in interface com.sun.source.tree.TreeVisitor<java.lang.Void,java.lang.Void>
visitNewClass
in class BaseTypeVisitor<BaseAnnotatedTypeFactory>
public java.lang.Void visitNewArray(com.sun.source.tree.NewArrayTree node, java.lang.Void p)
visitNewArray
in interface com.sun.source.tree.TreeVisitor<java.lang.Void,java.lang.Void>
visitNewArray
in class BaseTypeVisitor<BaseAnnotatedTypeFactory>
public java.lang.Void visitTypeCast(com.sun.source.tree.TypeCastTree node, java.lang.Void p)
visitTypeCast
in interface com.sun.source.tree.TreeVisitor<java.lang.Void,java.lang.Void>
visitTypeCast
in class BaseTypeVisitor<BaseAnnotatedTypeFactory>
public java.lang.Void visitInstanceOf(com.sun.source.tree.InstanceOfTree node, java.lang.Void p)
visitInstanceOf
in interface com.sun.source.tree.TreeVisitor<java.lang.Void,java.lang.Void>
visitInstanceOf
in class BaseTypeVisitor<BaseAnnotatedTypeFactory>
public java.lang.Void visitModifiers(com.sun.source.tree.ModifiersTree node, java.lang.Void p)
visitModifiers
in interface com.sun.source.tree.TreeVisitor<java.lang.Void,java.lang.Void>
visitModifiers
in class com.sun.source.util.TreeScanner<java.lang.Void,java.lang.Void>
protected BaseTypeValidator createTypeValidator()
createTypeValidator
in class BaseTypeVisitor<BaseAnnotatedTypeFactory>