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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 11
    • None
    • core-libs
    • b02
    • generic
    • generic
    • Verified

      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

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

              Created:
              Updated:
              Resolved: