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

Hardening of Currency tests for not yet defined future ISO 4217 currency

XMLWordPrintable

    • b20
    • generic
    • generic

      Currency currently checks that a future currency that is not yet defined should not be included in the output returned by Currency.getAvailableCurrencies(). What should also be included is a check that ensures that Currency.getCurrentInstance(String) throws an IllegalArgumentException for such cases.

      For example,

      For an entry such as : "SX=ANG;2025-04-01-04-00-00;XCG"
      If the current date was before the cut over, as XCG is not an already existing ISO 4217 currency code, it should not exist in the output of available currencies and should not be instantiable by getInstance(String).

      Conversely, if the entry had been : "SX=ANG;2025-04-01-04-00-00;EUR", we would expect it to be both in the output of available currencies and instantiable since EUR is an already existing ISO 4217 currency code.

            jlu Justin Lu
            jlu Justin Lu
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: