Class<?> klass = JavaTypes.getClass(ftype); if (klass.isPrimitive()) { clone = PrimitiveArrays.toPrimitiveArray(list, klass);
public static Class<?> getClass(Type type) { if (type.isSimpleType() && !((SimpleType) type).isPrimitive()) { return getClass(((SimpleType) type).getPrimitiveType()); } return types2Class.get(type); }
protected static Class getFieldClass(Type fieldType) { Class klass = JavaTypes.getClass(fieldType); // for enumerated SimpleTypes we may need to lookup on the supertype // we do the recursion here and not in JavaTypes to avoid potential impacts if (klass == null) { assert fieldType.getSuperType() != null; return getFieldClass(fieldType.getSuperType()); } return klass; }