Class Java8InferenceContext
java.lang.Object
org.checkerframework.framework.util.typeinference8.util.Java8InferenceContext
An object to pass around for use during invocation type inference. One context is created per
top-level invocation expression.
-
Field Summary
Modifier and TypeFieldDescriptionfinal DeclaredType
The type of class that encloses the top level expression whose type arguments are inferred.final ProcessingEnvironment
javax.annotation.processing.ProcessingEnvironmentfinal InvocationTypeInference
Invocation type inference object.final InferenceFactory
The inference factory.final Set<VariableElement>
There's no way to tell if an element is a parameter of a lambda, so keep track of them.final Map<ExpressionTree,
Theta> Store previously created type variable to inference variable maps as a map from invocation expression to Theta.final Types
javax.lang.model.util.Typesfinal ProperType
ProperType for java.lang.Object.Path to the top level expression whose type arguments are inferred.final TypeMirror
TypeMirror for java.lang.RuntimeException.final AnnotatedTypeFactory
The annotated type factory.final com.sun.tools.javac.code.Types
com.sun.tools.javac.code.Types -
Constructor Summary
ConstructorDescriptionJava8InferenceContext
(AnnotatedTypeFactory factory, TreePath pathToExpression, InvocationTypeInference inference) Creates a context -
Method Summary
Modifier and TypeMethodDescriptionvoid
addLambdaParms
(List<? extends VariableTree> parameters) Adds the parameters to the list of trees that are lambda parameters.int
Return the next number to use as the id for a capture variable.int
Returns the next number to use as the id for a qualifier variable.int
Returns the next number to use as the id for a non-capture variable.boolean
isLambdaParam
(ExpressionTree expression) Return whether theexpression
is a lambda parameter.
-
Field Details
-
pathToExpression
Path to the top level expression whose type arguments are inferred. -
env
javax.annotation.processing.ProcessingEnvironment -
object
ProperType for java.lang.Object. -
inference
Invocation type inference object. -
types
public final com.sun.tools.javac.code.Types typescom.sun.tools.javac.code.Types -
modelTypes
javax.lang.model.util.Types -
enclosingType
The type of class that encloses the top level expression whose type arguments are inferred. -
maps
Store previously created type variable to inference variable maps as a map from invocation expression to Theta. -
runtimeEx
TypeMirror for java.lang.RuntimeException. -
inferenceTypeFactory
The inference factory. -
typeFactory
The annotated type factory. -
lambdaParms
There's no way to tell if an element is a parameter of a lambda, so keep track of them.
-
-
Constructor Details
-
Java8InferenceContext
public Java8InferenceContext(AnnotatedTypeFactory factory, TreePath pathToExpression, InvocationTypeInference inference) Creates a context- Parameters:
factory
- type factorypathToExpression
- path to the expression whose type arguments are inferredinference
- inference object
-
-
Method Details
-
getNextVariableId
public int getNextVariableId()Returns the next number to use as the id for a non-capture variable. This id is only unique for this inference problem.- Returns:
- the next number to use as the id for a non-capture variable
-
getNextCaptureVariableId
public int getNextCaptureVariableId()Return the next number to use as the id for a capture variable. This id is only unique for this inference problem.- Returns:
- the next number to use as the id for a capture variable
-
getNextQualifierVariableId
public int getNextQualifierVariableId()Returns the next number to use as the id for a qualifier variable. This id is only unique for this inference problem.- Returns:
- the next number to use as the id for a qualifier variable
-
addLambdaParms
Adds the parameters to the list of trees that are lambda parameters.There's no way to tell if a tree is a parameter of a lambda, so keep track of them.
- Parameters:
parameters
- list of lambda parameters
-
isLambdaParam
Return whether theexpression
is a lambda parameter.- Parameters:
expression
- an expression- Returns:
- whether the
expression
is a lambda parameter
-