JDK-7200119 : Collator.getAvailableLocales() doesn't return Locale.US
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.text
  • Affected Version: 8
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: os_x
  • CPU: x86
  • Submitted: 2012-09-21
  • Updated: 2014-01-28
  • Resolved: 2012-10-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8 b61Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
JDK 8 spec for java.text.Collator.getAvailableLocales() sais: "It must contain at least a Locale instance equal to Locale.US".
Since jdk8 b55 the method returns the list of available locales without Locale.US.

Comments
Verified with jdk8 b126 using the test attached to the issue: stt-mac-05:JQA gtee$ /export/JDK/tmp/jdk1.8.0.jdk/Contents/Home/bin/java -version java version "1.8.0-ea" Java(TM) SE Runtime Environment (build 1.8.0-ea-b60) Java HotSpot(TM) 64-Bit Server VM (build 25.0-b04, mixed mode) stt-mac-05:JQA gtee$ /export/JDK/tmp/jdk1.8.0.jdk/Contents/Home/bin/java CollatorTest | grep US Expected core locale: en; US test failed on jdk8 b60 stt-mac-05:JQA gtee$ /export/JDK/jdk1.8.0.jdk/Contents/Home/bin/java -version java version "1.8.0" Java(TM) SE Runtime Environment (build 1.8.0-b126) Java HotSpot(TM) 64-Bit Server VM (build 25.0-b67, mixed mode) stt-mac-05:JQA gtee$ /export/JDK/jdk1.8.0.jdk/Contents/Home/bin/java CollatorTest | grep US Expected core locale: en; US collatorLocales[18].getLanguage() = en; collatorLocales[18].getCountry() = US collatorLocales[68].getLanguage() = es; collatorLocales[68].getCountry() = US test passed on jdk8 b126 The affected JCK test case passed with jdk8 b125. See jtr below: http://aurora-ds.us.oracle.com:9500/runs%2F348826.ute.st2-1-20140122130714862/results/workDir/api/java_text/Collator/index_GetInstance.jtr
28-01-2014

Add "en-US" to the available locales array from getAvailableLocales() in each locale sensitive services.
04-10-2012

EVALUATION Possibly a regression caused by the fix for 7171324.
21-09-2012