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

Spec clarification: j.u.Locale.getDisplayName()

    XMLWordPrintable

Details

    Description

      Starting VM with "-Duser.country=CN -Duser.language=zh” as default locale.
      According to the Locale.getDisplayName​() spec the values in parentheses should be comma separated:
      http://download.java.net/java/jdk10/docs/api/java/util/Locale.html#getDisplayName()

      However for the following example

      Locale locale = new Locale("lll", "CCC", "VVV");
      System.out.println("Locale.getDefault() = " + Locale.getDefault());
      System.out.println("locale.getDisplayName() = " + locale.getDisplayName());

      I get

      Locale.getDefault() = zh_CN
      locale.getDisplayName() = lll (CCC、VVV)

      and (with default locale)

      Locale.getDefault() = en_GB
      locale.getDisplayName() = lll (CCC, VVV)

      (see the difference in the used separator - it's comma v.s. '、')

      Specification needs to be corrected.

      Attachments

        Issue Links

          Activity

            People

              naoto Naoto Sato
              dbessono Dmitry Bessonov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: