mirror of https://github.com/apache/lucene.git
LUCENE-4021: Locale representations don't round trip
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1330603 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
34276f9e80
commit
021986f9f2
|
@ -1352,6 +1352,7 @@ public abstract class LuceneTestCase extends Assert {
|
|||
public static Locale localeForName(String localeName) {
|
||||
String elements[] = localeName.split("\\_");
|
||||
switch(elements.length) {
|
||||
case 4: /* fallthrough for special cases */
|
||||
case 3: return new Locale(elements[0], elements[1], elements[2]);
|
||||
case 2: return new Locale(elements[0], elements[1]);
|
||||
case 1: return new Locale(elements[0]);
|
||||
|
|
Loading…
Reference in New Issue