<i18n dev> RFR: 8368981: Case Fold Locale Legacy Tags On Demand [v2]
Justin Lu
jlu at openjdk.org
Thu Oct 2 16:58:43 UTC 2025
On Thu, 2 Oct 2025 16:06:07 GMT, Naoto Sato <naoto at openjdk.org> wrote:
>> src/java.base/share/classes/sun/util/locale/LanguageTag.java line 516:
>>
>>> 514: if (tag.length() > 11 || tag.length() < 5) {
>>> 515: return null;
>>> 516: }
>>
>> I can see the < 5 having some saving if most of the tags are short.
>> I doubt the > 11 saves anything and it creates a maintenance gotcha, if a tag is added that is longer.
>
> Per RFC, it is guaranteed that the list of the grandfathered (=legacy) tags will never change (https://datatracker.ietf.org/doc/html/rfc5646#section-2.1)
Right, the reason we can have confidence in this shortcut check is that the list is specified to be stable. However, if there is likely no save on cost, then we can remove it.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27596#discussion_r2399453184
More information about the i18n-dev
mailing list