From c29f2eaf605d97852ffd2367909e689974e24134 Mon Sep 17 00:00:00 2001 From: Andrea Boriero Date: Mon, 5 Dec 2022 13:14:35 +0100 Subject: [PATCH] HHH-15744 HQL where clause parsing fails with StackOverflow exception --- .../query/hql/internal/QuerySplitter.java | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/query/hql/internal/QuerySplitter.java b/hibernate-core/src/main/java/org/hibernate/query/hql/internal/QuerySplitter.java index 54bae5325e..0969469cf7 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/hql/internal/QuerySplitter.java +++ b/hibernate-core/src/main/java/org/hibernate/query/hql/internal/QuerySplitter.java @@ -850,8 +850,9 @@ public class QuerySplitter { @Override public SqmGroupedPredicate visitGroupedPredicate(SqmGroupedPredicate predicate) { + final SqmPredicate subPredicate = (SqmPredicate) predicate.getSubPredicate().accept( this ); return new SqmGroupedPredicate( - (SqmPredicate) predicate.accept( this ), + subPredicate, getCreationContext().getNodeBuilder() ); } @@ -962,25 +963,14 @@ public class QuerySplitter { ); } - - @Override public SqmPositionalParameter visitPositionalParameterExpression(SqmPositionalParameter expression) { - return new SqmPositionalParameter( - expression.getPosition(), - expression.allowMultiValuedBinding(), - expression.nodeBuilder() - ); + return expression; } @Override public SqmNamedParameter visitNamedParameterExpression(SqmNamedParameter expression) { - return new SqmNamedParameter( - expression.getName(), - expression.allowMultiValuedBinding(), - expression.getNodeType(), - expression.nodeBuilder() - ); + return expression; } @Override