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(); .list();
MRole role = MRole.getDefault(getCtx(), false); MRole role = MRole.getDefault(getCtx(), false);
for (MPrintFormatItem pfi : list) { list.removeIf(pfi -> !role.isColumnAccess(getAD_Table_ID(), pfi.getAD_Column_ID(), true));
if (! role.isColumnAccess(getAD_Table_ID(), pfi.getAD_Column_ID(), true))
list.remove(pfi);
}
MPrintFormatItem[] retValue = new MPrintFormatItem[list.size()]; MPrintFormatItem[] retValue = new MPrintFormatItem[list.size()];
list.toArray(retValue); list.toArray(retValue);
return retValue; return retValue;