RFR: 8374717: Unclear wording in docs for recursion for List, Map and LazyConstant

Roger Riggs rriggs at openjdk.org
Wed Jan 7 15:41:03 UTC 2026


On Wed, 7 Jan 2026 13:20:20 GMT, Per Minborg <pminborg at openjdk.org> wrote:

> The factory methods `(List|Map)::ofLazy` and `LazyConstant::get` specify that an `IllegalStateException` is thrown upon a recursive invocation of the computing function. However, it is not clear that this *only* applies if recursion is made through the lazy entity (and not direct recursion on the computing function itself).
> 
> This PR proposes to improve the wording in the docs for lazy constructs. This is a doc-only change.
> 
> For example, we could replace the word "or" with the word "via" in the `List::ofLazy` specification so that it says:
> 
>      * If the provided computing function recursively calls itself via the returned
>      * lazy list for the same index, an {@linkplain IllegalStateException}
>      * will be thrown.

Looks good.

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

Marked as reviewed by rriggs (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/29091#pullrequestreview-3635496758


More information about the core-libs-dev mailing list