public class RawTypeConformanceComputer
extends java.lang.Object
TypeConformanceComputer
which will also check the type arguments.
This architecture was chosen to avoid yet more conditions in the implementation of the
type conformance check. It allows to dispatch early to the raw type check or the
complete check based on the flags rather than probing this all the time in the implementation.Modifier and Type | Field and Description |
---|---|
static int |
ALLOW_BOXING
If this bit is set, boxing conversion may be applied to primitives
and wrapper types.
|
static int |
ALLOW_BOXING_UNBOXING
If this bit is set, boxing and unboxing conversion may be applied to primitives
and wrapper types.
|
static int |
ALLOW_FUNCTION_CONVERSION
Set this bit if synonym types should be considered.
|
static int |
ALLOW_PRIMITIVE_WIDENING
Indicates that widening conversion may be taken into account.
|
static int |
ALLOW_RAW_TYPE_CONVERSION
Indicate whether raw type conformance has to be taken into account.
|
static int |
ALLOW_SYNONYMS
Set this bit if synonym types should be considered.
|
static int |
ALLOW_UNBOXING
If this bit is set, unboxing conversion may be applied to primitives
and wrapper types.
|
static int |
AS_NESTED_TYPE_ARGUMENT
Check for conformance as if the given types were used as type arguments of type arguments.
|
static int |
AS_TYPE_ARGUMENT
Check for conformance as if the given types were used as type arguments.
|
static int |
BOXING
If boxing conversion was necessary, this bit is set.
|
static int |
DEMAND_CONVERSION
If the result has this bit set, a demand conversion had to be applied to make
both types compatible.
|
static int |
INCOMPATIBLE |
static int |
PRIMITIVE_WIDENING
This is set if primitive widening had to be applied.
|
static int |
RAW_TYPE
Indicates that the types should be checked as if they were raw types.
|
static int |
RAW_TYPE_CONVERSION
This is set if the conformance was possible due to raw type conversion.
|
static int |
SUBTYPE
Indicates that both types are in a subtype relationship.
|
static int |
SUCCESS
This bit indicates a successful check for conformance.
|
static int |
SYNONYM
If a synonym conversion was necessary, this bit is set in the result value.
|
static int |
UNBOUND_COMPUTATION_ADDS_HINTS
If otherwise unspecified
unbound references are given,
the conformance check may alter the references and
add hints . |
static int |
UNBOXING
If unboxing conversion was necessary, this bit is set.
|
static int |
UNKNOWN_TYPE_PARTICIPATED
If one of the compared types was an unknown type, this bit is set in the result value.
|
Constructor and Description |
---|
RawTypeConformanceComputer() |
public static final int RAW_TYPE
ALLOW_RAW_TYPE_CONVERSION
is set.public static final int AS_TYPE_ARGUMENT
List<Object>
is not a supertype
of List<String>
, e.g. if used as type argument, String
is not compatible to Object
.public static final int ALLOW_RAW_TYPE_CONVERSION
Class<? extends Map>
and Class<? extends Map<String, String>>
are not compatible.public static final int ALLOW_BOXING
public static final int ALLOW_UNBOXING
public static final int ALLOW_BOXING_UNBOXING
public static final int ALLOW_PRIMITIVE_WIDENING
public static final int UNBOUND_COMPUTATION_ADDS_HINTS
unbound references
are given,
the conformance check may alter the references and
add hints
.public static final int ALLOW_SYNONYMS
public static final int ALLOW_FUNCTION_CONVERSION
public static final int SUCCESS
public static final int DEMAND_CONVERSION
SYNONYM
may require a demand conversion.public static final int SUBTYPE
public static final int PRIMITIVE_WIDENING
public static final int UNBOXING
public static final int BOXING
public static final int RAW_TYPE_CONVERSION
public static final int SYNONYM
public static final int UNKNOWN_TYPE_PARTICIPATED
public static final int INCOMPATIBLE
public static final int AS_NESTED_TYPE_ARGUMENT
Iterable<Iterable<?>>
is not assignable from Iterable<Iterable<? extends CharSequence>>
.
The usage of the nested type argument is honored by this bit.@Inject public void setSynonymTypesProvider(SynonymTypesProvider synonymTypesProvider)
public int isConformant(LightweightTypeReference left, LightweightTypeReference right, int flags)
protected int isSynonymConformant(int originalConformance, LightweightTypeReference left, LightweightTypeReference right, int flags)
protected int doIsConformant(LightweightTypeReference left, LightweightTypeReference right, int flags)
protected int doIsConformant(ParameterizedTypeReference left, ArrayTypeReference right, int flags)
protected int doIsConformant(ArrayTypeReference left, ArrayTypeReference right, int flags)
protected int doIsConformant(ArrayTypeReference left, ParameterizedTypeReference right, int flags)
protected int doIsConformant(LightweightTypeReference left, WildcardTypeReference right, int flags)
protected int doIsConformant(WildcardTypeReference left, LightweightTypeReference right, int flags)
protected int doIsConformant(WildcardTypeReference left, WildcardTypeReference right, int flags)
protected int doIsConformantToAnyType(ParameterizedTypeReference left, int flags)
protected int doIsConformant(LightweightTypeReference left, UnboundTypeReference right, int flags)
protected int doIsConformant(UnboundTypeReference left, UnboundTypeReference right, int flags)
protected int tryResolveAndCheckConformance(UnboundTypeReference left, LightweightTypeReference right, int flags)
protected int tryResolveAndCheckConformance(UnboundTypeReference left, java.util.List<LightweightBoundTypeArgument> leftHints, LightweightTypeReference right, int flags)
protected int isConformantToConstraints(UnboundTypeReference left, LightweightTypeReference right, java.util.List<LightweightBoundTypeArgument> leftHints, int flags)
protected int addHintAndAnnounceSuccess(UnboundTypeReference left, LightweightTypeReference hint, int flags)
protected int isConformantMergeResult(LightweightMergedBoundTypeArgument mergeResult, LightweightTypeReference right, int flags)
protected int doIsConformant(ParameterizedTypeReference left, FunctionTypeReference right, int flags)
protected int doIsConformant(FunctionTypeReference left, FunctionTypeReference right, int flags)
protected int doIsConformant(FunctionTypeReference left, ParameterizedTypeReference right, int flags)
protected int doIsConformant(InnerFunctionTypeReference left, InnerFunctionTypeReference right, int flags)
protected int doIsConformant(InnerFunctionTypeReference left, InnerTypeReference right, int flags)
protected int doIsConformant(InnerTypeReference left, InnerFunctionTypeReference right, int flags)
protected int doIsConformant(InnerTypeReference left, InnerTypeReference right, int flags)
protected int doIsConformantOuter(LightweightTypeReference left, LightweightTypeReference right, int nestedResult, int flags)
protected int doIsConformant(ParameterizedTypeReference left, ParameterizedTypeReference right, int flags)
protected int isAssignableAsFunctionType(ParameterizedTypeReference left, ParameterizedTypeReference right, int flags)
protected int internalGetPrimitiveKindFromWrapper(JvmGenericType type)
protected int doIsConformantTypeArguments(LightweightTypeReference left, LightweightTypeReference right, int flags)
TypeConformanceComputer
to implement the type argument check.protected LightweightTypeReference getSuperType(ParameterizedTypeReference current, JvmType type)
TypeConformanceComputer
to provide the resolved super type.