From 9c757660d244393b291297fd700f0aad3764230b Mon Sep 17 00:00:00 2001 From: Vladislav Yukharin Date: Mon, 20 Jun 2022 00:31:49 +0600 Subject: [PATCH] Fix grammar mistakes in countOccurrences method of QueryUtils class. Original pull request #2572 --- .../data/jpa/repository/query/QueryUtils.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/QueryUtils.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/QueryUtils.java index 94c080dec..5c1fd5fa2 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/QueryUtils.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/QueryUtils.java @@ -78,6 +78,7 @@ import org.springframework.util.StringUtils; * @author Jędrzej Biedrzycki * @author Darin Manica * @author Simon Paradies + * @author Vladislav Yukharin */ public abstract class QueryUtils { @@ -292,7 +293,7 @@ public abstract class QueryUtils { * @return {@code true} if the query has {@code order by} clause, {@code false} otherwise */ private static boolean hasOrderByClause(String query) { - return countOccurences(ORDER_BY, query) > countOccurences(ORDER_BY_IN_WINDOW_OR_SUBSELECT, query); + return countOccurrences(ORDER_BY, query) > countOccurrences(ORDER_BY_IN_WINDOW_OR_SUBSELECT, query); } /** @@ -300,17 +301,17 @@ public abstract class QueryUtils { * * @param pattern regex with a group to match * @param string analysed string - * @return the number of occurences of the pattern in the string + * @return the number of occurrences of the pattern in the string */ - private static int countOccurences(Pattern pattern, String string) { + private static int countOccurrences(Pattern pattern, String string) { Matcher matcher = pattern.matcher(string); - int occurences = 0; + int occurrences = 0; while (matcher.find()) { - occurences++; + occurrences++; } - return occurences; + return occurrences; } /**