RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v25]
Maurizio Cimadamore
mcimadamore at openjdk.org
Wed Apr 2 08:39:37 UTC 2025
On Tue, 1 Apr 2025 13:27:34 GMT, Per Minborg <pminborg at openjdk.org> wrote:
>> Implement JEP 502.
>>
>> The PR passes tier1-tier3 tests.
>
> Per Minborg has updated the pull request incrementally with two additional commits since the last revision:
>
> - Add lazy toSting for StableMap::values
> - Make toString for reversed and sublist lazy
src/java.base/share/classes/java/lang/StableValue.java line 50:
> 48:
> 49: /**
> 50: * A stable value is a deferred holder of shallowly immutable content.
The JEP introduces this terminology:
> A stable value is an object, of type [StableValue](https://cr.openjdk.org/~pminborg/stable-values2/api/java.base/java/lang/StableValue.html), that holds a single data value, its content
I'm not saying we should copy this definition -- but I note that the word `deferred holder` (and also `deferred` in general) only appears once (here) in the whole doc. On the other hand, I find many occurrences of `lazy`/`lazily computed`, so maybe you want to stick with that here:
A stable value is a holder of shallowly immutable, lazily computed content.
Or
A stable value is a holder of shallowly immutable content that can be lazily computed.
src/java.base/share/classes/java/lang/StableValue.java line 52:
> 50: * A stable value is a deferred holder of shallowly immutable content.
> 51: * <p>
> 52: * A {@code StableValue<T>} can be created using the factory method
s/can be/is (more direct) -- here and elsewhere
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23972#discussion_r2024346623
PR Review Comment: https://git.openjdk.org/jdk/pull/23972#discussion_r2024347188
More information about the core-libs-dev
mailing list