On Thu, 7 Apr 2022 01:16:32 GMT, Naoto Sato <na...@openjdk.org> wrote:

>> test/jdk/java/text/Format/NumberFormat/CurrencyFormat.java line 63:
>> 
>>> 61:             Locale.of("it", "IT", "EURO"),
>>> 62:             Locale.forLanguageTag("de-AT"),
>>> 63:             Locale.forLanguageTag("fr-CH"),
>> 
>> Use the new factory? Ok not to change as these are tests and there are too 
>> many of them. It's not deprecated anyways.
>
> `Locale.forLanguageTag()` is a preferred way to create a `Locale`, as it 
> validates the input language tag, while `Locale.of()` doesn't as well as 
> Locale constructors.

Ok, I didn't realize the existing method is preferred over the new method in 
creating a Locale. The javadoc does state that it does not make any syntactic 
checks. That's good to know.

-------------

PR: https://git.openjdk.java.net/jdk/pull/8130

Reply via email to