Class NullnessQualifierInference
Eagerly traverse one
MethodTree
at a time and accumulate constraints between nullness
qualifiers. Those constraints are then solved as needed in InferredNullability
. Based on
Java type inference as defined in JLS section 18.- Author:
- bennostein@google.com (Benno Stein)
-
Method Summary
Modifier and TypeMethodDescriptionstatic InferredNullability
getInferredNullability
(com.sun.source.tree.Tree methodOrInitializerOrLambda) visitAssignment
(com.sun.source.tree.AssignmentTree node, Void unused) visitIdentifier
(com.sun.source.tree.IdentifierTree node, Void unused) visitMethodInvocation
(com.sun.source.tree.MethodInvocationTree node, Void unused) visitReturn
(com.sun.source.tree.ReturnTree node, Void unused) visitVariable
(com.sun.source.tree.VariableTree node, Void unused) Methods inherited from class com.sun.source.util.TreeScanner
reduce, scan, scan, visitAnnotatedType, visitAnnotation, visitAnyPattern, visitArrayAccess, visitArrayType, visitAssert, visitBinary, visitBindingPattern, visitBlock, visitBreak, visitCase, visitCatch, visitClass, visitCompilationUnit, visitCompoundAssignment, visitConditionalExpression, visitConstantCaseLabel, visitContinue, visitDeconstructionPattern, visitDefaultCaseLabel, visitDoWhileLoop, visitEmptyStatement, visitEnhancedForLoop, visitErroneous, visitExports, visitExpressionStatement, visitForLoop, visitIf, visitImport, visitInstanceOf, visitIntersectionType, visitLabeledStatement, visitLambdaExpression, visitLiteral, visitMemberReference, visitMemberSelect, visitMethod, visitModifiers, visitModule, visitNewArray, visitNewClass, visitOpens, visitOther, visitPackage, visitParameterizedType, visitParenthesized, visitPatternCaseLabel, visitPrimitiveType, visitProvides, visitRequires, visitSwitch, visitSwitchExpression, visitSynchronized, visitThrow, visitTry, visitTypeCast, visitTypeParameter, visitUnary, visitUnionType, visitUses, visitWhileLoop, visitWildcard, visitYield
-
Method Details
-
getInferredNullability
public static InferredNullability getInferredNullability(com.sun.source.tree.Tree methodOrInitializerOrLambda) -
visitIdentifier
-
visitAssignment
-
visitVariable
-
visitReturn
-
visitMethodInvocation
-