LUCENE-6978: Fix Morphlines locale parsing with empty string / null: use ROOT

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1726118 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2016-01-21 22:16:55 +00:00
parent fb371af1f9
commit 7213e7cfc0
1 changed files with 3 additions and 0 deletions

View File

@ -329,6 +329,9 @@ public final class SolrCellBuilder implements CommandBuilder {
@SuppressForbidden(reason = "Usage of outdated locale parsing with Locale#toString() because of backwards compatibility")
private Locale getLocale(String name) {
if (name == null || name.isEmpty()) {
return Locale.ROOT;
}
for (Locale locale : Locale.getAvailableLocales()) {
if (locale.toString().equals(name)) {
return locale;