IDEMPIERE-4287 Fix for AD_Table caching (#296)

fix infinite loop
This commit is contained in:
hengsin 2020-10-13 18:01:39 +08:00 committed by GitHub
parent 4a0b44ac83
commit 5a83afb565
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -289,7 +289,8 @@ public class MTable extends X_AD_Table implements ImmutablePOSupport
*/
public MTable(Properties ctx, MTable copy, String trxName)
{
this(ctx, 0, trxName);
//-1 to avoid infinite loop
this(ctx, -1, trxName);
copyPO(copy);
this.m_columns = copy.m_columns != null ? Arrays.stream(copy.m_columns).map(e -> {return new MColumn(ctx, e, trxName);}).toArray(MColumn[]::new): null;
this.m_columnNameMap = copy.m_columnNameMap != null ? new HashMap<String, Integer>(copy.m_columnNameMap) : null;