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

Incorrect currency instance returned by java.util.Currency.getInstance()

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 11
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b02
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Verified

      Description

      A DESCRIPTION OF THE PROBLEM:
      Incorrect currency instance is returned by the Currency.getInstance() method

      STEPS TO REPRODUCE THE PROBLEM:

      1. supersede currency.properties

      currency.properties
      MA=MAA,555,5
      MC=MAA,555,6

      2. Used the below code snippet:
              Currency cur1 = Currency.getInstance(new Locale("", "MA"));
              System.out.println(cur1.getCurrencyCode()+": "+cur1.getDefaultFractionDigits());

              Currency cur2 = Currency.getInstance(new Locale("", "MC"));
              System.out.println(cur2.getCurrencyCode()+": "+cur2.getDefaultFractionDigits());

              

      Actual Output
      MAA: 5
      MAA: 5

      Expected Output
      MAA: 5
      MAA: 6

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: