[jOOQ/jOOQ#16013] ClassCastException during invocation of double-wrapped
ConvertedDataType
This commit is contained in:
parent
834b42ffe3
commit
89fb4edb25
@ -842,6 +842,13 @@ implements
|
||||
return convert(object, converterContext());
|
||||
}
|
||||
|
||||
static final <T> T convert0(DataType<T> type, Object object, ConverterContext cc) {
|
||||
if (type instanceof AbstractDataType<T> t)
|
||||
return t.convert(object, cc);
|
||||
else
|
||||
return type.convert(object);
|
||||
}
|
||||
|
||||
/* non-final */ T convert(Object object, ConverterContext cc) {
|
||||
|
||||
// [#1441] Avoid unneeded type conversions to improve performance
|
||||
|
||||
@ -316,8 +316,9 @@ final class ConvertedDataType<T, U> extends AbstractDataTypeX<U> {
|
||||
return (U) object;
|
||||
|
||||
// [#3200] Try to convert arbitrary objects to T
|
||||
// [#16013] [#17428] Avoid repeated conversion in case of chained converters
|
||||
else
|
||||
return ((ContextConverter<T, U>) getConverter()).from(delegate.convert(object, cc), cc);
|
||||
return ((ContextConverter<T, U>) getConverter()).from((T) convert0(delegate(delegate), object, cc), cc);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Loading…
Reference in New Issue
Block a user