@SuppressWarnings("unchecked") private static <T> Class<T> getTypeParamBoundRawType(Type type) { if (type instanceof Class<?>) { return (Class<T>) type; } if (type instanceof ParameterizedType) { if (((ParameterizedType) type).getRawType() instanceof Class<?>) { return (Class<T>) ((ParameterizedType) type).getRawType(); } } if (type instanceof TypeVariable<?>) { TypeVariable<?> variable = (TypeVariable<?>) type; Type[] bounds = variable.getBounds(); return getBound(bounds); } throw new IllegalStateException("Signature encoding error - unexpected type parameter bound type: " + type); }
@SuppressWarnings("unchecked") private static <T> Class<T> getTypeParamBoundRawType(Type type) { if (type instanceof Class<?>) { return (Class<T>) type; } if (type instanceof ParameterizedType) { if (((ParameterizedType) type).getRawType() instanceof Class<?>) { return (Class<T>) ((ParameterizedType) type).getRawType(); } } if (type instanceof TypeVariable<?>) { TypeVariable<?> variable = (TypeVariable<?>) type; Type[] bounds = variable.getBounds(); return getBound(bounds); } throw new IllegalStateException("Signature encoding error - unexpected type parameter bound type: " + type); }
@SuppressWarnings("unchecked") private static <T> Class<T> getTypeParamBoundRawType(Type type) { if (type instanceof Class<?>) { return (Class<T>) type; } if (type instanceof ParameterizedType) { if (((ParameterizedType) type).getRawType() instanceof Class<?>) { return (Class<T>) ((ParameterizedType) type).getRawType(); } } if (type instanceof TypeVariable<?>) { TypeVariable<?> variable = (TypeVariable<?>) type; Type[] bounds = variable.getBounds(); return getBound(bounds); } throw new IllegalStateException("Signature encoding error - unexpected type parameter bound type: " + type); }
@SuppressWarnings("unchecked") private static <T> Class<T> getTypeParamBoundRawType(Type type) { if (type instanceof Class<?>) { return (Class<T>) type; } if (type instanceof ParameterizedType) { if (((ParameterizedType) type).getRawType() instanceof Class<?>) { return (Class<T>) ((ParameterizedType) type).getRawType(); } } if (type instanceof TypeVariable<?>) { TypeVariable<?> variable = (TypeVariable<?>) type; Type[] bounds = variable.getBounds(); return getBound(bounds); } throw new IllegalStateException("Signature encoding error - unexpected type parameter bound type: " + type); }
@SuppressWarnings("unchecked") private static <T> Class<T> getTypeParamBoundRawType(Type type) { if (type instanceof Class<?>) { return (Class<T>) type; } if (type instanceof ParameterizedType) { if (((ParameterizedType) type).getRawType() instanceof Class<?>) { return (Class<T>) ((ParameterizedType) type).getRawType(); } } if (type instanceof TypeVariable<?>) { TypeVariable<?> variable = (TypeVariable<?>) type; Type[] bounds = variable.getBounds(); return getBound(bounds); } throw new IllegalStateException("Signature encoding error - unexpected type parameter bound type: " + type); }