@SuppressWarnings("unchecked") Class<T> getErasedClass() { if (_erasedClass == null) { final String fullName = getFullName(); try { _erasedClass = (Class<T>)Class.forName(fullName); } catch (ClassNotFoundException e) { throw Error.couldNotResolveType(fullName); } } return _erasedClass; }
private TypeVariable<?> resolveTypeVariable() { for (final TypeVariable typeVariable : _declaringType.getErasedClass().getTypeParameters()) { if (_name.equals(typeVariable.getName())) { return typeVariable; } } throw Error.couldNotResolveType(_name); }
@SuppressWarnings("unchecked") Class<T> getErasedClass() { if (_erasedClass == null) { final String fullName = getFullName(); try { _erasedClass = (Class<T>)Class.forName(fullName); } catch (ClassNotFoundException e) { throw Error.couldNotResolveType(fullName); } } return _erasedClass; }
private TypeVariable<?> resolveTypeVariable() { for (final TypeVariable typeVariable : _declaringType.getErasedClass().getTypeParameters()) { if (_name.equals(typeVariable.getName())) { return typeVariable; } } throw Error.couldNotResolveType(_name); }
@SuppressWarnings("unchecked") Class<T> getErasedClass() { if (_erasedClass == null) { final String fullName = getFullName(); try { _erasedClass = (Class<T>) Class.forName(fullName); } catch (final ClassNotFoundException e) { throw Error.couldNotResolveType(fullName); } } return _erasedClass; }
private TypeVariable<?> resolveTypeVariable() { final TypeVariable[] parameters; if (_declaringMethod != null) { parameters = _declaringMethod.getRawMethod().getTypeParameters(); } else { parameters = _declaringType.getErasedClass().getTypeParameters(); } for (final TypeVariable typeVariable : parameters) { if (_name.equals(typeVariable.getName())) { return typeVariable; } } throw Error.couldNotResolveType(_name); }
public static <T> Type<T> of(final Class<T> clazz) { synchronized (CACHE_LOCK) { final Type<T> reflectedType = CACHE.find(clazz); if (reflectedType != null) { return reflectedType; } int arrayDepth = 0; Class<?> actualClass = clazz; while (actualClass.isArray()) { actualClass = actualClass.getComponentType(); ++arrayDepth; } Type<?> resolvedType = resolveClassType(actualClass); if (resolvedType == null) { throw Error.couldNotResolveType(clazz); } while (arrayDepth > 0) { resolvedType = resolvedType.makeArrayType(); --arrayDepth; } return (Type<T>)resolvedType; } }
public static <T> Type<T> of(final Class<T> clazz) { synchronized (CACHE_LOCK) { final Type<T> reflectedType = CACHE.find(clazz); if (reflectedType != null) { return reflectedType; } int arrayDepth = 0; Class<?> actualClass = clazz; while (actualClass.isArray()) { actualClass = actualClass.getComponentType(); ++arrayDepth; } Type<?> resolvedType = resolveClassType(actualClass); if (resolvedType == null) { throw Error.couldNotResolveType(clazz); } while (arrayDepth > 0) { resolvedType = resolvedType.makeArrayType(); --arrayDepth; } return (Type<T>) resolvedType; } }
public static <T> Type<T> of(final Class<T> clazz) { synchronized (CACHE_LOCK) { final Type<T> reflectedType = CACHE.find(clazz); if (reflectedType != null) { return reflectedType; } int arrayDepth = 0; Class<?> actualClass = clazz; while (actualClass.isArray()) { actualClass = actualClass.getComponentType(); ++arrayDepth; } Type<?> resolvedType = resolveClassType(actualClass); if (resolvedType == null) { throw Error.couldNotResolveType(clazz); } while (arrayDepth > 0) { resolvedType = resolvedType.makeArrayType(); --arrayDepth; } return (Type<T>)resolvedType; } }
static <T> Type<T> of(final java.lang.reflect.Type type) { if (type instanceof GenericArrayType) { return (Type<T>) of(((GenericArrayType) type).getGenericComponentType()).makeArrayType(); } if (type instanceof Class<?>) { return of((Class<T>) type); } synchronized (CACHE_LOCK) { Type<T> resultType = (Type<T>) tryFind(type); if (resultType != null) { return resultType; } // loadAncestors(type); resultType = (Type<T>) RESOLVER.resolve(type); if (resultType != null) { return resultType; } throw Error.couldNotResolveType(type); } }
static <T> Type<T> of(final java.lang.reflect.Type type) { if (type instanceof GenericArrayType) { return (Type<T>)of(((GenericArrayType)type).getGenericComponentType()).makeArrayType(); } if (type instanceof Class<?>) { return of((Class<T>) type); } synchronized (CACHE_LOCK) { Type<T> resultType = (Type<T>)tryFind(type); if (resultType != null) { return resultType; } // loadAncestors(type); resultType = (Type<T>)RESOLVER.resolve(type); if (resultType != null) { return resultType; } throw Error.couldNotResolveType(type); } }
static <T> Type<T> of(final java.lang.reflect.Type type) { if (type instanceof GenericArrayType) { return (Type<T>)of(((GenericArrayType)type).getGenericComponentType()).makeArrayType(); } if (type instanceof Class<?>) { return of((Class<T>) type); } synchronized (CACHE_LOCK) { Type<T> resultType = (Type<T>)tryFind(type); if (resultType != null) { return resultType; } // loadAncestors(type); resultType = (Type<T>)RESOLVER.resolve(type); if (resultType != null) { return resultType; } throw Error.couldNotResolveType(type); } }
throw Error.couldNotResolveType(sb); throw Error.couldNotResolveType(sb);
throw Error.couldNotResolveType(sb); throw Error.couldNotResolveType(sb);
throw Error.couldNotResolveType(sb); throw Error.couldNotResolveType(sb);