On Fri, 4 Mar 2022 20:00:54 GMT, Roger Riggs <[email protected]> wrote:
>> I am afraid people are still using constructors for creating a locale,
>> instead of the factory method that was added later. Since `new Locale("en")
>> == new Locale("en")` returns `false`, I'd still expect `equals()` to compare
>> locales. As to the constants, the number of them is relatively small, IMO.
>
> As a separate/future issue, perhaps the constructors should be deprecated to
> nudge people to using the static `getInstance` methods.
Would it be just as effective and improve performance more broadly to cache in
DecimalFormatSymbols.getInstance()?
Declarations should be private unless there is a package need.
In this case, the only access to should be via the method.
-------------
PR: https://git.openjdk.java.net/jdk/pull/7703