diff options
author | Daniel Schwarz <daniel.schwarz@sonarsource.com> | 2017-09-27 14:46:28 +0200 |
---|---|---|
committer | Daniel Schwarz <bartfastiel@users.noreply.github.com> | 2017-09-28 17:06:54 +0200 |
commit | 0546704b7a152de911c3f0000418c14013392d6e (patch) | |
tree | 31f14f772843b205827b07852f04ea56cbb698d4 | |
parent | c1fc4905203f88ca85e33a0f65ab7068100a9a02 (diff) | |
download | sonarqube-0546704b7a152de911c3f0000418c14013392d6e.tar.gz sonarqube-0546704b7a152de911c3f0000418c14013392d6e.zip |
SONAR-9890 avoid as many potential problems of non-english locales as possible
3 files changed, 3 insertions, 3 deletions
diff --git a/server/sonar-server/src/main/java/org/sonar/server/es/textsearch/ComponentTextSearchFeatureRepertoire.java b/server/sonar-server/src/main/java/org/sonar/server/es/textsearch/ComponentTextSearchFeatureRepertoire.java index 0a96cbf0e72..c97bb0b896a 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/es/textsearch/ComponentTextSearchFeatureRepertoire.java +++ b/server/sonar-server/src/main/java/org/sonar/server/es/textsearch/ComponentTextSearchFeatureRepertoire.java @@ -71,7 +71,7 @@ public enum ComponentTextSearchFeatureRepertoire implements ComponentTextSearchF if (tokens.isEmpty()) { return Stream.empty(); } - List<String> lowerCaseTokens = tokens.stream().map(t -> t.toLowerCase(Locale.getDefault())).collect(MoreCollectors.toList()); + List<String> lowerCaseTokens = tokens.stream().map(t -> t.toLowerCase(Locale.ENGLISH)).collect(MoreCollectors.toList()); BoolQueryBuilder queryBuilder = prefixAndPartialQuery(lowerCaseTokens, query.getFieldName(), SEARCH_PREFIX_CASE_INSENSITIVE_ANALYZER) .boost(2f); return Stream.of(queryBuilder); diff --git a/server/sonar-server/src/main/java/org/sonar/server/measure/index/ProjectsTextSearchQueryFactory.java b/server/sonar-server/src/main/java/org/sonar/server/measure/index/ProjectsTextSearchQueryFactory.java index 3b849d0bb53..c1520067639 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/measure/index/ProjectsTextSearchQueryFactory.java +++ b/server/sonar-server/src/main/java/org/sonar/server/measure/index/ProjectsTextSearchQueryFactory.java @@ -73,7 +73,7 @@ class ProjectsTextSearchQueryFactory { PREFIX_IGNORE_CASE { @Override QueryBuilder getQuery(String queryText) { - String lowerCaseQueryText = queryText.toLowerCase(Locale.getDefault()); + String lowerCaseQueryText = queryText.toLowerCase(Locale.ENGLISH); return prefixAndPartialQuery(lowerCaseQueryText, SORTABLE_ANALYZER.subField(FIELD_NAME), FIELD_NAME) .boost(3f); } diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/ParsingUtils.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/ParsingUtils.java index b85873c8c4c..d2dcbde4359 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/ParsingUtils.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/ParsingUtils.java @@ -53,7 +53,7 @@ public final class ParsingUtils { * @throws ParseException if number cannot be parsed */ public static double parseNumber(String number) throws ParseException { - return parseNumber(number, Locale.getDefault()); + return parseNumber(number, Locale.ENGLISH); } /** |