On Tue, 1 Apr 2025 13:27:34 GMT, Per Minborg <pminb...@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 95:

> 93:  * <p>
> 94:  * Note that the holder value can only be set at most once.
> 95:  * In the example above, the {@code logger} field is declared {@code 
> final} which is

This is not 100% true -- a final non-static field is not treated as a constant 
by the VM (at least not yet). Again, I suggest to keep this discussion focused 
on the fact that `logger` is a `final` stable value field. The holder is 
created eagerly, but the _content_ is initialized lazily (in the `getLogger` 
method). So, same similar to `final` (can only be set once) -- but more 
flexible.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23972#discussion_r2024356190

Reply via email to