JDK-7093934 : Locale#getDefault returns the wrong locale
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 7
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_7
  • CPU: x86
  • Submitted: 2011-09-22
  • Updated: 2012-03-20
  • Resolved: 2011-09-22
Related Reports
Duplicate :  
Relates :  
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 ----------

Comments
EVALUATION Looks like a dup of 7039901.
22-09-2011