Skip to content

Commit 68468a0

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

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

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

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class JpqlQueryRenderer extends JpqlBaseVisitor<QueryTokenStream> {
4646
*
4747
* @return boolean
4848
*/
49-
static boolean isSubquery(ParserRuleContext ctx) {
49+
static boolean isSubquery(ParserRuleContext ctx) {
5050

5151
while (ctx != null) {
5252
if (ctx instanceof JpqlParser.SubqueryContext) {
@@ -58,24 +58,23 @@ static boolean isSubquery(ParserRuleContext ctx) {
5858
ctx = ctx.getParent();
5959
}
6060
return false;
61-
}
61+
}
6262

6363
/**
6464
* Is this AST tree a {@literal set} query that has been added through {@literal UNION|INTERSECT|EXCEPT}?
6565
*
6666
* @return boolean
6767
*/
68-
static boolean isSetQuery(ParserRuleContext ctx) {
68+
static boolean isSetQuery(ParserRuleContext ctx) {
6969

7070
while (ctx != null) {
7171
if (ctx instanceof JpqlParser.Set_fuctionContext) {
7272
return true;
7373
}
74-
7574
ctx = ctx.getParent();
7675
}
7776
return false;
78-
}
77+
}
7978

8079
@Override
8180
public QueryTokenStream visitStart(JpqlParser.StartContext ctx) {

0 commit comments

Comments
 (0)