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

New Belarusian ruble (933) is not supported by java.util.Currency

    Details

      Description

      FULL PRODUCT VERSION :
      java version "1.8.0_111"
      Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
      Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Windows 10

      A DESCRIPTION OF THE PROBLEM :
      The currency New Belarusian ruble (BYN) with numeric code 933 isn't supported by java.util.Currency.

      If I check ISO 4217 it's there, but the code isn't available in the Currency class (https://en.wikipedia.org/wiki/ISO_4217).



      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
              for (Currency currency : Currency.getAvailableCurrencies()) {
                  allCurrenciesMap.put(currency.getNumericCode(), currency.getCurrencyCode());
              }

              SortedSet<Integer> sortedNumericKeysMap = new TreeSet<>(allCurrenciesMap.keySet());
              for (Integer numericCurrencyCode : sortedNumericKeysMap) {
                 String currencyCode = allCurrenciesMap.get(numericCurrencyCode);
                 System.out.println("Currency: " + currencyCode + ", nummeric: " + numericCurrencyCode);
              }

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Expected to see:

      Currency: BYN, nummeric: 933


      ACTUAL -
      Currency not found

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
              for (Currency currency : Currency.getAvailableCurrencies()) {
                  allCurrenciesMap.put(currency.getNumericCode(), currency.getCurrencyCode());
              }

              SortedSet<Integer> sortedNumericKeysMap = new TreeSet<>(allCurrenciesMap.keySet());
              for (Integer numericCurrencyCode : sortedNumericKeysMap) {
                 String currencyCode = allCurrenciesMap.get(numericCurrencyCode);
                 System.out.println("Currency: " + currencyCode + ", nummeric: " + numericCurrencyCode);
              }
      ---------- END SOURCE ----------

        Attachments

          Activity

            People

            • Assignee:
              ljiang Leo Jiang
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: