JDK-8228465 : HOST locale provider holds wrong era name for GregorianCalendar in US locale
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Affected Version: 11.0.3
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows
  • CPU: generic
  • Submitted: 2019-07-22
  • Updated: 2022-06-27
  • Resolved: 2019-07-26
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 11 JDK 13 JDK 14
11.0.6-oracleFixed 13.0.2Fixed 14 b08Fixed
Related Reports
Relates :  
Description
On JDK 11 when using the host locale provider with GregorianCalendar, 
the display name of era got from Calendar.getDIsplayNames() is "A.D." on Windows, 
which should "AD".  Meanwhile, the correct display name can be obtained when 
getting it from Calendar.getDisplayName().  The issue is reproducible with 
the JDK 14 and a backport is needed to JDK 11. 

$ ${JDK11}/java -showversion -Djava.locale.providers=HOST Sample3 
java version "11.0.2" 2019-01-15 LTS 
Java(TM) SE Runtime Environment 18.9 (build 11.0.2+9-LTS) 
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+9-LTS, mixed mode) 
SHORT_FORMAT ERA by getDisplayName:AD 
SHORT_FORMAT ERA by getDisplayNames:{BC=0, A.D.=1} 

$ ${JDK11}/java -showversion Sample3 
java version "11.0.2" 2019-01-15 LTS 
Java(TM) SE Runtime Environment 18.9 (build 11.0.2+9-LTS) 
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+9-LTS, mixed mode) 
SHORT_FORMAT ERA by getDisplayName:AD 
SHORT_FORMAT ERA by getDisplayNames:{BC=0, AD=1} 
Comments
Fix request (11u) I would like to downport this for parity with 11.0.6-oracle. I had to do a trivial resolve in Test LocalProvidersRun.java: This invokes tests for a row of different bugs by a list of sequential calls. jdk14 allso calls a test for 8220227, which was not downported to jdk11. Just context differences.
18-11-2019

URL: https://hg.openjdk.java.net/jdk/jdk/rev/bfe9696bf57f User: naoto Date: 2019-07-26 20:34:57 +0000
26-07-2019