Class CheckedExceptionConstraint
java.lang.Object
org.checkerframework.framework.util.typeinference8.constraint.TypeConstraint
org.checkerframework.framework.util.typeinference8.constraint.CheckedExceptionConstraint
- All Implemented Interfaces:
Constraint
,ReductionResult
<LambdaExpression →throws T>: The checked exceptions thrown by the body of the
LambdaExpression are declared by the throws clause of the function type derived from T.
<MethodReference →throws T>: The checked exceptions thrown by the referenced method are declared by the throws clause of the function type derived from T.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.checkerframework.framework.util.typeinference8.constraint.Constraint
Constraint.Kind
Nested classes/interfaces inherited from interface org.checkerframework.framework.util.typeinference8.constraint.ReductionResult
ReductionResult.ReductionResultPair
-
Field Summary
Modifier and TypeFieldDescriptionprotected final ExpressionTree
LambdaExpressionTree
orMemberReferenceTree
for this constraint.protected final Theta
The mapping from type variable to inference variable to use with this constraint.Fields inherited from class org.checkerframework.framework.util.typeinference8.constraint.TypeConstraint
T
Fields inherited from interface org.checkerframework.framework.util.typeinference8.constraint.ReductionResult
UNCHECKED_CONVERSION
-
Constructor Summary
ConstructorDescriptionCheckedExceptionConstraint
(ExpressionTree expression, AbstractType t, Theta map) Creates aCheckedExceptionConstraint
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
For lambda and method references constraints, input variables are roughly the inference variables mentioned by they function type's parameter types and return types.getKind()
Return the kind of constraint."The output variables of [expression] constraints are all inference variables mentioned by the type on the right-hand side of the constraint, T, that are not input variables."int
hashCode()
reduce
(Java8InferenceContext context) Reduce this constraint what this means depends on the kind of constraint.Methods inherited from class org.checkerframework.framework.util.typeinference8.constraint.TypeConstraint
applyInstantiations, getInferenceVariables, getInputVariablesForExpression, getT
-
Field Details
-
expression
LambdaExpressionTree
orMemberReferenceTree
for this constraint. -
map
The mapping from type variable to inference variable to use with this constraint.
-
-
Constructor Details
-
CheckedExceptionConstraint
Creates aCheckedExceptionConstraint
.- Parameters:
expression
-LambdaExpressionTree
orMemberReferenceTree
for this constraintt
- a function typemap
- The mapping from type variable to inference variable to use with this constraint
-
-
Method Details
-
getKind
Description copied from interface:Constraint
Return the kind of constraint.- Returns:
- the kind of constraint
-
getInputVariables
Description copied from class:TypeConstraint
For lambda and method references constraints, input variables are roughly the inference variables mentioned by they function type's parameter types and return types. For conditional expression constraints and switch expression constraints, input variables are the union of the input variables of its subexpressions. For all other constraints, no input variables exist.Defined in JLS section 18.5.2.2
- Specified by:
getInputVariables
in classTypeConstraint
- Returns:
- input variables for this constraint
-
getOutputVariables
Description copied from class:TypeConstraint
"The output variables of [expression] constraints are all inference variables mentioned by the type on the right-hand side of the constraint, T, that are not input variables."As defined in JLS section 18.5.2.2
- Specified by:
getOutputVariables
in classTypeConstraint
- Returns:
- output variables for this constraint
-
reduce
Description copied from interface:Constraint
Reduce this constraint what this means depends on the kind of constraint. Reduction can produce new bounds and/or new constraints.Reduction is documented in JLS section 18.2
- Parameters:
context
- Java8InferenceContext- Returns:
- the result of reducing this constraint
-
equals
- Overrides:
equals
in classTypeConstraint
-
hashCode
public int hashCode()- Overrides:
hashCode
in classTypeConstraint
-