On Wed, 1 Jul 2026 18:32:54 GMT, Justin Lu <[email protected]> wrote: >> src/java.base/share/classes/sun/util/locale/InternalLocaleBuilder.java line >> 405: >> >>> 403: else if (language.equals("no") && region.equals("NO") && >>> variant.equals("NY")) { >>> 404: // no_NO_NY is a valid locale and used by Java 6 or >>> older versions. >>> 405: // The build ignores the variant "NY" and change the >>> language to "nn". >> >> Nit: typo: "build" -> "builder", "change" -> "changes" > > Fixed. > > Separately, I wanted to follow up on the `no_NO_NY` case handling. We > currently have the following behavior, > > > jshell> var loc = Locale.forLanguageTag("no-Latn-NO-x-lvariant-NY") > loc ==> no_NO_NY_#Latn > > jshell> var tag = loc.toLanguageTag() > tag ==> "nn-Latn-NO" > > > That is, `forLanguageTag` will provide compatibility support for this case, > even if a script is present. I presume we will want to fix that there as well?
I think so. That would be consistent with how we handle legacy locales ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/31728#discussion_r3508364159
