From 935987bd9d7a99d8f10ea2c087ef92abb9c555af Mon Sep 17 00:00:00 2001 From: Anozi Mada Date: Tue, 31 May 2022 11:35:22 +0700 Subject: [PATCH] IDEMPIERE-5286 Fix ConcurrentModificationException in MPrintFormat.getAllItems Method (#1349) --- org.adempiere.base/src/org/compiere/print/MPrintFormat.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/print/MPrintFormat.java b/org.adempiere.base/src/org/compiere/print/MPrintFormat.java index 1044bf8958..bf0cc7b8c4 100644 --- a/org.adempiere.base/src/org/compiere/print/MPrintFormat.java +++ b/org.adempiere.base/src/org/compiere/print/MPrintFormat.java @@ -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;