public interface TypeHierarchy
QualifierHierarchy
.Modifier and Type | Method and Description |
---|---|
boolean |
isSubtype(AnnotatedTypeMirror subtype,
AnnotatedTypeMirror supertype)
Returns true if
subtype is a subtype of or convertible to supertype for all
hierarchies present. |
boolean isSubtype(AnnotatedTypeMirror subtype, AnnotatedTypeMirror supertype)
subtype
is a subtype of or convertible to supertype
for all
hierarchies present. If the underlying Java type of subtype
is not a subtype of or
convertible to the underlying Java type of supertype
, then the behavior of this
method is undefined.
Ideally, types that require conversions would be converted before isSubtype is called, but instead, isSubtype performs some of these conversions.
JLS 5.1 specifies 13 categories of conversions.
4 categories are converted in isSubtype:
AnnotatedTypes.asSuper(
AnnotatedTypeFactory, AnnotatedTypeMirror, AnnotatedTypeMirror)
which calls AnnotatedTypeFactory.getBoxedType(org.checkerframework.framework.type.AnnotatedTypeMirror.AnnotatedPrimitiveType)
AnnotatedTypes.asSuper(
AnnotatedTypeFactory, AnnotatedTypeMirror, AnnotatedTypeMirror)
which calls AnnotatedTypeFactory.getUnboxedType(org.checkerframework.framework.type.AnnotatedTypeMirror.AnnotatedDeclaredType)
AnnotatedTypes.asSuper(org.checkerframework.framework.type.AnnotatedTypeFactory, org.checkerframework.framework.type.AnnotatedTypeMirror, T)
which calls AnnotatedTypeFactory.getStringType(AnnotatedTypeMirror)
subtype
- possible subtypesupertype
- possible supertypesubtype
is a subtype of supertype
for all hierarchies
present.