filed for Oliver Deakin
Ahh I see. I don't open the file directly. I work on the Apache Harmony
project and have been looking at what it would take to update to 3.8
(we're on 3.4.4 at the moment). Im seeing a failure in our test code
when running with 3.8 which can be demonstrated by the following test case:
import java.util.Locale;
import com.ibm.icu.text.DecimalFormatSymbols;
public class CurrencyTest {
public static void main(String[] args) {
Locale locale = new Locale("sr", "YU");
DecimalFormatSymbols icuSymbols = new
com.ibm.icu.text.DecimalFormatSymbols(locale);
System.out.println("Currency symbol=" +
icuSymbols.getCurrencySymbol()
+ " Currency=" + icuSymbols.getCurrency());
}
}
If I run this class with Java 5.0 (J9) with icu4j_3_6_1.jar and
icu4j-charsets_3_6_1.jar added to the classpath it completes printing:
Currency symbol=YUM Currency=YUM
However if I run again with icu4j_3_8.jar and icu4j_charsets_3_8.jar
added to the classpath instead I get the following stack trace:
Exception in thread "main" java.lang.ClassCastException:
com.ibm.icu.impl.ICUResourceBundleImpl$ResourceArray incompatible with
java.lang.String
at java.util.ResourceBundle.getString(ResourceBundle.java:302)
at com.ibm.icu.util.Currency.createCurrency(Currency.java:166)
at com.ibm.icu.util.Currency.getInstance(Currency.java:116)
at
com.ibm.icu.text.DecimalFormatSymbols.initialize(DecimalFormatSymbols.java:710)
at
com.ibm.icu.text.DecimalFormatSymbols.<init>(DecimalFormatSymbols.java:59)
at CurrencyTest.main(CurrencyTest.java:7)
It appears that we are carrying out a currency lookup for "YU" and
failing to find it. I thought this might have been caused by the missing
CurrencyData.res file, but perhaps it is because the data for this
locale has been left out of supplementalData.res?
Thanks,
Oliver
Steven R. Loomis wrote:
http://bugs.icu-project.org/trac/ticket/5714 (J)
http://bugs.icu-project.org/trac/ticket/5715 (C)
CurrencyData is not used anymore and has been removed, instead
supplementalData is used.