6667686970717273747576
Coercion c = getCoercion(sourceType); try { return type.cast(c.coerce(input)); } catch (Exception ex) { throw new RuntimeException(ServiceMessages.failedCoercion(input, type, c, ex), ex); } }
7475767778798081828384
assertSame(coercer.coerce(input, Number.class), input); Coercion coercion = coercer.getCoercion(int.class, Number.class); assertSame(coercion.coerce(input), input); } @Test public void explain_to_same_type() {
156157158159160161162163164165166
assertEquals(actual, expected); Coercion c = coercer.getCoercion(input == null ? void.class : input.getClass(), targetType); assertEquals(c.coerce(input), expected); } @SuppressWarnings("unchecked") @DataProvider public Object[][] coercions_inputs()
7677787980818283848586
6768697071727374757677
Coercion c = getCoercion(sourceType); try { return type.cast(c.coerce(input)); } catch (Exception ex) { throw new RuntimeException(ServiceMessages.failedCoercion(input, type, c, ex), ex); }
7273747576777879808182
152153154155156157158159160161162
6061626364656667686970
Coercion c = getCoercion(sourceType); try { return type.cast(c.coerce(input)); } catch (Exception ex) { throw new RuntimeException(ServiceMessages.failedCoercion( input,