public class UpperBoundVisitor extends BaseTypeVisitor<UpperBoundAnnotatedTypeFactory>
BaseTypeVisitor.OverrideCheckeratypeFactory, checker, DETERMINISTIC, inferPurity, methodTree, positions, PURE, SIDE_EFFECT_FREE, TARGET, targetValueElement, typeValidator, unusedWhenElementelements, root, trees, treesWithSuppressWarnings, types| Constructor and Description |
|---|
UpperBoundVisitor(BaseTypeChecker checker) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
commonAssignmentCheck(AnnotatedTypeMirror varType,
ExpressionTree valueTree,
@CompilerMessageKey String errorKey,
Object... extraArgs)
Checks the validity of an assignment (or pseudo-assignment) from a value to a variable and
emits an error message (through the compiler's messaging interface) if it is not valid.
|
protected void |
commonAssignmentCheck(Tree varTree,
ExpressionTree valueTree,
@CompilerMessageKey String errorKey,
Object... extraArgs)
Checks the validity of an assignment (or pseudo-assignment) from a value to a variable and
emits an error message (through the compiler's messaging interface) if it is not valid.
|
Void |
visitAnnotation(AnnotationTree node,
Void p)
Warns about LTLengthOf annotations with arguments whose lengths do not match.
|
Void |
visitArrayAccess(ArrayAccessTree tree,
Void type)
When the visitor reaches an array access, it needs to check a couple of things.
|
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, commonAssignmentCheckEndDiagnostic, commonAssignmentCheckEndDiagnostic, commonAssignmentCheckStartDiagnostic, createOverrideChecker, createTypeFactory, createTypeFactoryPublic, createTypeValidator, enclosingMemberSelect, enclosingStatement, getExceptionParameterLowerBoundAnnotations, getThrowUpperBoundAnnotations, getTypeFactory, isTypeCastSafe, isValidUse, isValidUse, isValidUse, processClassTree, reportMethodInvocabilityError, reportPurityErrors, scan, setRoot, shouldSkipUses, shouldWarnAboutIrrelevantJavaTypes, skipReceiverSubtypeCheck, testAnnotationInsertion, testJointJavacJavaParserVisitor, testTypevarContainment, typeCheckVectorCopyIntoArgument, validateType, validateTypeOf, visitAnnotatedType, visitAnnotatedType, visitAssignment, visitCatch, visitClass, visitCompilationUnit, visitCompoundAssignment, visitConditionalExpression, visitEnhancedForLoop, visitIdentifier, visitInstanceOf, visitLambdaExpression, visitMemberReference, visitMethod, visitMethodInvocation, visitNewArray, visitNewClass, visitReturn, visitSwitchExpression17, visitThrow, visitTypeCast, visitTypeParameter, visitUnary, visitVariable, warnAboutIrrelevantJavaTypesvisitgetCurrentPath, scanreduce, scan, 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, visitWildcardpublic UpperBoundVisitor(BaseTypeChecker checker)
public Void visitArrayAccess(ArrayAccessTree tree, Void type)
visitArrayAccess in interface TreeVisitor<Void,Void>visitArrayAccess in class TreeScanner<Void,Void>public Void visitAnnotation(AnnotationTree node, Void p)
visitAnnotation in interface TreeVisitor<Void,Void>visitAnnotation in class BaseTypeVisitor<UpperBoundAnnotatedTypeFactory>protected void commonAssignmentCheck(Tree varTree, ExpressionTree valueTree, @CompilerMessageKey String errorKey, Object... extraArgs)
BaseTypeVisitorcommonAssignmentCheck in class BaseTypeVisitor<UpperBoundAnnotatedTypeFactory>varTree - the AST node for the lvalue (usually a variable)valueTree - the AST node for the rvalue (the new value)errorKey - the error message key to use if the check failsextraArgs - arguments to the error message key, before "found" and "expected" typesprotected void commonAssignmentCheck(AnnotatedTypeMirror varType, ExpressionTree valueTree, @CompilerMessageKey String errorKey, Object... extraArgs)
BaseTypeVisitorcommonAssignmentCheck in class BaseTypeVisitor<UpperBoundAnnotatedTypeFactory>varType - the annotated type for the lvalue (usually a variable)valueTree - the AST node for the rvalue (the new value)errorKey - the error message key to use if the check failsextraArgs - arguments to the error message key, before "found" and "expected" types