IDEMPIERE-5286 Fix ConcurrentModificationException in MPrintFormat.getAllItems Method (#1349)

This commit is contained in:
Anozi Mada 2022-05-31 11:35:22 +07:00 committed by GitHub
parent f5a0a0a2f6
commit 935987bd9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 4 deletions

View File

@ -300,10 +300,8 @@ public class MPrintFormat extends X_AD_PrintFormat implements ImmutablePOSupport
.list();
MRole role = MRole.getDefault(getCtx(), false);
for (MPrintFormatItem pfi : list) {
if (! role.isColumnAccess(getAD_Table_ID(), pfi.getAD_Column_ID(), true))
list.remove(pfi);
}
list.removeIf(pfi -> !role.isColumnAccess(getAD_Table_ID(), pfi.getAD_Column_ID(), true));
MPrintFormatItem[] retValue = new MPrintFormatItem[list.size()];
list.toArray(retValue);
return retValue;