public class SupertypesSolver
extends java.lang.Object
Constructor and Description |
---|
SupertypesSolver() |
Modifier and Type | Method and Description |
---|---|
static AnnotatedTypeMirror |
groundMissingHierarchies(java.util.Map.Entry<AnnotatedTypeMirror,AnnotationMirrorSet> typeToHierarchies,
AnnotationMirrorMap<javax.lang.model.element.AnnotationMirror> lowerBoundAnnos)
For each type in typeToHierarchies, if that type does not have a corresponding annotation for
a given hierarchy replace it with the corresponding value in lowerBoundAnnos.
|
static AnnotatedTypeMirror |
leastUpperBound(javax.lang.model.type.TypeVariable target,
AnnotatedTypeFactory typeFactory,
java.util.Map<AnnotatedTypeMirror,AnnotationMirrorSet> types)
Successively calls least upper bound on the elements of types.
|
protected static void |
lubPrimaries(AnnotationMirrorMap<javax.lang.model.element.AnnotationMirror> lubOfPrimaries,
AnnotationMirrorMap<AnnotationMirrorSet> subtypeAnnos,
AnnotationMirrorSet tops,
QualifierHierarchy qualifierHierarchy)
For each qualifier hierarchy in tops, take the lub of the annos in subtypeAnnos that
correspond to that hierarchy place the lub in lubOfPrimaries.
|
protected InferredValue.InferredType |
mergeLubAnnosWithEqualities(javax.lang.model.type.TypeVariable target,
AnnotationMirrorMap<javax.lang.model.element.AnnotationMirror> lubAnnos,
ConstraintMap constraintMap,
AnnotatedTypeFactory typeFactory)
We previously found a type that is equal to target but not in all hierarchies.
|
protected InferredValue.InferredType |
mergeLubTypeWithEqualities(javax.lang.model.type.TypeVariable target,
AnnotatedTypeMirror lub,
ConstraintMap constraintMap,
AnnotatedTypeFactory typeFactory)
We previously found a type that is equal to target but not in all hierarchies.
|
protected static void |
propagatePreviousLubs(TargetConstraints targetRecord,
org.checkerframework.framework.util.typeinference.solver.SupertypesSolver.Lubs solution,
java.util.Map<AnnotatedTypeMirror,AnnotationMirrorSet> subtypesOfTarget)
If the target corresponding to targetRecord must be a supertype of another target for which
we have already determined a lub, add that target's lub to this list.
|
InferenceResult |
solveFromSupertypes(java.util.Set<javax.lang.model.type.TypeVariable> remainingTargets,
ConstraintMap constraintMap,
AnnotatedTypeFactory typeFactory)
Infers type arguments using supertype constraints.
|
public InferenceResult solveFromSupertypes(java.util.Set<javax.lang.model.type.TypeVariable> remainingTargets, ConstraintMap constraintMap, AnnotatedTypeFactory typeFactory)
remainingTargets
- targets for which we still need to infer a valueconstraintMap
- the set of constraints for all targetstarget ⇒ inferred type
), note this class always infers
concrete types and will not infer that the target is equivalent to another targetprotected InferredValue.InferredType mergeLubTypeWithEqualities(javax.lang.model.type.TypeVariable target, AnnotatedTypeMirror lub, ConstraintMap constraintMap, AnnotatedTypeFactory typeFactory)
If we failed to infer any annotation for a given hierarchy, either previously from equalities or from the lub, return null.
protected InferredValue.InferredType mergeLubAnnosWithEqualities(javax.lang.model.type.TypeVariable target, AnnotationMirrorMap<javax.lang.model.element.AnnotationMirror> lubAnnos, ConstraintMap constraintMap, AnnotatedTypeFactory typeFactory)
If we failed to infer any annotation for a given hierarchy, either previously from equalities or from the lub, return null.
protected static void propagatePreviousLubs(TargetConstraints targetRecord, org.checkerframework.framework.util.typeinference.solver.SupertypesSolver.Lubs solution, java.util.Map<AnnotatedTypeMirror,AnnotationMirrorSet> subtypesOfTarget)
protected static void lubPrimaries(AnnotationMirrorMap<javax.lang.model.element.AnnotationMirror> lubOfPrimaries, AnnotationMirrorMap<AnnotationMirrorSet> subtypeAnnos, AnnotationMirrorSet tops, QualifierHierarchy qualifierHierarchy)
public static AnnotatedTypeMirror groundMissingHierarchies(java.util.Map.Entry<AnnotatedTypeMirror,AnnotationMirrorSet> typeToHierarchies, AnnotationMirrorMap<javax.lang.model.element.AnnotationMirror> lowerBoundAnnos)
public static AnnotatedTypeMirror leastUpperBound(javax.lang.model.type.TypeVariable target, AnnotatedTypeFactory typeFactory, java.util.Map<AnnotatedTypeMirror,AnnotationMirrorSet> types)