JDK-8177472 : Remove hard-coded IANA Subtag Registry map in LocaleEquivalentMap.java
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.util:i18n
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2017-03-23
  • Updated: 2020-04-01
  • Resolved: 2017-07-27
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 10 Other
10 b18Fixed openjdk8u222Fixed
Related Reports
Relates :  
Description
There is a section of auto-generated data in sun.util.locale.LocaleEquivalentMap.java where the data is extracted from here:

https://www.iana.org/assignments/language-subtag-registry/language-subtag-registry

This needs to be generated from the plain data file as above at the JDK build time.
Comments
Proposed Fix: http://cr.openjdk.java.net/~nishjain/8177472/webrev.05/
20-07-2017

The current LSR data updation process requires below steps 1. Download http://www.iana.org/assignments/language-subtag-registry/language-subtag-registry 2. Replace jdk/test/java/util/Locale/tools/language-subtag-registry.txt with the downloaded data 3. Run EquivMapsGenerator.java in the same directory in order to generate maps which are used in jdk/src/java.base/share/classes/sun/util/locale/LocaleEquivalentMaps.java 4. Replace maps in /LocaleEquivalentMaps.java with newly generated ones. The above process requires manual execution of EquivMapsGenerator.java for generation of the updated maps. This process can be included in JDK build process to get rid of the manual effort. With this change, updation of LSR data will mostly require replacement of old language-subtag-registry.txt file with the new one. Please note that sometimes this updation process may fail due to the incompatible changes in language-subtag-registry.txt, which may require changes to EquivMapsGenerator.java. E.g. Refer the fix for JDK-8040211, EquivMapsGenerator.java was updated to handle the lsr data change.
05-07-2017