Source:
public static Object convert(Object val, GridH2RowDescriptor desc, Class<?> expCls, int type) throws IgniteCheckedException { if (val == null) return null; Class<?> currCls = val.getClass(); try { if (val instanceof Date && currCls != Date.class && expCls == Date.class) { return new Date(((Date) val).getTime()); } if (type == Value.UUID && currCls == byte[].class) return U.unmarshal(desc.context().marshaller(), (byte[]) val, U.resolveClassLoader(desc.context().gridConfig())); if (val instanceof Timestamp && LocalDateTimeUtils.LOCAL_DATE_TIME ==expCls) return LocalDateTimeUtils.valueToLocalDateTime(ValueTimestamp.get((Timestamp) val)); if (val instanceof Date && LocalDateTimeUtils.LOCAL_DATE == expCls) return LocalDateTimeUtils.valueToLocalDate(ValueDate.fromDateValue( DateTimeUtils.dateValueFromDate(((Date) val).getTime()))); if (val instanceof Time && LocalDateTimeUtils.LOCAL_TIME == expCls) return LocalDateTimeUtils.valueToLocalTime(ValueTime.get((Time) val)); if (type == Value.ARRAY && currCls != expCls) { if (currCls != Object[].class) throw new IgniteCheckedException("Unexpected array type - only conversion from Object[] " + "is assumed"); assert expCls.isArray(); Object[] curr = (Object[]) val; Object newArr = Array.newInstance(expCls.getComponentType(), curr.length); System.arraycopy(curr, 0, newArr, 0, curr.length); return newArr; } Object res = H2Utils.convert(val, desc, type); if (res instanceof Date && res.getClass() != Date.class && expCls == Date.class) { return new Date(((Date) res).getTime()); } return res; } catch (Exception e) { throw new IgniteSQLException("Value conversion failed [from=" + currCls.getName() + ", to=" + expCls.getName() +']', IgniteQueryErrorCode.CONVERSION_FAILED, e); } }

Target:
public static Object convert(Object val, GridH2RowDescriptor desc, Class<?> expCls, int type) throws IgniteCheckedException { if (val == null) return null; Class<?> currCls = val.getClass(); try { if (val instanceof Date && currCls != Date.class && expCls == Date.class) return new Date(((Date) val).getTime()); if (type == Value.UUID && currCls == byte[].class) { return U.unmarshal(desc.context().marshaller(), (byte[])val, U.resolveClassLoader(desc.context().gridConfig())); } if (val instanceof Timestamp && LocalDateTimeUtils.LOCAL_DATE_TIME == expCls) return LocalDateTimeUtils.valueToLocalDateTime(ValueTimestamp.get((Timestamp)val)); if (val instanceof Date && LocalDateTimeUtils.LOCAL_DATE == expCls) { return LocalDateTimeUtils.valueToLocalDate(ValueDate.fromDateValue( DateTimeUtils.dateValueFromDate(((Date)val).getTime()))); } if (val instanceof Time && LocalDateTimeUtils.LOCAL_TIME == expCls) return LocalDateTimeUtils.valueToLocalTime(ValueTime.get((Time)val)); if (type == Value.ARRAY && currCls != expCls) { if (currCls != Object[].class) { throw new IgniteCheckedException("Unexpected array type - only conversion from Object[] " + "is assumed"); } assert expCls.isArray(); Object[] curr = (Object[])val; Object newArr = Array.newInstance(expCls.getComponentType(), curr.length); System.arraycopy(curr, 0, newArr, 0, curr.length); return newArr; } Object res = H2Utils.convert(val, desc.indexing(), type); if (res instanceof Date && res.getClass() != Date.class && expCls == Date.class) return new Date(((Date)res).getTime()); return res; } catch (Exception e) { throw new IgniteSQLException("Value conversion failed [from=" + currCls.getName() + ", to=" + expCls.getName() +']', IgniteQueryErrorCode.CONVERSION_FAILED, e); } }