<i18n dev> RFR: 8366178: Implement JEP 526: Lazy Constants (Second Preview) [v16]
Maurizio Cimadamore
mcimadamore at openjdk.org
Fri Oct 17 14:30:06 UTC 2025
On Fri, 17 Oct 2025 14:23:28 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> Per Minborg has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Update docs after comments
>
> src/java.base/share/classes/java/util/List.java line 1235:
>
>> 1233: * or more lazy elements. The returned list's {@linkplain Object#toString() toString()}
>> 1234: * method never triggers initialization of elements. Instead, an
>> 1235: * implementation-dependant string is returned for uninitialized elements.
>
> Suggestion:
>
> * implementation-dependent string is returned for uninitialized elements.
Design comment: I note some internal discomfort at the fact that equals/hashCode trigger initialization, but toString does not... effectively this would make replacing a regular immutable list with a lazy list not possible in all cases. Not saying we should do anything now -- but something to monitor
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27605#discussion_r2440214527
More information about the i18n-dev
mailing list