Class GlbUtil
java.lang.Object
org.checkerframework.framework.util.typeinference.GlbUtil
A class used to determine the greatest lower bounds for a set of AnnotatedTypeMirrors.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic AnnotatedTypeMirror
glbAll
(Map<AnnotatedTypeMirror, AnnotationMirrorSet> typeMirrors, AnnotatedTypeFactory typeFactory) Note: This method can be improved for wildcards and type variables.static void
sortForGlb
(List<? extends AnnotatedTypeMirror> typeMirrors, AnnotatedTypeFactory typeFactory) Sort the list of type mirrors, placing supertypes first and subtypes last.
-
Constructor Details
-
GlbUtil
public GlbUtil()
-
-
Method Details
-
glbAll
public static AnnotatedTypeMirror glbAll(Map<AnnotatedTypeMirror, AnnotationMirrorSet> typeMirrors, AnnotatedTypeFactory typeFactory) Note: This method can be improved for wildcards and type variables.- Returns:
- the greatest lower bound of typeMirrors. If any of the type mirrors are incomparable, use an AnnotatedNullType that will contain the greatest lower bounds of the primary annotations of typeMirrors.
-
sortForGlb
public static void sortForGlb(List<? extends AnnotatedTypeMirror> typeMirrors, AnnotatedTypeFactory typeFactory) Sort the list of type mirrors, placing supertypes first and subtypes last.E.g. the list:
ArrayList<String>, List<String>, AbstractList<String>
becomes:List<String>, AbstractList<String>, ArrayList<String>
-