mirror of https://github.com/apache/lucene.git
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:
parent
fb371af1f9
commit
7213e7cfc0
|
@ -329,6 +329,9 @@ public final class SolrCellBuilder implements CommandBuilder {
|
||||||
|
|
||||||
@SuppressForbidden(reason = "Usage of outdated locale parsing with Locale#toString() because of backwards compatibility")
|
@SuppressForbidden(reason = "Usage of outdated locale parsing with Locale#toString() because of backwards compatibility")
|
||||||
private Locale getLocale(String name) {
|
private Locale getLocale(String name) {
|
||||||
|
if (name == null || name.isEmpty()) {
|
||||||
|
return Locale.ROOT;
|
||||||
|
}
|
||||||
for (Locale locale : Locale.getAvailableLocales()) {
|
for (Locale locale : Locale.getAvailableLocales()) {
|
||||||
if (locale.toString().equals(name)) {
|
if (locale.toString().equals(name)) {
|
||||||
return locale;
|
return locale;
|
||||||
|
|
Loading…
Reference in New Issue