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).
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.
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.
- csr for
-
JDK-8374720 Unclear wording in docs for recursion for List, Map and LazyConstant
-
- Proposed
-
- links to
-
Review(master)
openjdk/jdk/29091