Do not add TableFieldImpl to table in constructor of TableFieldImpl
This commit is contained in:
parent
740f8f84fe
commit
a3b08d6eb0
@ -265,7 +265,14 @@ abstract class AbstractTable<R extends Record> extends AbstractQueryPart impleme
|
||||
* @param type The data type of the field
|
||||
*/
|
||||
protected static final <R extends Record, T> TableField<R, T> createField(String name, DataType<T> type, Table<R> table) {
|
||||
return new TableFieldImpl<R, T>(name, type, table);
|
||||
final TableFieldImpl<R, T> tableField = new TableFieldImpl<R, T>(name, type, table);
|
||||
|
||||
// [#1199] The public API of Table returns immutable field lists
|
||||
if (table instanceof TableImpl) {
|
||||
((TableImpl<?>) table).fields0().add(tableField);
|
||||
}
|
||||
|
||||
return tableField;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
@ -59,11 +59,6 @@ class TableFieldImpl<R extends Record, T> extends AbstractField<T> implements Ta
|
||||
super(name, type);
|
||||
|
||||
this.table = table;
|
||||
|
||||
// [#1199] The public API of Table returns immutable field lists
|
||||
if (table instanceof TableImpl) {
|
||||
((TableImpl<?>) table).fields0().add(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Loading…
Reference in New Issue
Block a user