Skip to content

Commit 9c75766

Browse files
yukharinschauder
authored andcommitted
Fix grammar mistakes in countOccurrences method of QueryUtils class.
Original pull request #2572
1 parent 1bfc359 commit 9c75766

File tree

1 file changed

+7
-6
lines changed
  • spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query

1 file changed

+7
-6
lines changed

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

+7-6
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
* @author Jędrzej Biedrzycki
7979
* @author Darin Manica
8080
* @author Simon Paradies
81+
* @author Vladislav Yukharin
8182
*/
8283
public abstract class QueryUtils {
8384

@@ -292,25 +293,25 @@ public static String applySorting(String query, Sort sort, @Nullable String alia
292293
* @return {@code true} if the query has {@code order by} clause, {@code false} otherwise
293294
*/
294295
private static boolean hasOrderByClause(String query) {
295-
return countOccurences(ORDER_BY, query) > countOccurences(ORDER_BY_IN_WINDOW_OR_SUBSELECT, query);
296+
return countOccurrences(ORDER_BY, query) > countOccurrences(ORDER_BY_IN_WINDOW_OR_SUBSELECT, query);
296297
}
297298

298299
/**
299300
* Counts the number of occurrences of the pattern in the string
300301
*
301302
* @param pattern regex with a group to match
302303
* @param string analysed string
303-
* @return the number of occurences of the pattern in the string
304+
* @return the number of occurrences of the pattern in the string
304305
*/
305-
private static int countOccurences(Pattern pattern, String string) {
306+
private static int countOccurrences(Pattern pattern, String string) {
306307

307308
Matcher matcher = pattern.matcher(string);
308309

309-
int occurences = 0;
310+
int occurrences = 0;
310311
while (matcher.find()) {
311-
occurences++;
312+
occurrences++;
312313
}
313-
return occurences;
314+
return occurrences;
314315
}
315316

316317
/**

0 commit comments

Comments
 (0)