From 0a98b41f0e1782c7ef6fa15504fc3a32e43222e3 Mon Sep 17 00:00:00 2001 From: Gavin Date: Fri, 9 Jun 2023 12:09:47 +0200 Subject: [PATCH] fix an IOOB exception in SqmPathRegistryImpl --- .../hibernate/query/hql/internal/SqmPathRegistryImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/query/hql/internal/SqmPathRegistryImpl.java b/hibernate-core/src/main/java/org/hibernate/query/hql/internal/SqmPathRegistryImpl.java index 3492ea370f..3cac8c2c50 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/hql/internal/SqmPathRegistryImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/query/hql/internal/SqmPathRegistryImpl.java @@ -293,8 +293,9 @@ public class SqmPathRegistryImpl implements SqmPathRegistry { @Override public SqmAliasedNode findAliasedNodeByPosition(int position) { // NOTE : 1-based - - return simpleSelectionNodes.get( position - 1 ); + return position > simpleSelectionNodes.size() + ? null + : simpleSelectionNodes.get(position - 1); } @Override