On Thu, 2 Oct 2025 16:06:07 GMT, Naoto Sato <[email protected]> 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