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

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • 11
    • Affects Version/s: None
    • Component/s: 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

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

              Created:
              Updated:
              Resolved: