harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boris Kuznetsov (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-424) NullPointerException in java.text.DecimalFormat.getCurrency()
Date Tue, 05 Dec 2006 06:11:23 GMT
    [ http://issues.apache.org/jira/browse/HARMONY-424?page=comments#action_12455521 ] 
            
Boris Kuznetsov commented on HARMONY-424:
-----------------------------------------

According to DecimalFormat.getCurrency()  spec.:
"The currency is obtained by calling DecimalFormatSymbols.getCurrency on this number format's
symbols.

DecimalFormatSymbols.getCurrency says: 
"May be null if the currency symbol attribute was previously set to a value that's not a valid
ISO 4217 currency code."

So, DecimalFormat.getCurrency() should return null for invalid ISO 4217 currency codes only
.

> NullPointerException in java.text.DecimalFormat.getCurrency()
> -------------------------------------------------------------
>
>                 Key: HARMONY-424
>                 URL: http://issues.apache.org/jira/browse/HARMONY-424
>             Project: Harmony
>          Issue Type: Bug
>          Components: Classlib
>         Environment: WIN with Russian defaults
>            Reporter: Boris Kuznetsov
>
> Consider the following code:
>     System.out.println("Locale " + Locale.getDefault());
>     System.out.println("Default " + Currency.getInstance(Locale.getDefault()));
>     DecimalFormat format = (DecimalFormat) DecimalFormat.getInstance();
>     System.out.println("Currency "+format.getCurrency());
> It produses (on computer with Russian defaults):
> RI output:
>     Locale ru_RU
>     Default RUR
>     Currency RUR
> Harmony output:
>     Locale ru_RU
>     Default RUR
>     ?????????????? ???????? ? ???? "main" java.lang.NullPointerException
>            at java.text.DecimalFormat.getCurrency(DecimalFormat.java:271)
>            at test.main(test.java:10)
> org.apache.harmony.tests.java.text.DecimalFormatTest  failed due this reason.
> Looks like a bug in icu4 lib (used in java.text.DecimalFormat). 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message