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

2022-11-23 Thread Andrew Haley
On Wed, 16 Nov 2022 13:13:59 GMT, Alan Bateman wrote: >> Note that `ScopedValue` can currently be bound to `null`, but by using >> `Optional`, there would be no way to differentiate an unbound `ScopedValue` >> from one bound to `null`. > >> Note that `ScopedValue` can currently be bound to `nul

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

2022-11-16 Thread Alan Bateman
On Wed, 16 Nov 2022 19:08:48 GMT, Andrew Haley wrote: >> There is a "bare" reference to `ScopedValue`. Should it be `{@code >> ScopedValue}` or `{@link ScopedValue}` ? > > Ahh, OK. We fixed those in the recent update. - PR: https://git.openjdk.org/jdk/pull/10952

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

2022-11-16 Thread Andrew Haley
On Wed, 16 Nov 2022 18:26:15 GMT, Maurizio Cimadamore wrote: >> Sorry, I don't understand what you want. > > There is a "bare" reference to `ScopedValue`. Should it be `{@code > ScopedValue}` or `{@link ScopedValue}` ? Ahh, OK. - PR: https://git.openjdk.org/jdk/pull/10952

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

2022-11-16 Thread Maurizio Cimadamore
On Wed, 16 Nov 2022 15:58:49 GMT, Andrew Haley wrote: >> src/jdk.incubator.concurrent/share/classes/jdk/incubator/concurrent/ScopedValue.java >> line 460: >> >>> 458: * } >>> 459: * >>> 460: * @param key the ScopedValue key >> >> should use `@code` or `@link` > > Sorry, I don't

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

2022-11-16 Thread Andrew Haley
On Tue, 15 Nov 2022 19:15:21 GMT, Maurizio Cimadamore wrote: >> Andrew Haley has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Fix failing serviceability tests > > src/jdk.incubator.concurrent/share/classes/jdk/incubator/concurrent/Scoped

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

2022-11-16 Thread Andrew Haley
On Wed, 16 Nov 2022 11:38:10 GMT, Maurizio Cimadamore wrote: >> Mm, but this is the type of the value of the `ScopedValue` instance. >> So, the type of the scoped value is `ScopedValue`, the type of the value >> is `T`, is it not? > > Right - there's "scoped value" which is the holder, and "val

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

2022-11-16 Thread Alan Bateman
On Wed, 16 Nov 2022 12:50:04 GMT, ExE Boss wrote: > Note that `ScopedValue` can currently be bound to `null`, but by using > `Optional`, there would be no way to differentiate an unbound `ScopedValue` > from one bound to `null`. That's right, an Optional view would have to deal with that. ---

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

2022-11-16 Thread ExE Boss
On Wed, 16 Nov 2022 12:11:45 GMT, Maurizio Cimadamore wrote: >> We expect isBound() will be used a lot and I think that is clearer (and >> cheaper) than find().isEmpty(). >> >> Time will tell on orElse/orElseThrow and whether they should be replaced >> with an Optional view. That is, I think

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

2022-11-16 Thread Maurizio Cimadamore
On Wed, 16 Nov 2022 12:01:58 GMT, Alan Bateman wrote: >> IMHO there are ways to have the cake and eat it too. That is, we could have >> a couple of overloads: >> >> >> T get() { ... } // throws NSME if not found >> Optional find() // returns empty optional if not found >> >> >> Then, for sim

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

2022-11-16 Thread Alan Bateman
On Wed, 16 Nov 2022 11:41:49 GMT, Maurizio Cimadamore wrote: >> It certainly would look odd. This API is, by design, as lightweight as it >> possibly can be, both from an implementation and a user's point of view. >> It's also intended to be as close as possible to an "invisible" parameter >>

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

2022-11-16 Thread Maurizio Cimadamore
On Wed, 16 Nov 2022 11:03:07 GMT, Andrew Haley wrote: >> Yes, my comment was really on `get` - that said, I note that saying >> get().get() would look odd (but maybe finding some other name for >> `ScopedValue::get`, such as `find` might work) > > It certainly would look odd. This API is, by de

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

2022-11-16 Thread Maurizio Cimadamore
On Wed, 16 Nov 2022 10:57:49 GMT, Andrew Haley 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 the type of the value >> >> Suggest

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

2022-11-16 Thread Andrew Haley
On Tue, 15 Nov 2022 21:28:29 GMT, Maurizio Cimadamore wrote: >> This comment is on orElse but I suspect you are suggesting that get() be >> changed to return Optional. I think we'll need to get more feedback/usage of >> this API before re-visiting that. > > Yes, my comment was really on `get`

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

2022-11-16 Thread Andrew Haley
On Tue, 15 Nov 2022 18:35:06 GMT, Maurizio Cimadamore wrote: >> Andrew Haley has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Fix failing serviceability tests > > src/jdk.incubator.concurrent/share/classes/jdk/incubator/concurrent/Scoped

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

2022-11-16 Thread Andrew Haley
On Tue, 15 Nov 2022 20:11:36 GMT, Alan Bateman wrote: > I'd prefer to keep this as is because it's too much to use "threads" or > mention inheritance in the first paragraph. I agree. - PR: https://git.openjdk.org/jdk/pull/10952

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

2022-11-15 Thread Maurizio Cimadamore
On Tue, 15 Nov 2022 20:26:37 GMT, Alan Bateman wrote: >> src/jdk.incubator.concurrent/share/classes/jdk/incubator/concurrent/ScopedValue.java >> line 613: >> >>> 611: * @return the value of the scoped value if bound, otherwise >>> {@code other} >>> 612: */ >>> 613: public T orEls

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

2022-11-15 Thread Alan Bateman
On Tue, 15 Nov 2022 19:19:57 GMT, Maurizio Cimadamore wrote: >> Andrew Haley has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Fix failing serviceability tests > > src/jdk.incubator.concurrent/share/classes/jdk/incubator/concurrent/Scoped

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

2022-11-15 Thread Alan Bateman
On Tue, 15 Nov 2022 18:28:56 GMT, Maurizio Cimadamore wrote: >> Andrew Haley has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Fix failing serviceability tests > > src/jdk.incubator.concurrent/share/classes/jdk/incubator/concurrent/Scoped

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

2022-11-15 Thread Maurizio Cimadamore
On Tue, 15 Nov 2022 17:36:16 GMT, Andrew Haley wrote: >> JEP 429 implementation. > > Andrew Haley has updated the pull request incrementally with one additional > commit since the last revision: > > Fix failing serviceability tests src/jdk.incubator.concurrent/share/classes/jdk/incubator/con

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

2022-11-15 Thread Alan Bateman
On Tue, 15 Nov 2022 17:36:16 GMT, Andrew Haley wrote: >> JEP 429 implementation. > > Andrew Haley has updated the pull request incrementally with one additional > commit since the last revision: > > Fix failing serviceability tests test/jdk/ProblemList.txt line 804: > 802: > 803: # Loom, f

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

2022-11-15 Thread Andrew Haley
> JEP 429 implementation. Andrew Haley has updated the pull request incrementally with one additional commit since the last revision: Fix failing serviceability tests - Changes: - all: https://git.openjdk.org/jdk/pull/10952/files - new: https://git.openjdk.org/jdk/pull/10952/