8385054: Spec: Clarify ofLazy List/Set/Map equals/hashCode/toString Javadoc

Reviewed-by: vklang
This commit is contained in:
Per Minborg 2026-06-04 08:50:52 +00:00
parent d47d729c9b
commit c6f9c23111
3 changed files with 16 additions and 4 deletions

View File

@ -1242,7 +1242,11 @@ public interface List<E> extends SequencedCollection<E> {
* {@linkplain Object#hashCode() hashCode()}, and
* {@linkplain Object#toString() toString()} methods may trigger initialization of
* one or more lazy elements. If initialization fails for at least one element,
* the {@linkplain Object Object methods} may throw {@linkplain NoSuchElementException}.
* the {@linkplain Object#hashCode() hashCode()} and
* {@linkplain Object#toString() toString()} methods throw
* {@linkplain NoSuchElementException}, and the {@linkplain Object#equals(Object)}
* throw {@linkplain NoSuchElementException} if attempting to compare an element that
* could not be computed.
* <p>
* The returned lazy list strongly references its computing
* function used to compute elements at least as long as there are uninitialized

View File

@ -1793,8 +1793,12 @@ public interface Map<K, V> {
* {@linkplain Object#equals(Object) equals()},
* {@linkplain Object#hashCode() hashCode()}, and
* {@linkplain Object#toString() toString()} methods may trigger initialization of
* one or more lazy values. If initialization fails for at least one value,
* the {@linkplain Object Object methods} may throw {@linkplain NoSuchElementException}.
* one or more lazy values. If initialization fails for at least one value,
* the {@linkplain Object#hashCode() hashCode()} and
* {@linkplain Object#toString() toString()} methods throw
* {@linkplain NoSuchElementException}, and the {@linkplain Object#equals(Object)}
* throw {@linkplain NoSuchElementException} if attempting to compare a value that
* could not be computed.
* <p>
* The returned lazy map strongly references its underlying
* computing function used to compute values at least as long as there are

View File

@ -788,7 +788,11 @@ public interface Set<E> extends Collection<E> {
* {@linkplain Object#hashCode() hashCode()}, and
* {@linkplain Object#toString() toString()} methods may trigger initialization of
* one or more lazy elements. If initialization fails for at least one element,
* the {@linkplain Object Object methods} may throw {@linkplain NoSuchElementException}.
* the {@linkplain Object#hashCode() hashCode()} and
* {@linkplain Object#toString() toString()} methods throw
* {@linkplain NoSuchElementException}, and the {@linkplain Object#equals(Object)}
* throw {@linkplain NoSuchElementException} if attempting to compare an element that
* could not be computed.
* <p>
* The returned lazy set strongly references its underlying
* computing function used to compute membership status at least as long as there are