public final class InterningVisitor extends BaseTypeVisitor<InterningAnnotatedTypeFactory>
Interned or InternedDistinct. This visitor reports errors or
warnings for violations for the following cases:
BaseTypeVisitorBaseTypeVisitor.OverrideCheckeratypeFactory, checker, contractsUtils, positions, TARGET, targetValueElement, typeValidator, visitorStateelements, root, trees, treesWithSuppressWarnings, types| Constructor and Description |
|---|
InterningVisitor(BaseTypeChecker checker)
Create an InterningVisitor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkConstructorResult(AnnotatedTypeMirror.AnnotatedExecutableType constructorType,
javax.lang.model.element.ExecutableElement constructorElement)
Issue a warning if the result type of the constructor is not top.
|
void |
processClassTree(com.sun.source.tree.ClassTree node)
Method to implement the @UsesObjectEquals functionality.
|
boolean |
validateTypeOf(com.sun.source.tree.Tree tree)
Tests whether the tree expressed by the passed type tree is a valid type, and emits an error
if that is not the case (e.g.
|
java.lang.Void |
visitBinary(com.sun.source.tree.BinaryTree node,
java.lang.Void p)
Checks comparison operators, == and !=, for INTERNING violations.
|
java.lang.Void |
visitMethodInvocation(com.sun.source.tree.MethodInvocationTree node,
java.lang.Void p)
If lint option "dotequals" is specified, warn if the .equals method is used where reference
equality is safe.
|
checkAccess, checkArguments, checkArrayInitialization, checkConditionalPostcondition, checkConstructorInvocation, 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, createTypeValidator, enclosingMemberSelect, enclosingStatement, getExceptionParameterLowerBoundAnnotations, getThrowUpperBoundAnnotations, getTypeFactory, isAccessAllowed, isTypeCastSafe, isValidUse, isValidUse, isValidUse, reportPurityErrors, scan, setRoot, shouldSkipUses, skipReceiverSubtypeCheck, testTypevarContainment, typeCheckVectorCopyIntoArgument, validateType, visitAnnotation, visitArrayAccess, visitAssignment, visitCatch, visitClass, visitCompilationUnit, visitCompoundAssignment, visitConditionalExpression, visitEnhancedForLoop, visitIdentifier, visitInstanceOf, visitLambdaExpression, visitMemberReference, visitMethod, visitNewArray, visitNewClass, visitReturn, visitThrow, visitTypeCast, visitTypeParameter, visitUnary, visitVariablevisitreduce, scan, visitAnnotatedType, visitArrayType, visitAssert, 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 InterningVisitor(BaseTypeChecker checker)
public java.lang.Void visitBinary(com.sun.source.tree.BinaryTree node,
java.lang.Void p)
visitBinary in interface com.sun.source.tree.TreeVisitor<java.lang.Void,java.lang.Void>visitBinary in class com.sun.source.util.TreeScanner<java.lang.Void,java.lang.Void>public java.lang.Void visitMethodInvocation(com.sun.source.tree.MethodInvocationTree node,
java.lang.Void p)
visitMethodInvocation in interface com.sun.source.tree.TreeVisitor<java.lang.Void,java.lang.Void>visitMethodInvocation in class BaseTypeVisitor<InterningAnnotatedTypeFactory>public void processClassTree(com.sun.source.tree.ClassTree node)
processClassTree in class BaseTypeVisitor<InterningAnnotatedTypeFactory>node - class to checkSourceVisitor.visitClass(com.sun.source.tree.ClassTree,
java.lang.Object)protected void checkConstructorResult(AnnotatedTypeMirror.AnnotatedExecutableType constructorType, javax.lang.model.element.ExecutableElement constructorElement)
BaseTypeVisitorBaseTypeVisitor.isValidUse(AnnotatedTypeMirror.AnnotatedDeclaredType,AnnotatedTypeMirror.AnnotatedDeclaredType,Tree).checkConstructorResult in class BaseTypeVisitor<InterningAnnotatedTypeFactory>constructorType - AnnotatedExecutableType for the constructorconstructorElement - element that declares the constructorpublic boolean validateTypeOf(com.sun.source.tree.Tree tree)
BaseTypeVisitorvalidateTypeOf in class BaseTypeVisitor<InterningAnnotatedTypeFactory>tree - the AST type supplied by the user