RFR: 8341903: Implementation of Scoped Values (Fourth Preview) [v3]

Alan Bateman alanb at openjdk.org
Mon Oct 14 14:07:14 UTC 2024


On Mon, 14 Oct 2024 13:40:50 GMT, Andrew Haley <aph at openjdk.org> wrote:

>> The fourth preview of scoped values.
>
> Andrew Haley has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Scoped values
>  - Scoped values

The changes in update 90a344a3 looks okay, just one example in the ScopedValue docs that was missed (the example is correct in the loom repo).

src/java.base/share/classes/java/lang/ScopedValue.java line 160:

> 158:  *     private static final ScopedValue<String> NAME = ScopedValue.newInstance();
> 159: 
> 160:  *     ScopedValue.runWhere(NAME, "duke", () -> {

This should be `ScopedValue.where(NAME, "duke").run(() -> {`.

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

PR Comment: https://git.openjdk.org/jdk/pull/21456#issuecomment-2411371574
PR Review Comment: https://git.openjdk.org/jdk/pull/21456#discussion_r1799579699


More information about the core-libs-dev mailing list