public TypeEnvironment toApproximatingEnvironment(TypeEnvironment context) { return CompoundTypeEnvironment.create( new ApproximatingTypeEnvironment(), context ); }
@Override public Type caseGenericArrayType(GenericArrayType genericArrayType) { if ( TypeUtils.isResolved( genericArrayType ) ) { return genericArrayType; } Type componentType = genericArrayType.getGenericComponentType(); Type boundComponentType = bind( componentType ); if ( boundComponentType instanceof Class ) { return Array.newInstance( (Class) boundComponentType, 0 ).getClass(); } // fall back to coarse approximation, because I found no standard way // to instance arrays of a generic type return Object[].class; }
public Type bind(final Type type) { Type result = fineApproximation( type ); assert TypeUtils.isResolved( result ); return result; }
@Override public Type caseGenericArrayType(GenericArrayType genericArrayType) { if ( TypeUtils.isResolved( genericArrayType ) ) { return genericArrayType; } Type componentType = genericArrayType.getGenericComponentType(); Type boundComponentType = bind( componentType ); if ( boundComponentType instanceof Class ) { return Array.newInstance( (Class) boundComponentType, 0 ).getClass(); } // fall back to coarse approximation, because I found no standard way // to instance arrays of a generic type return Object[].class; }
public Type bind(final Type type) { Type result = fineApproximation( type ); assert TypeUtils.isResolved( result ); return result; }
public TypeEnvironment toApproximatingEnvironment(TypeEnvironment context) { return CompoundTypeEnvironment.create( new ApproximatingTypeEnvironment(), context ); }
@Override public Type caseGenericArrayType(GenericArrayType genericArrayType) { if ( TypeUtils.isResolved( genericArrayType ) ) { return genericArrayType; } Type componentType = genericArrayType.getGenericComponentType(); Type boundComponentType = bind( componentType ); if ( boundComponentType instanceof Class ) { return Array.newInstance( (Class) boundComponentType, 0 ).getClass(); } // fall back to coarse approximation, because I found no standard way // to instance arrays of a generic type return Object[].class; }
public Type bind(final Type type) { Type result = fineApproximation( type ); assert TypeUtils.isResolved( result ); return result; }
public TypeEnvironment toApproximatingEnvironment(TypeEnvironment context) { return CompoundTypeEnvironment.create( new ApproximatingTypeEnvironment(), context ); }
@Override public Type caseGenericArrayType(GenericArrayType genericArrayType) { if ( TypeUtils.isResolved( genericArrayType ) ) { return genericArrayType; } Type componentType = genericArrayType.getGenericComponentType(); Type boundComponentType = bind( componentType ); if ( boundComponentType instanceof Class ) { return Array.newInstance( (Class) boundComponentType, 0 ).getClass(); } // fall back to coarse approximation, because I found no standard way // to instance arrays of a generic type return Object[].class; }
public Type bind(final Type type) { Type result = fineApproximation( type ); assert TypeUtils.isResolved( result ); return result; }
public TypeEnvironment toApproximatingEnvironment(TypeEnvironment context) { return CompoundTypeEnvironment.create( new ApproximatingTypeEnvironment(), context ); }
@Override public Type caseGenericArrayType(GenericArrayType genericArrayType) { if ( TypeUtils.isResolved( genericArrayType ) ) { return genericArrayType; } Type componentType = genericArrayType.getGenericComponentType(); Type boundComponentType = bind( componentType ); if ( boundComponentType instanceof Class ) { return Array.newInstance( (Class) boundComponentType, 0 ).getClass(); } // fall back to coarse approximation, because I found no standard way // to instance arrays of a generic type return Object[].class; }
public Type bind(final Type type) { Type result = fineApproximation( type ); assert TypeUtils.isResolved( result ); return result; }
public TypeEnvironment toApproximatingEnvironment(TypeEnvironment context) { return CompoundTypeEnvironment.create( new ApproximatingTypeEnvironment(), context ); }
@Override public Type caseParameterizedType(ParameterizedType parameterizedType) { if ( TypeUtils.isResolved( parameterizedType ) ) { return parameterizedType; } if ( !TypeUtils.isCollection( parameterizedType ) ) { return Object.class; // fall back to coarse approximation } Type[] typeArguments = parameterizedType.getActualTypeArguments(); Type[] approximatedTypeArguments = new Type[typeArguments.length]; for ( int i = 0; i < typeArguments.length ; i++ ) { approximatedTypeArguments[i] = coarseApproximation( typeArguments[i] ); } return TypeFactory.createParameterizedType( bind( parameterizedType.getRawType() ), approximatedTypeArguments, parameterizedType.getOwnerType() ); }
@Override public Type caseParameterizedType(ParameterizedType parameterizedType) { if ( TypeUtils.isResolved( parameterizedType ) ) { return parameterizedType; } if ( !TypeUtils.isCollection( parameterizedType ) ) { return Object.class; // fall back to coarse approximation } Type[] typeArguments = parameterizedType.getActualTypeArguments(); Type[] approximatedTypeArguments = new Type[typeArguments.length]; for ( int i = 0; i < typeArguments.length ; i++ ) { approximatedTypeArguments[i] = coarseApproximation( typeArguments[i] ); } return TypeFactory.createParameterizedType( bind( parameterizedType.getRawType() ), approximatedTypeArguments, parameterizedType.getOwnerType() ); }
@Override public Type caseParameterizedType(ParameterizedType parameterizedType) { if ( TypeUtils.isResolved( parameterizedType ) ) { return parameterizedType; } if ( !TypeUtils.isCollection( parameterizedType ) ) { return Object.class; // fall back to coarse approximation } Type[] typeArguments = parameterizedType.getActualTypeArguments(); Type[] approximatedTypeArguments = new Type[typeArguments.length]; for ( int i = 0; i < typeArguments.length ; i++ ) { approximatedTypeArguments[i] = coarseApproximation( typeArguments[i] ); } return TypeFactory.createParameterizedType( bind( parameterizedType.getRawType() ), approximatedTypeArguments, parameterizedType.getOwnerType() ); }
@Override public Type caseParameterizedType(ParameterizedType parameterizedType) { if ( TypeUtils.isResolved( parameterizedType ) ) { return parameterizedType; } if ( !TypeUtils.isCollection( parameterizedType ) ) { return Object.class; // fall back to coarse approximation } Type[] typeArguments = parameterizedType.getActualTypeArguments(); Type[] approximatedTypeArguments = new Type[typeArguments.length]; for ( int i = 0; i < typeArguments.length ; i++ ) { approximatedTypeArguments[i] = coarseApproximation( typeArguments[i] ); } return TypeFactory.createParameterizedType( bind( parameterizedType.getRawType() ), approximatedTypeArguments, parameterizedType.getOwnerType() ); }
@Override public Type caseParameterizedType(ParameterizedType parameterizedType) { if ( TypeUtils.isResolved( parameterizedType ) ) { return parameterizedType; } if ( !TypeUtils.isCollection( parameterizedType ) ) { return Object.class; // fall back to coarse approximation } Type[] typeArguments = parameterizedType.getActualTypeArguments(); Type[] approximatedTypeArguments = new Type[typeArguments.length]; for ( int i = 0; i < typeArguments.length ; i++ ) { approximatedTypeArguments[i] = coarseApproximation( typeArguments[i] ); } return TypeFactory.createParameterizedType( bind( parameterizedType.getRawType() ), approximatedTypeArguments, parameterizedType.getOwnerType() ); }