Re: RFR: 8282819: Deprecate Locale class constructors [v6]

2022-03-29 Thread Roger Riggs
On Mon, 28 Mar 2022 22:16:43 GMT, Naoto Sato  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:
> 
>   Added an @apiNote describing the single array argument

src/java.base/share/classes/sun/util/locale/provider/JRELocaleConstants.java 
line 38:

> 36:  */
> 37: public class JRELocaleConstants {
> 38: public static final Locale JA_JP_JP = 
> Locale.forLanguageTag("ja-JP-x-lvariant-JP");

You might use the new factory here.

src/java.base/share/classes/sun/util/resources/LocaleData.java line 249:

> 247: // TODO: avoid hard-coded Locales
> 248: private static final Set JAVA_BASE_LOCALES
> 249: = Set.of(Locale.ROOT, Locale.ENGLISH, Locale.US, 
> Locale.forLanguageTag("en-US-POSIX"));

Use new factory?

-

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


Re: RFR: 8282819: Deprecate Locale class constructors [v6]

2022-03-28 Thread Naoto Sato
> 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:

  Added an @apiNote describing the single array argument

-

Changes:
  - all: https://git.openjdk.java.net/jdk/pull/7947/files
  - new: https://git.openjdk.java.net/jdk/pull/7947/files/86c7b586..b1d36b52

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk&pr=7947&range=05
 - incr: https://webrevs.openjdk.java.net/?repo=jdk&pr=7947&range=04-05

  Stats: 4 lines in 2 files changed: 4 ins; 0 del; 0 mod
  Patch: https://git.openjdk.java.net/jdk/pull/7947.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/7947/head:pull/7947

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