Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v33]

2025-04-28 Thread Jorn Vernee
On Mon, 28 Apr 2025 11:29:46 GMT, Maurizio Cimadamore wrote: >> Yeah, that was what I was thinking too. > > Note - the JEP uses the word `content` (which has, I think, been "vetted"). > So I believe it would be ok (and, preferrable) to leave it as is. Unless you > are suggesting to also update

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v33]

2025-04-28 Thread Maurizio Cimadamore
On Wed, 23 Apr 2025 07:38:00 GMT, Viktor Klang wrote: >> I asked around/looked this up, and it seems 'contents' would be more correct >> here, since a StableValue is primarily a container of things (you put things >> into it, get things out). > > Yeah, that was what I was thinking too. Note -

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v33]

2025-04-25 Thread Alan Bateman
On Thu, 3 Apr 2025 01:19:18 GMT, Chen Liang wrote: >> Seconded > > I personally think this is more of an implementation artifact for > `StableValue::supplier` and doesn't merit its own API (as no other > StableValue API utilizes the object monitor of a StableValue), but maybe we > can adjust t

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v33]

2025-04-23 Thread Viktor Klang
On Fri, 18 Apr 2025 14:17:37 GMT, Jorn Vernee wrote: >> I'm definitely not an expert here, so I'll defer to someone more >> knowledgable :) > > I asked around/looked this up, and it seems 'contents' would be more correct > here, since a StableValue is primarily a container of things (you put th

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v33]

2025-04-18 Thread Jorn Vernee
On Thu, 3 Apr 2025 09:47:15 GMT, Viktor Klang wrote: >> I think it should be "content" as only one element can be set? > > I'm definitely not an expert here, so I'll defer to someone more knowledgable > :) I asked around/looked this up, and it seems 'contents' would be more correct here, since

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v33]

2025-04-07 Thread Maurizio Cimadamore
On Thu, 3 Apr 2025 14:26:15 GMT, Quan Anh Mai wrote: >> I don't think we should promise this even though it might be the case. > > What is the benefit of not promising it? Promising helps the supplier to have > a well-defined order of execution. Furthermore, even if you do not promise > it, it

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v33]

2025-04-05 Thread Per Minborg
On Wed, 2 Apr 2025 14:04:52 GMT, Alan Bateman wrote: >> Per Minborg has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add info that Map#values and Map#entrySet are stable > > src/java.base/share/classes/java/lang/StableValue.java line 649:

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v33]

2025-04-05 Thread Maurizio Cimadamore
On Thu, 3 Apr 2025 08:22:47 GMT, Per Minborg wrote: > "A stable value is a holder of content that can be lazily computed at most > once" I'd replace `computed` with `set` (as that's the term we use in the API). - PR Review Comment: https://git.openjdk.org/jdk/pull/23972#discussion

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v33]

2025-04-05 Thread Per Minborg
> Implement JEP 502. > > The PR passes tier1-tier3 tests. Per Minborg has updated the pull request incrementally with one additional commit since the last revision: Add info that Map#values and Map#entrySet are stable - Changes: - all: https://git.openjdk.org/jdk/pull/23972/fi

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v33]

2025-04-04 Thread Viktor Klang
On Thu, 3 Apr 2025 08:39:47 GMT, Per Minborg wrote: >> src/java.base/share/classes/java/lang/StableValue.java line 377: >> >>> 375: * >>> 376: * Thread Safety >>> 377: * The content of a stable value is guaranteed to be set at most once. >>> If competing >> >> Suggestion: >> >> * The cont

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v33]

2025-04-04 Thread Per Minborg
On Wed, 2 Apr 2025 14:42:17 GMT, Viktor Klang wrote: >> Per Minborg has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add info that Map#values and Map#entrySet are stable > > src/java.base/share/classes/java/lang/StableValue.java line 567:

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v33]

2025-04-04 Thread Quan Anh Mai
On Thu, 3 Apr 2025 12:54:01 GMT, Per Minborg wrote: >> src/java.base/share/classes/java/lang/StableValue.java line 402: >> >>> 400: * race. Since stable functions and stable collections are built on >>> top of >>> 401: * {@linkplain StableValue#orElseSet(Supplier) orElseSet()} they too >>> a

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v33]

2025-04-04 Thread Maurizio Cimadamore
On Thu, 3 Apr 2025 12:07:03 GMT, Maurizio Cimadamore wrote: >> There is a problem here: If we say it is "immutable content" people might >> think that passing mutable data makes it immutable. If we say it is >> "shallowly immutable content" people might think they cannot pass immutable >> dat

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v33]

2025-04-03 Thread Per Minborg
On Wed, 2 Apr 2025 18:46:06 GMT, Viktor Klang wrote: >> Per Minborg has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add info that Map#values and Map#entrySet are stable > > test/jdk/java/lang/StableValue/StableValueFactoriesTest.java lin

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v33]

2025-04-03 Thread Per Minborg
On Wed, 2 Apr 2025 18:49:31 GMT, Viktor Klang wrote: >> Per Minborg has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add info that Map#values and Map#entrySet are stable > > test/jdk/java/lang/StableValue/StableValueTest.java line 262: >

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v33]

2025-04-03 Thread Per Minborg
On Wed, 2 Apr 2025 19:22:28 GMT, Quan Anh Mai wrote: >> Per Minborg has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add info that Map#values and Map#entrySet are stable > > src/java.base/share/classes/java/lang/StableValue.java line 402:

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v33]

2025-04-03 Thread Per Minborg
On Wed, 2 Apr 2025 14:30:05 GMT, Viktor Klang wrote: >> Per Minborg has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add info that Map#values and Map#entrySet are stable > > src/java.base/share/classes/java/lang/StableValue.java line 426:

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v33]

2025-04-03 Thread Per Minborg
On Wed, 2 Apr 2025 18:42:06 GMT, Viktor Klang wrote: >> Per Minborg has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add info that Map#values and Map#entrySet are stable > > test/jdk/java/lang/StableValue/StableMapTest.java line 143: > >

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v33]

2025-04-03 Thread Per Minborg
On Wed, 2 Apr 2025 18:33:39 GMT, Viktor Klang wrote: >> Per Minborg has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add info that Map#values and Map#entrySet are stable > > test/jdk/java/lang/StableValue/StableFunctionTest.java line 147:

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v33]

2025-04-03 Thread Per Minborg
On Wed, 2 Apr 2025 18:33:22 GMT, Viktor Klang wrote: >> Per Minborg has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add info that Map#values and Map#entrySet are stable > > test/jdk/java/lang/StableValue/StableFunctionTest.java line 136:

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v33]

2025-04-03 Thread Per Minborg
On Wed, 2 Apr 2025 18:29:06 GMT, Viktor Klang wrote: >> Per Minborg has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add info that Map#values and Map#entrySet are stable > > test/jdk/java/lang/StableValue/StableFunctionTest.java line 86:

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v33]

2025-04-03 Thread Per Minborg
On Wed, 2 Apr 2025 16:31:03 GMT, Viktor Klang wrote: >> Per Minborg has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add info that Map#values and Map#entrySet are stable > > src/java.base/share/classes/jdk/internal/lang/stable/StableValue

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v33]

2025-04-03 Thread Per Minborg
On Wed, 2 Apr 2025 15:24:47 GMT, Viktor Klang wrote: >> Per Minborg has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add info that Map#values and Map#entrySet are stable > > src/java.base/share/classes/jdk/internal/lang/stable/StableEnumF

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v33]

2025-04-03 Thread Per Minborg
On Wed, 2 Apr 2025 14:24:20 GMT, Viktor Klang wrote: >> Per Minborg has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add info that Map#values and Map#entrySet are stable > > src/java.base/share/classes/java/lang/StableValue.java line 377:

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v33]

2025-04-03 Thread Per Minborg
On Wed, 2 Apr 2025 14:25:45 GMT, Viktor Klang wrote: >> Per Minborg has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add info that Map#values and Map#entrySet are stable > > src/java.base/share/classes/java/lang/StableValue.java line 384:

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v33]

2025-04-03 Thread Per Minborg
On Wed, 2 Apr 2025 14:24:04 GMT, Viktor Klang wrote: >> Per Minborg has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add info that Map#values and Map#entrySet are stable > > src/java.base/share/classes/java/lang/StableValue.java line 374:

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v33]

2025-04-03 Thread Per Minborg
On Wed, 2 Apr 2025 21:37:25 GMT, Maurizio Cimadamore wrote: >> Or "observably immutable"? 🤔 > > or... "immutable" There is a problem here: If we say it is "immutable content" people might think that passing mutable data makes it immutable. If we say it is "shallowly immutable content" people

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v33]

2025-04-02 Thread Chen Liang
On Wed, 2 Apr 2025 14:31:46 GMT, Viktor Klang wrote: >> src/java.base/share/classes/java/lang/StableValue.java line 455: >> >>> 453: * provided to the {@link #orElseSet(Supplier)} method. >>> 454: */ >>> 455: boolean trySet(T content); >> >> I assume the intent is that try

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v33]

2025-04-02 Thread Maurizio Cimadamore
On Wed, 2 Apr 2025 14:07:45 GMT, Viktor Klang wrote: >> src/java.base/share/classes/java/lang/StableValue.java line 50: >> >>> 48: >>> 49: /** >>> 50: * A stable value is a holder of shallowly immutable content that can >>> be lazily computed. >> >> This reads as if the content can only be s

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v33]

2025-04-02 Thread Quan Anh Mai
On Wed, 2 Apr 2025 13:22:44 GMT, Per Minborg wrote: >> Implement JEP 502. >> >> The PR passes tier1-tier3 tests. > > Per Minborg has updated the pull request incrementally with one additional > commit since the last revision: > > Add info that Map#values and Map#entrySet are stable src/java

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v33]

2025-04-02 Thread Viktor Klang
On Wed, 2 Apr 2025 13:44:47 GMT, Alan Bateman wrote: >> Per Minborg has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add info that Map#values and Map#entrySet are stable > > src/java.base/share/classes/java/lang/StableValue.java line 455:

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v33]

2025-04-02 Thread Viktor Klang
On Wed, 2 Apr 2025 13:22:44 GMT, Per Minborg wrote: >> Implement JEP 502. >> >> The PR passes tier1-tier3 tests. > > Per Minborg has updated the pull request incrementally with one additional > commit since the last revision: > > Add info that Map#values and Map#entrySet are stable Thanks f

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v33]

2025-04-02 Thread Alan Bateman
On Wed, 2 Apr 2025 13:22:44 GMT, Per Minborg wrote: >> Implement JEP 502. >> >> The PR passes tier1-tier3 tests. > > Per Minborg has updated the pull request incrementally with one additional > commit since the last revision: > > Add info that Map#values and Map#entrySet are stable src/java

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v33]

2025-04-02 Thread Viktor Klang
On Wed, 2 Apr 2025 13:22:44 GMT, Per Minborg wrote: >> Implement JEP 502. >> >> The PR passes tier1-tier3 tests. > > Per Minborg has updated the pull request incrementally with one additional > commit since the last revision: > > Add info that Map#values and Map#entrySet are stable src/java

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v33]

2025-04-02 Thread Viktor Klang
On Wed, 2 Apr 2025 14:06:22 GMT, Viktor Klang wrote: >> Per Minborg has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Add info that Map#values and Map#entrySet are stable > > src/java.base/share/classes/java/lang/StableValue.java line 50:

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v33]

2025-04-02 Thread Alan Bateman
On Wed, 2 Apr 2025 13:22:44 GMT, Per Minborg wrote: >> Implement JEP 502. >> >> The PR passes tier1-tier3 tests. > > Per Minborg has updated the pull request incrementally with one additional > commit since the last revision: > > Add info that Map#values and Map#entrySet are stable src/java

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v33]

2025-04-02 Thread Viktor Klang
On Wed, 2 Apr 2025 13:22:44 GMT, Per Minborg wrote: >> Implement JEP 502. >> >> The PR passes tier1-tier3 tests. > > Per Minborg has updated the pull request incrementally with one additional > commit since the last revision: > > Add info that Map#values and Map#entrySet are stable src/java

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v33]

2025-04-02 Thread Alan Bateman
On Wed, 2 Apr 2025 13:22:44 GMT, Per Minborg wrote: >> Implement JEP 502. >> >> The PR passes tier1-tier3 tests. > > Per Minborg has updated the pull request incrementally with one additional > commit since the last revision: > > Add info that Map#values and Map#entrySet are stable src/java