ICU-7444 Fixed locale spi test problem. Java Currency#getInstance may throw IllegalArgumentException. The test code should handle the case.

X-SVN-Rev: 27752
This commit is contained in:
Yoshito Umaoka 2010-03-03 00:22:12 +00:00
parent cb3d8ade6d
commit 1aa08c9bfe

View File

@ -1,6 +1,6 @@
/*
*******************************************************************************
* Copyright (C) 2008, International Business Machines Corporation and *
* Copyright (C) 2008-2010, International Business Machines Corporation and *
* others. All Rights Reserved. *
*******************************************************************************
*/
@ -24,11 +24,15 @@ public class CurrencyNameTest extends TestFmwk {
if (l.getCountry().length() == 0) {
continue;
}
Currency currency = Currency.getInstance(l);
if (currency == null) {
try {
Currency currency = Currency.getInstance(l);
if (currency != null) {
currencies.add(currency);
}
} catch (IllegalArgumentException iae) {
logln("INFO: java.util.Currency.getInstance(Locale) throws IllegalArgumentException for locale: " + l);
continue;
}
currencies.add(currency);
}
for (Currency currency : currencies) {