mirror of
https://github.com/openjdk/jdk.git
synced 2026-04-07 21:48:41 +00:00
7057785: Add note about optional support of recursive methods for self-referential Collection/Map
Reviewed-by: scolebourne, darcy, mduigou
This commit is contained in:
parent
2a5d8d6d8c
commit
8fd60ce581
@ -104,6 +104,13 @@ import java.util.stream.StreamSupport;
|
||||
* the specified behavior of underlying {@link Object} methods wherever the
|
||||
* implementor deems it appropriate.
|
||||
*
|
||||
* <p>Some collection operations which perform recursive traversal of the
|
||||
* collection may fail with an exception for self-referential instances where
|
||||
* the collection directly or indirectly contains itself. This includes the
|
||||
* {@code clone()}, {@code equals()}, {@code hashCode()} and {@code toString()}
|
||||
* methods. Implementations may optionally handle the self-referential scenario,
|
||||
* however most current implementations do not do so.
|
||||
*
|
||||
* <p>This interface is a member of the
|
||||
* <a href="{@docRoot}/../technotes/guides/collections/index.html">
|
||||
* Java Collections Framework</a>.
|
||||
|
||||
@ -86,10 +86,6 @@ import java.io.Serializable;
|
||||
* Such exceptions are marked as "optional" in the specification for this
|
||||
* interface.
|
||||
*
|
||||
* <p>This interface is a member of the
|
||||
* <a href="{@docRoot}/../technotes/guides/collections/index.html">
|
||||
* Java Collections Framework</a>.
|
||||
*
|
||||
* <p>Many methods in Collections Framework interfaces are defined
|
||||
* in terms of the {@link Object#equals(Object) equals} method. For
|
||||
* example, the specification for the {@link #containsKey(Object)
|
||||
@ -107,6 +103,17 @@ import java.io.Serializable;
|
||||
* the specified behavior of underlying {@link Object} methods wherever the
|
||||
* implementor deems it appropriate.
|
||||
*
|
||||
* <p>Some map operations which perform recursive traversal of the map may fail
|
||||
* with an exception for self-referential instances where the map directly or
|
||||
* indirectly contains itself. This includes the {@code clone()},
|
||||
* {@code equals()}, {@code hashCode()} and {@code toString()} methods.
|
||||
* Implementations may optionally handle the self-referential scenario, however
|
||||
* most current implementations do not do so.
|
||||
*
|
||||
* <p>This interface is a member of the
|
||||
* <a href="{@docRoot}/../technotes/guides/collections/index.html">
|
||||
* Java Collections Framework</a>.
|
||||
*
|
||||
* @param <K> the type of keys maintained by this map
|
||||
* @param <V> the type of mapped values
|
||||
*
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user