mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-21 12:40:02 +00:00
ICU-8761 Merged an additional fix to #8630(r30549) from trunk
X-SVN-Rev: 30551
This commit is contained in:
parent
bfe8563d60
commit
2ef8f31a40
2 changed files with 9 additions and 2 deletions
|
@ -597,7 +597,8 @@ public final class ULocale implements Serializable {
|
|||
* @stable ICU 3.0
|
||||
*/
|
||||
public static synchronized void setDefault(ULocale newLocale){
|
||||
Locale.setDefault(newLocale.toLocale());
|
||||
defaultLocale = newLocale.toLocale();
|
||||
Locale.setDefault(defaultLocale);
|
||||
defaultULocale = newLocale;
|
||||
// This method also updates all category default locales
|
||||
for (Category cat : Category.values()) {
|
||||
|
|
|
@ -194,7 +194,8 @@ public class ULocaleTest extends TestFmwk {
|
|||
*/
|
||||
public void TestJavaLocaleCompatibility() {
|
||||
Locale backupDefault = Locale.getDefault();
|
||||
|
||||
ULocale orgUlocDefault = ULocale.getDefault();
|
||||
|
||||
// Java Locale for ja_JP with Japanese calendar
|
||||
Locale jaJPJP = new Locale("ja", "JP", "JP");
|
||||
Locale jaJP = new Locale("ja", "JP");
|
||||
|
@ -289,6 +290,11 @@ public class ULocaleTest extends TestFmwk {
|
|||
errln("FAIL: ULocale#setDefault failed to set Java Locale no_NO_NY /actual: " + Locale.getDefault());
|
||||
}
|
||||
Locale.setDefault(backupDefault);
|
||||
|
||||
// Make sure default ULocale is restored
|
||||
if (!ULocale.getDefault().equals(orgUlocDefault)) {
|
||||
errln("FAIL: Original default ULocale is not restored - " + ULocale.getDefault() + ", expected(orginal) - " + orgUlocDefault);
|
||||
}
|
||||
}
|
||||
|
||||
// ================= Infrastructure =================
|
||||
|
|
Loading…
Add table
Reference in a new issue