RFR: 8282819: Deprecate Locale class constructors [v3]
Lance Andersen
lancea at openjdk.java.net
Sat Mar 26 11:33:44 UTC 2022
On Fri, 25 Mar 2022 22:51:23 GMT, Naoto Sato <naoto at openjdk.org> wrote:
>> Proposing to deprecate the constructors in the `java.util.Locale` class. There is already a factory method and a builder to return singletons, so there is no need to have constructors anymore unless one purposefully wants to create `ill-formed` Locale objects, which is discouraged. We cannot terminally deprecate those constructors for the compatibility to serialized objects created with older JDKs. Please see the draft CSR for more detail.
>
> Naoto Sato has updated the pull request incrementally with one additional commit since the last revision:
>
> Fixed a build failure
Hi Naoto,
I think the changes look good.
One suggestion
As part of the PR, we should probably update test/jdk/java/util/Locale/LocaleTest.java. or perhaps add a new test for Locale.of() for completeness.
-------------
PR: https://git.openjdk.java.net/jdk/pull/7947
More information about the core-libs-dev
mailing list