Skip to content

Commit 526e5d6

Browse files
committed
Polishing.
Formatting. Reduced scope of field to variable. Original pull request #3954
1 parent 6313723 commit 526e5d6

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

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

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@
7373
public class JSqlParserQueryEnhancer implements QueryEnhancer {
7474

7575
private final DeclaredQuery query;
76-
private final Statement statement;
7776
private final ParsedType parsedType;
7877
private final boolean hasConstructorExpression;
7978
private final @Nullable String primaryAlias;
@@ -88,15 +87,15 @@ public class JSqlParserQueryEnhancer implements QueryEnhancer {
8887
public JSqlParserQueryEnhancer(DeclaredQuery query) {
8988

9089
this.query = query;
91-
this.statement = parseStatement(query.getQueryString(), Statement.class);
90+
Statement statement = parseStatement(query.getQueryString(), Statement.class);
9291

9392
this.parsedType = detectParsedType(statement);
9493
this.hasConstructorExpression = QueryUtils.hasConstructorExpression(query.getQueryString());
95-
this.primaryAlias = detectAlias(this.parsedType, this.statement);
96-
this.projection = detectProjection(this.statement);
97-
this.selectAliases = Collections.unmodifiableSet(getSelectionAliases(this.statement));
98-
this.joinAliases = Collections.unmodifiableSet(getJoinAliases(this.statement));
99-
this.serialized = SerializationUtils.serialize(this.statement);
94+
this.primaryAlias = detectAlias(this.parsedType, statement);
95+
this.projection = detectProjection(statement);
96+
this.selectAliases = Collections.unmodifiableSet(getSelectionAliases(statement));
97+
this.joinAliases = Collections.unmodifiableSet(getJoinAliases(statement));
98+
this.serialized = SerializationUtils.serialize(statement);
10099
}
101100

102101
/**
@@ -215,8 +214,8 @@ private static Set<String> getJoinAliases(Statement statement) {
215214
* @param statement
216215
* @param mapper
217216
* @param fallback
218-
* @return
219217
* @param <T>
218+
* @return
220219
*/
221220
private static <T> T doWithPlainSelect(Statement statement, java.util.function.Function<PlainSelect, T> mapper,
222221
Supplier<T> fallback) {
@@ -236,8 +235,8 @@ private static <T> T doWithPlainSelect(Statement statement, java.util.function.F
236235
* @param skipIf
237236
* @param mapper
238237
* @param fallback
239-
* @return
240238
* @param <T>
239+
* @return
241240
*/
242241
private static <T> T doWithPlainSelect(Statement statement, Predicate<PlainSelect> skipIf,
243242
java.util.function.Function<PlainSelect, T> mapper, Supplier<T> fallback) {

0 commit comments

Comments
 (0)