On Wed, 21 May 2025 21:19:36 GMT, Justin Lu <j...@openjdk.org> wrote:
> _sun.util.Locale.LanguageTag_ is essentially a BCP47 language tag data > carrier for Locale. The class, once created is not modified; the class should > be made immutable. Converting the class to a record accomplishes this and > also simplifies some of the existing code. Comments addressed in https://github.com/openjdk/jdk/pull/25371/commits/2d778a85ebff14e5080a15556083c3e16986edf4. Chen, that's a good point, those getters are fragile. I opted to maintain the unmodifiable quality of the list fields, this code isn't perf sensitive and is more predictable this way. I wrapped the lists during parsing so we can drop overriding the getters altogether. ------------- PR Comment: https://git.openjdk.org/jdk/pull/25371#issuecomment-2901903043