public class NullnessVisitor extends InitializationVisitor<NullnessAnnotatedTypeFactory,NullnessValue,NullnessStore>
annoFormatter, initializedFields| Constructor and Description |
|---|
NullnessVisitor(org.checkerframework.common.basetype.BaseTypeChecker checker,
boolean useFbc) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkExceptionParameter(CatchTree node) |
protected void |
checkForRedundantTests(BinaryTree node)
Reports an error if a comparison of a @NonNull expression with the null literal is performed.
|
protected void |
checkMethodInvocability(org.checkerframework.framework.type.AnnotatedTypeMirror.AnnotatedExecutableType method,
MethodInvocationTree node) |
protected void |
checkThrownExpression(ThrowTree node)
Case 4: Check for thrown exception nullness.
|
protected void |
commonAssignmentCheck(org.checkerframework.framework.type.AnnotatedTypeMirror varType,
org.checkerframework.framework.type.AnnotatedTypeMirror valueType,
Tree valueTree,
@CompilerMessageKey String errorKey) |
protected void |
commonAssignmentCheck(org.checkerframework.framework.type.AnnotatedTypeMirror varType,
ExpressionTree valueExp,
@CompilerMessageKey String errorKey) |
protected void |
commonAssignmentCheck(Tree varTree,
ExpressionTree valueExp,
@CompilerMessageKey String errorKey) |
NullnessAnnotatedTypeFactory |
createTypeFactory() |
boolean |
isValidUse(org.checkerframework.framework.type.AnnotatedTypeMirror.AnnotatedDeclaredType declarationType,
org.checkerframework.framework.type.AnnotatedTypeMirror.AnnotatedDeclaredType useType,
Tree tree) |
boolean |
isValidUse(org.checkerframework.framework.type.AnnotatedTypeMirror.AnnotatedPrimitiveType type,
Tree tree) |
Void |
visitArrayAccess(ArrayAccessTree node,
Void p)
Case 3: Check for array dereferencing.
|
Void |
visitAssert(AssertTree node,
Void p) |
Void |
visitBinary(BinaryTree node,
Void p)
Case 6: Check for redundant nullness tests Case 7: unboxing case: primitive operations.
|
Void |
visitCompoundAssignment(CompoundAssignmentTree node,
Void p)
Case 7: unboxing case: primitive operation.
|
Void |
visitConditionalExpression(ConditionalExpressionTree node,
Void p) |
Void |
visitDoWhileLoop(DoWhileLoopTree node,
Void p) |
Void |
visitEnhancedForLoop(EnhancedForLoopTree node,
Void p)
Case 2: Check for implicit
.iterator call. |
Void |
visitForLoop(ForLoopTree node,
Void p) |
Void |
visitIf(IfTree node,
Void p) |
Void |
visitMemberSelect(MemberSelectTree node,
Void p)
Case 1: Check for null dereferencing.
|
Void |
visitNewArray(NewArrayTree node,
Void p) |
Void |
visitNewClass(NewClassTree node,
Void p) |
Void |
visitSwitch(SwitchTree node,
Void p) |
Void |
visitSynchronized(SynchronizedTree node,
Void p)
Case 5: Check for synchronizing locks.
|
Void |
visitTypeCast(TypeCastTree node,
Void p)
Case 7: unboxing case: casting to a primitive.
|
Void |
visitUnary(UnaryTree node,
Void p)
Case 7: unboxing case: primitive operation.
|
Void |
visitWhileLoop(WhileLoopTree node,
Void p) |
checkConstructorInvocation, checkContract, checkFieldsInitialized, processClassTree, setRoot, visitMethod, visitVariablecheckAccess, checkArguments, checkArrayInitialization, checkAssignability, checkConditionalPostcondition, checkDefaultConstructor, checkFieldInvariantDeclarations, checkForAnnotatedJdk, checkMethodReferenceAsOverride, checkOverride, checkOverride, checkPostcondition, checkPreconditions, checkTypeArguments, checkTypecastRedundancy, checkTypecastSafety, checkVarargs, createOverrideChecker, createTypeValidator, enclosingMemberSelect, enclosingStatement, getExceptionParameterLowerBoundAnnotations, getThrowUpperBoundAnnotations, getTypeFactory, isAccessAllowed, isAssignable, isValidUse, isVectorCopyInto, reportPurityErrors, scan, shouldSkipUses, skipReceiverSubtypeCheck, testTypevarContainment, typeCheckVectorCopyIntoArgument, validateType, validateTypeOf, visitAnnotation, visitAssignment, visitCatch, visitClass, visitCompilationUnit, visitIdentifier, visitInstanceOf, visitLambdaExpression, visitMemberReference, visitMethodInvocation, visitParameterizedType, visitReturn, visitThrow, visitTypeParametergetCurrentPath, scanreduce, scan, visitAnnotatedType, visitArrayType, visitBlock, visitBreak, visitCase, visitContinue, visitEmptyStatement, visitErroneous, visitExpressionStatement, visitImport, visitIntersectionType, visitLabeledStatement, visitLiteral, visitModifiers, visitOther, visitParenthesized, visitPrimitiveType, visitTry, visitUnionType, visitWildcardpublic NullnessVisitor(org.checkerframework.common.basetype.BaseTypeChecker checker,
boolean useFbc)
public NullnessAnnotatedTypeFactory createTypeFactory()
createTypeFactory in class org.checkerframework.common.basetype.BaseTypeVisitor<NullnessAnnotatedTypeFactory>public boolean isValidUse(org.checkerframework.framework.type.AnnotatedTypeMirror.AnnotatedDeclaredType declarationType,
org.checkerframework.framework.type.AnnotatedTypeMirror.AnnotatedDeclaredType useType,
Tree tree)
isValidUse in class org.checkerframework.common.basetype.BaseTypeVisitor<NullnessAnnotatedTypeFactory>public boolean isValidUse(org.checkerframework.framework.type.AnnotatedTypeMirror.AnnotatedPrimitiveType type,
Tree tree)
isValidUse in class org.checkerframework.common.basetype.BaseTypeVisitor<NullnessAnnotatedTypeFactory>protected void commonAssignmentCheck(Tree varTree, ExpressionTree valueExp, @CompilerMessageKey String errorKey)
commonAssignmentCheck in class InitializationVisitor<NullnessAnnotatedTypeFactory,NullnessValue,NullnessStore>protected void commonAssignmentCheck(org.checkerframework.framework.type.AnnotatedTypeMirror varType,
ExpressionTree valueExp,
@CompilerMessageKey String errorKey)
commonAssignmentCheck in class org.checkerframework.common.basetype.BaseTypeVisitor<NullnessAnnotatedTypeFactory>protected void commonAssignmentCheck(org.checkerframework.framework.type.AnnotatedTypeMirror varType,
org.checkerframework.framework.type.AnnotatedTypeMirror valueType,
Tree valueTree,
@CompilerMessageKey String errorKey)
commonAssignmentCheck in class org.checkerframework.common.basetype.BaseTypeVisitor<NullnessAnnotatedTypeFactory>public Void visitMemberSelect(MemberSelectTree node, Void p)
visitMemberSelect in interface TreeVisitor<Void,Void>visitMemberSelect in class TreeScanner<Void,Void>public Void visitEnhancedForLoop(EnhancedForLoopTree node, Void p)
.iterator call.visitEnhancedForLoop in interface TreeVisitor<Void,Void>visitEnhancedForLoop in class org.checkerframework.common.basetype.BaseTypeVisitor<NullnessAnnotatedTypeFactory>public Void visitArrayAccess(ArrayAccessTree node, Void p)
visitArrayAccess in interface TreeVisitor<Void,Void>visitArrayAccess in class org.checkerframework.common.basetype.BaseTypeVisitor<NullnessAnnotatedTypeFactory>public Void visitNewArray(NewArrayTree node, Void p)
visitNewArray in interface TreeVisitor<Void,Void>visitNewArray in class org.checkerframework.common.basetype.BaseTypeVisitor<NullnessAnnotatedTypeFactory>protected void checkThrownExpression(ThrowTree node)
checkThrownExpression in class org.checkerframework.common.basetype.BaseTypeVisitor<NullnessAnnotatedTypeFactory>public Void visitSynchronized(SynchronizedTree node, Void p)
visitSynchronized in interface TreeVisitor<Void,Void>visitSynchronized in class TreeScanner<Void,Void>public Void visitAssert(AssertTree node, Void p)
visitAssert in interface TreeVisitor<Void,Void>visitAssert in class TreeScanner<Void,Void>public Void visitIf(IfTree node, Void p)
visitIf in interface TreeVisitor<Void,Void>visitIf in class TreeScanner<Void,Void>protected void checkForRedundantTests(BinaryTree node)
public Void visitBinary(BinaryTree node, Void p)
visitBinary in interface TreeVisitor<Void,Void>visitBinary in class TreeScanner<Void,Void>public Void visitUnary(UnaryTree node, Void p)
visitUnary in interface TreeVisitor<Void,Void>visitUnary in class org.checkerframework.common.basetype.BaseTypeVisitor<NullnessAnnotatedTypeFactory>public Void visitCompoundAssignment(CompoundAssignmentTree node, Void p)
visitCompoundAssignment in interface TreeVisitor<Void,Void>visitCompoundAssignment in class org.checkerframework.common.basetype.BaseTypeVisitor<NullnessAnnotatedTypeFactory>public Void visitTypeCast(TypeCastTree node, Void p)
visitTypeCast in interface TreeVisitor<Void,Void>visitTypeCast in class InitializationVisitor<NullnessAnnotatedTypeFactory,NullnessValue,NullnessStore>protected void checkMethodInvocability(org.checkerframework.framework.type.AnnotatedTypeMirror.AnnotatedExecutableType method,
MethodInvocationTree node)
checkMethodInvocability in class org.checkerframework.common.basetype.BaseTypeVisitor<NullnessAnnotatedTypeFactory>public Void visitSwitch(SwitchTree node, Void p)
visitSwitch in interface TreeVisitor<Void,Void>visitSwitch in class TreeScanner<Void,Void>public Void visitForLoop(ForLoopTree node, Void p)
visitForLoop in interface TreeVisitor<Void,Void>visitForLoop in class TreeScanner<Void,Void>public Void visitNewClass(NewClassTree node, Void p)
visitNewClass in interface TreeVisitor<Void,Void>visitNewClass in class org.checkerframework.common.basetype.BaseTypeVisitor<NullnessAnnotatedTypeFactory>public Void visitWhileLoop(WhileLoopTree node, Void p)
visitWhileLoop in interface TreeVisitor<Void,Void>visitWhileLoop in class TreeScanner<Void,Void>public Void visitDoWhileLoop(DoWhileLoopTree node, Void p)
visitDoWhileLoop in interface TreeVisitor<Void,Void>visitDoWhileLoop in class TreeScanner<Void,Void>public Void visitConditionalExpression(ConditionalExpressionTree node, Void p)
visitConditionalExpression in interface TreeVisitor<Void,Void>visitConditionalExpression in class org.checkerframework.common.basetype.BaseTypeVisitor<NullnessAnnotatedTypeFactory>protected void checkExceptionParameter(CatchTree node)
checkExceptionParameter in class org.checkerframework.common.basetype.BaseTypeVisitor<NullnessAnnotatedTypeFactory>