[jOOQ/jOOQ#8278] Prevent StackOverflowErrors when the proxy is shared

This commit is contained in:
Lukas Eder 2020-11-18 17:32:45 +01:00
parent 8076b700f3
commit 56dda2b08d

View File

@ -81,7 +81,9 @@ final class FieldProxy<T> extends AbstractField<T> implements TableField<Record,
void delegate(AbstractField<T> newDelegate) {
this.delegate = newDelegate;
((DataTypeProxy<T>) getDataType()).type = (AbstractDataType<T>) newDelegate.getDataType();
// [#8278] Prevent StackOverflowErrors when the data type proxy is shared
if (!(newDelegate.getDataType() instanceof DataTypeProxy))
((DataTypeProxy<T>) getDataType()).type = (AbstractDataType<T>) newDelegate.getDataType();
}
@Override