516 * If the target type is an interface, perform no runtime check. |
516 * If the target type is an interface, perform no runtime check. |
517 * (This loophole is safe, and is allowed by the JVM verifier.) |
517 * (This loophole is safe, and is allowed by the JVM verifier.) |
518 * If the target type is a primitive, change it to a wrapper. |
518 * If the target type is a primitive, change it to a wrapper. |
519 */ |
519 */ |
520 static <T> Class<T> forceType(Class<?> type, Class<T> exampleType) { |
520 static <T> Class<T> forceType(Class<?> type, Class<T> exampleType) { |
521 boolean z = (type == exampleType || |
|
522 type.isPrimitive() && forPrimitiveType(type) == findWrapperType(exampleType) || |
|
523 exampleType.isPrimitive() && forPrimitiveType(exampleType) == findWrapperType(type) || |
|
524 type == Object.class && !exampleType.isPrimitive()); |
|
525 if (!z) |
|
526 System.out.println(type+" <= "+exampleType); |
|
527 assert(type == exampleType || |
521 assert(type == exampleType || |
528 type.isPrimitive() && forPrimitiveType(type) == findWrapperType(exampleType) || |
522 type.isPrimitive() && forPrimitiveType(type) == findWrapperType(exampleType) || |
529 exampleType.isPrimitive() && forPrimitiveType(exampleType) == findWrapperType(type) || |
523 exampleType.isPrimitive() && forPrimitiveType(exampleType) == findWrapperType(type) || |
530 type == Object.class && !exampleType.isPrimitive()); |
524 type == Object.class && !exampleType.isPrimitive()); |
531 @SuppressWarnings("unchecked") |
525 @SuppressWarnings("unchecked") |