From 788c8b61e1786a8f20f531834ca287962d44cbe3 Mon Sep 17 00:00:00 2001 From: Radek Felcman Date: Tue, 14 May 2024 15:15:28 +0200 Subject: [PATCH] NPE in ExpressionOperator.printCollection - backport from 2.7 (#2139) Fixes #2136 Backport from #2137 --------- Signed-off-by: Radek Felcman --- .../eclipse/persistence/expressions/ExpressionOperator.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/expressions/ExpressionOperator.java b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/expressions/ExpressionOperator.java index e27aa0f0470..6bdabbfd509 100644 --- a/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/expressions/ExpressionOperator.java +++ b/foundation/org.eclipse.persistence.core/src/main/java/org/eclipse/persistence/expressions/ExpressionOperator.java @@ -2383,8 +2383,7 @@ public void printCollection(List items, ExpressionSQLPrinter printer int[] indices = getArgumentIndices(items.size()); String[] dbStrings = getDatabaseStrings(items.size()); - for (int i = 0; i < indices.length; i++) { - final int index = indices[i]; + for (final int index : indices) { Expression item = items.get(index); if ((this.selector == Ref) || ((this.selector == Deref) && (item.isObjectExpression()))) {