RFR: 8359119: Change Charset to use StableValue [v3]

Alan Bateman alanb at openjdk.org
Tue Aug 5 10:14:15 UTC 2025


On Tue, 5 Aug 2025 09:08:47 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.
>
> Per Minborg has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains six additional commits since the last revision:
> 
>  - Address comments in PR
>  - Merge branch 'master' into stablify-charset
>  - Revert for loop
>  - Revert more
>  - Revert changes
>  - Add stable value functionality

src/java.base/share/classes/java/nio/charset/Charset.java line 387:

> 385:     }
> 386: 
> 387:     private static final ScopedValue<Boolean> IN_LOOKUP = ScopedValue.newInstance();

Thanks for change this to use ScopedValue. Once we change URL and ZipFile to do the same then it should remove the loading of ThreadTracker from startup to offset the loading of other classes.

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

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


More information about the nio-dev mailing list