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

Locale#getDefault returns the wrong locale

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 7
    • Fix Version/s: None
    • Component/s: core-libs
    • Labels:

      Description

      FULL PRODUCT VERSION :
      1.7.0-b147

      ADDITIONAL OS VERSION INFORMATION :
      Windows 7 x64 SP1

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      English version of windows, Swedish locale configured.

      A DESCRIPTION OF THE PROBLEM :
      Locale#getDefault returns the en_US locale with jdk 1.7.0-b147, whereas jdk 1.6.0_27-b07 correctly returns sv_SE.

      This is also evident when running System.getProperties().list(System.out):
      jdk 1.7.0-b147 list the property user.country=US
      whereas 1.6.0_27-b07 properly list the property user.country=SE

      Locale.getDefault(Locale.Category.FORMAT) properly returns sv_SE
      Locale.getDefault(Locale.Category.DISPLAY) erroneously returns en_US

      REGRESSION. Last worked in version 6u26

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Set the locale to Swedish.


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.util.Locale;

      public class LocaleTest {
          public static void main(String[] args) {
              System.out.println(Locale.getDefault());
          }
      }

      ---------- END SOURCE ----------

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: