On Wed, 7 Jan 2026 13:20:20 GMT, Per Minborg <[email protected]> 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.

This pull request has now been integrated.

Changeset: 75172e06
Author:    Per Minborg <[email protected]>
URL:       
https://git.openjdk.org/jdk/commit/75172e06585060e5efca080a11d8a8a51b40afed
Stats:     8 lines in 3 files changed: 0 ins; 1 del; 7 mod

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

Reviewed-by: rriggs

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

PR: https://git.openjdk.org/jdk/pull/29091

Reply via email to