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

Java.util.Currency.getSymbol(Locale) returns wrong value when locale is not US.

    XMLWordPrintable

Details

    • b80
    • x86
    • linux
    • Verified

    Backports

      Description

        FULL PRODUCT VERSION :
        java version "1.6.0"
        Java(TM) SE Runtime Environment (build 1.6.0-b105)
        Java HotSpot(TM) Client VM (build 1.6.0-b105, mixed mode, sharing)


        ADDITIONAL OS VERSION INFORMATION :
        Linux 2.6.21-1.3194.fc7

        A DESCRIPTION OF THE PROBLEM :
        If locale is the default locale, US, then the symbol "$" is returned. However,
        there are other locales that also have the "$" as their currency. These locales
        need to differentiate the American dollar using "US$". Currently, "USD" is
        returned.

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        $
        US$
        ACTUAL -
        $
        USD

        REPRODUCIBILITY :
        This bug can be reproduced always.

        ---------- BEGIN SOURCE ----------
         Currency currency = Currency.getInstance(Locale.US);
         System.out.println(currency.getSymbol(Locale.US));
         System.out.println(currency.getSymbol(Locale.CANADA));
        ---------- END SOURCE ----------

        Attachments

          Issue Links

            Activity

              People

                katakai Masaki Katakai
                ndcosta Nelson Dcosta (Inactive)
                Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: