Skip to content

Commit 9a6b0da

Browse files
committed
Refactor isSubquery and isSetQuery methods in HqlQueryRenderer for improved readability
Signed-off-by: KNU-K <[email protected]>
1 parent 4100222 commit 9a6b0da

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/HqlQueryRenderer.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class HqlQueryRenderer extends HqlBaseVisitor<QueryTokenStream> {
4747
*
4848
* @return boolean
4949
*/
50-
static boolean isSubquery(ParserRuleContext ctx) {
50+
static boolean isSubquery(ParserRuleContext ctx) {
5151

5252
while (ctx != null) {
5353
if (ctx instanceof HqlParser.SubqueryContext || ctx instanceof HqlParser.CteContext) {
@@ -63,14 +63,15 @@ static boolean isSubquery(ParserRuleContext ctx) {
6363
ctx = ctx.getParent();
6464
}
6565
return false;
66-
}
66+
}
6767

6868
/**
6969
* Is this AST tree a {@literal set} query that has been added through {@literal UNION|INTERSECT|EXCEPT}?
7070
*
7171
* @return boolean
7272
*/
7373
static boolean isSetQuery(ParserRuleContext ctx) {
74+
7475
while (ctx != null) {
7576
ParserRuleContext parent = ctx.getParent();
7677
if (ctx instanceof HqlParser.OrderedQueryContext && parent instanceof HqlParser.QueryExpressionContext qec) {

0 commit comments

Comments
 (0)