Draft: Deprecate toLowerCase()/toUpperCase() and provide locale insensitive alternative

Roger Riggs roger.riggs at oracle.com
Wed Apr 12 20:26:50 UTC 2023


Hi,

The status quo takes a balance between trying do the right thing and 
creating a headache for lots of developers.
Deprecating the existing methods would cause lots of warnings and 
provide little actual improvement.
Except in a few locales, the output would be the same as today.
If you're working in a locale where it matters, it has become habit to 
use Locale.root everywhere.

The most positive suggestion from the January thread [1] was to fix the 
uses in the JDK in small batches and carefully review each to make sure 
there are no unintended consequences. Even replacing the existing uses 
with a new method requires the same cautious approach.  Adding new 
methods was also mentioned.

The topics of deprecation and a new API should be treated separately, 
they have different costs and benefits.

As observed, coming to agreement on the naming is likely the hard part.
You might want to start a discussion about that; but it may be too soon 
for a PR.

Regards, Roger



On 4/11/23 4:02 PM, Glavo wrote:
> Hi everyone,
>
> A few months ago, I discussed in this mailing list[1] whether 
> toLowerCase()/toUpperCase() should be deprecated.
> At that time, I received some approval and no one opposed the 
> idea. Therefore, I thought it might be time
> to continue advancing this work, so I created a PR[2] for this.
>
> This PR is still a draft, welcome to discuss it there.
>
> I don't have much experience in contributing to OpenJDK yet, so I also 
> hope to get the help of experienced
> contributors (such as creating CSR). Thanks!
>
> Glavo
>
> [1] 
> https://mail.openjdk.org/pipermail/core-libs-dev/2023-January/099375.html
> [2] https://github.com/openjdk/jdk/pull/13434



More information about the core-libs-dev mailing list