Type[] resolvedTypeArguments;
if (Enum.class.equals(parameterizedType.getRawType()))
{
// Enums derive from themselves, which would create an infinite loop
// we directly escape the loop if we detect this.
resolvedTypeArguments = new Type[]{new OwbWildcardTypeImpl(new Type[]{Enum.class}, ClassUtil.NO_TYPES)};
}
else
{
resolvedTypeArguments = resolveTypes(parameterizedType.getActualTypeArguments(), actualType);
}
return new OwbParametrizedTypeImpl(parameterizedType.getOwnerType(), parameterizedType.getRawType(), resolvedTypeArguments);
}
else if (type instanceof TypeVariable)
{
TypeVariable<?> variable = (TypeVariable<?>)type;
return resolveTypeVariable(variable, actualType);
}
else if (type instanceof WildcardType)
{
WildcardType wildcardType = (WildcardType)type;
Type[] upperBounds = resolveTypes(wildcardType.getUpperBounds(), actualType);
Type[] lowerBounds = resolveTypes(wildcardType.getLowerBounds(), actualType);
return new OwbWildcardTypeImpl(upperBounds, lowerBounds);
}
else if (type instanceof GenericArrayType)
{
GenericArrayType arrayType = (GenericArrayType)type;
return createArrayType(resolveType(arrayType.getGenericComponentType(), actualType));