harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jin Yang (JIRA)" <j...@apache.org>
Subject [jira] Created: (HARMONY-6655) [classlib][luni]util:currency.getInstance does not throw IllegalArgumentException
Date Sat, 25 Sep 2010 05:46:34 GMT
[classlib][luni]util:currency.getInstance does not throw IllegalArgumentException

                 Key: HARMONY-6655
                 URL: https://issues.apache.org/jira/browse/HARMONY-6655
             Project: Harmony
          Issue Type: Bug
          Components: Classlib
            Reporter: Jin Yang

executing this code
   Currency c = Currency.getInstance("ABC");

 we get ABC as output in Harmony where as on SUN ri we get IllegalArgumentException because
ABC is not a supported ISO 4217 code.

In our current design for getInstance(String currencyCode), we do not check the input currencyCode.
If we use icu to check, it still doesn't work. ICU just checks if the input is a 3-letter
alpha code while not to check if the input is a supported ISO 4217 code. So for ICU, "ABC"
is also a valid input.

I think there will be two ways to fix it:
1. ask ICU to check the input.
2. maintain a ISO 4217 code list in our implementation and to check the input by ourself.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message