38
38
import net .sf .jsqlparser .statement .select .SetOperationList ;
39
39
import net .sf .jsqlparser .statement .select .Values ;
40
40
import net .sf .jsqlparser .statement .update .Update ;
41
- import org .jspecify .annotations .Nullable ;
42
41
43
42
import java .io .ByteArrayInputStream ;
44
43
import java .io .IOException ;
50
49
import java .util .Set ;
51
50
import java .util .StringJoiner ;
52
51
52
+ import org .jspecify .annotations .Nullable ;
53
+
53
54
import org .springframework .data .domain .Sort ;
54
55
import org .springframework .util .Assert ;
55
56
import org .springframework .util .CollectionUtils ;
@@ -77,7 +78,7 @@ public class JSqlParserQueryEnhancer implements QueryEnhancer {
77
78
private final String projection ;
78
79
private final Set <String > joinAliases ;
79
80
private final Set <String > selectAliases ;
80
- private final byte @ Nullable [] serialized ;
81
+ private final byte @ Nullable [] serialized ;
81
82
82
83
/**
83
84
* @param query the query we want to enhance. Must not be {@literal null}.
@@ -94,7 +95,7 @@ public JSqlParserQueryEnhancer(DeclaredQuery query) {
94
95
this .selectAliases = Collections .unmodifiableSet (getSelectionAliases (this .statement ));
95
96
this .joinAliases = Collections .unmodifiableSet (getJoinAliases (this .statement ));
96
97
byte [] tmp = SerializationUtils .serialize (this .statement );
97
- // this.serialized = tmp != null ? tmp : new byte[0];
98
+ // this.serialized = tmp != null ? tmp : new byte[0];
98
99
this .serialized = SerializationUtils .serialize (this .statement );
99
100
}
100
101
@@ -331,7 +332,7 @@ private String applySorting(@Nullable Select selectStatement, Sort sort, @Nullab
331
332
}
332
333
333
334
if (!(selectStatement instanceof PlainSelect selectBody )) {
334
- if (selectStatement != null ) {
335
+ if (selectStatement != null ) {
335
336
return selectStatement .toString ();
336
337
} else {
337
338
throw new IllegalArgumentException ("Select must not be null" );
@@ -372,8 +373,8 @@ public String createCountQueryFor(@Nullable String countProjection) {
372
373
return createCountQueryFor (selectBody , countProjection , primaryAlias );
373
374
}
374
375
375
- private static String createCountQueryFor (PlainSelect selectBody ,
376
- @ Nullable String countProjection , @ Nullable String primaryAlias ) {
376
+ private static String createCountQueryFor (PlainSelect selectBody , @ Nullable String countProjection ,
377
+ @ Nullable String primaryAlias ) {
377
378
378
379
// remove order by
379
380
selectBody .setOrderByElements (null );
@@ -526,8 +527,8 @@ enum ParsedType {
526
527
* @param bytes a serialized object
527
528
* @return the result of deserializing the bytes
528
529
*/
529
- private static @ Nullable Object deserialize (byte @ Nullable [] bytes ) {
530
- if (ObjectUtils .isEmpty (bytes )) {
530
+ private static @ Nullable Object deserialize (byte @ Nullable [] bytes ) {
531
+ if (ObjectUtils .isEmpty (bytes )) {
531
532
return null ;
532
533
}
533
534
try (ObjectInputStream ois = new ObjectInputStream (new ByteArrayInputStream (bytes ))) {
@@ -539,9 +540,9 @@ enum ParsedType {
539
540
}
540
541
}
541
542
542
- private static <T > T deserializeRequired (byte @ Nullable [] bytes , Class <T > type ) {
543
+ private static <T > T deserializeRequired (byte @ Nullable [] bytes , Class <T > type ) {
543
544
Object deserialize = deserialize (bytes );
544
- if (deserialize != null ) {
545
+ if (deserialize != null ) {
545
546
return type .cast (deserialize );
546
547
}
547
548
throw new IllegalStateException ("Failed to deserialize object type" );
0 commit comments