public final class InterningVisitor extends BaseTypeVisitor<InterningAnnotatedTypeFactory>
Interned
or InternedDistinct
. This visitor reports errors or
warnings for violations for the following cases:
BaseTypeVisitor
BaseTypeVisitor.OverrideChecker
atypeFactory, checker, contractsUtils, positions, TARGET, targetValueElement, typeValidator, visitorState
elements, 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,
ExecutableElement constructorElement)
Issue a warning if the result type of the constructor is not top.
|
void |
processClassTree(ClassTree node)
Method to implement the @UsesObjectEquals functionality.
|
Void |
visitBinary(BinaryTree node,
Void p)
Checks comparison operators, == and !=, for INTERNING violations.
|
Void |
visitMethodInvocation(MethodInvocationTree node,
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, createOverrideChecker, createTypeFactory, createTypeValidator, enclosingMemberSelect, enclosingStatement, getExceptionParameterLowerBoundAnnotations, getThrowUpperBoundAnnotations, getTypeFactory, isAccessAllowed, isValidUse, isValidUse, isValidUse, reportPurityErrors, scan, setRoot, shouldSkipUses, skipReceiverSubtypeCheck, testTypevarContainment, typeCheckVectorCopyIntoArgument, validateType, validateTypeOf, visitAnnotation, visitArrayAccess, visitAssignment, visitCatch, visitClass, visitCompilationUnit, visitCompoundAssignment, visitConditionalExpression, visitEnhancedForLoop, visitIdentifier, visitInstanceOf, visitLambdaExpression, visitMemberReference, visitMethod, visitNewArray, visitNewClass, visitParameterizedType, visitReturn, visitThrow, visitTypeCast, visitTypeParameter, visitUnary, visitVariable
visit
getCurrentPath, scan
reduce, scan, visitAnnotatedType, visitArrayType, visitAssert, visitBlock, visitBreak, visitCase, visitContinue, visitDoWhileLoop, visitEmptyStatement, visitErroneous, visitExpressionStatement, visitForLoop, visitIf, visitImport, visitIntersectionType, visitLabeledStatement, visitLiteral, visitMemberSelect, visitModifiers, visitOther, visitParenthesized, visitPrimitiveType, visitSwitch, visitSynchronized, visitTry, visitUnionType, visitWhileLoop, visitWildcard
public InterningVisitor(BaseTypeChecker checker)
public Void visitBinary(BinaryTree node, Void p)
visitBinary
in interface TreeVisitor<Void,Void>
visitBinary
in class TreeScanner<Void,Void>
public Void visitMethodInvocation(MethodInvocationTree node, Void p)
visitMethodInvocation
in interface TreeVisitor<Void,Void>
visitMethodInvocation
in class BaseTypeVisitor<InterningAnnotatedTypeFactory>
public void processClassTree(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, ExecutableElement constructorElement)
BaseTypeVisitor
#isValidUse(AnnotatedDeclaredType, AnnotatedDeclaredType, Tree)
.checkConstructorResult
in class BaseTypeVisitor<InterningAnnotatedTypeFactory>
constructorType
- AnnotatedExecutableType for the constructorconstructorElement
- element that declares the constructor