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:
Robert Muir 2012-04-25 23:39:51 +00:00
parent 34276f9e80
commit 021986f9f2
1 changed files with 1 additions and 0 deletions

View File

@ -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]);