Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8157138

Error while fetching currency instance by Currency.getInstance(currencycode)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 9
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b120
    • Verification:
      Verified

      Description

      As per the default CurrencyData.properties the currency "MAD" is pointed by two countries "MA" (# MOROCCO MA=MAD) and "EH" (# WESTERN SAHARA EH=MAD)
      While fetching the currency instance using Currency.getInstance("MAD") is returning correct value.

      But when the currency entry MA=>MAD is overrided/superseded by another currency entry in currency.properties file e.g. MA=MAN,555,0. The Currency.getInstance("MAD") method is throwing IllegalArgumentException even if the currency "MAD" being still pointed by EH.

      Also, Currency.getAvailableCurrencies() is not returning "MAD" in the list of currencies after the change made by currency.properties.

        Attachments

          Activity

            People

            Assignee:
            nishjain Nishit Jain
            Reporter:
            nishjain Nishit Jain
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: