RFR: 8359119: Change Charset to use StableValue

Alan Bateman alanb at openjdk.org
Tue Jun 10 14:28:29 UTC 2025


On Tue, 10 Jun 2025 14:12:35 GMT, Per Minborg <pminborg at openjdk.org> wrote:

>> Fields and methods can better leverage the Stable Value API compared to using DCL and holder classes. There are also some fields that can be marked `@Stable`.
>> 
>> This PR passes tier1, tier2, and tier3 tests on multiple platforms.
>
> src/java.base/share/classes/java/nio/charset/Charset.java line 353:
> 
>> 351:     private static Iterator<CharsetProvider> providers() {
>> 352:         return new Iterator<>() {
>> 353:                 final ClassLoader cl = ClassLoader.getSystemClassLoader();
> 
> Drive by fix. We forgot to declare these fields `final`.

final isn't actually needed here, I think better to drop this drive-by change from the PR.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25727#discussion_r2138051345


More information about the nio-dev mailing list