On Wed, 21 May 2025 21:19:36 GMT, Justin Lu <[email protected]> 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.
src/java.base/share/classes/sun/util/locale/LanguageTag.java line 458:
> 456: baseLanguage = "id";
> 457: }
> 458: language = baseLanguage;
Suggestion:
language = switch(baseLanguage) {
case "iw" -> "he";
case "ji" -> "yi";
case "in" -> "id";
default -> baseLanguage;
};
use switch expression
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25371#discussion_r2101446785