RFR: JDK-8286666: JEP 429: Implementation of Scoped Values (Incubator) [v6]

Maurizio Cimadamore mcimadamore at openjdk.org
Wed Nov 16 11:45:41 UTC 2022


On Wed, 16 Nov 2022 10:57:49 GMT, Andrew Haley <aph at openjdk.org> wrote:

>> src/jdk.incubator.concurrent/share/classes/jdk/incubator/concurrent/ScopedValue.java line 185:
>> 
>>> 183:  * would have to be regenerated after a blocking operation.
>>> 184:  *
>>> 185:  * @param <T> the type of the value
>> 
>> Suggestion:
>> 
>>  * @param <T> the type of the scoped value
>
> Mm, but this is the type of the value of the `ScopedValue` instance.
> So, the type of the scoped value is `ScopedValue<T>`, the type of the value is `T`, is it not?

Right - there's "scoped value" which is the holder, and "value of the scoped value" which is what has the type T. You are correct that just dropping "scoped" in there doesn't make things better. Conversely, just leaving "value" and nothing else (as per PR) is ambiguous. It feels like we need some way (uniform throughout the javadoc) to speak about "the value associated to a scoped value instance".

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

PR: https://git.openjdk.org/jdk/pull/10952



More information about the build-dev mailing list