8068599: Add mutability, serializability, and thread-safety, caveat to all Collectors that do not accept a Collection supplier

Reviewed-by: psandoz
This commit is contained in:
Chris Hegarty 2015-01-13 17:14:51 +00:00
parent 800c634a8a
commit 06e81aae83

View File

@ -990,7 +990,7 @@ public final class Collectors {
* function.
*
* <p>There are no guarantees on the type, mutability, or serializability
* of the {@code Map} or {@code List} objects returned, or of the
* of the {@code ConcurrentMap} or {@code List} objects returned, or of the
* thread-safety of the {@code List} objects returned.
* @implSpec
* This produces a result similar to:
@ -1028,6 +1028,9 @@ public final class Collectors {
* produces a result of type {@code D}. The resulting collector produces a
* {@code Map<K, D>}.
*
* <p>There are no guarantees on the type, mutability, or serializability
* of the {@code ConcurrentMap} returned.
*
* <p>For example, to compute the set of last names of people in each city,
* where the city names are sorted:
* <pre>{@code
@ -1143,7 +1146,8 @@ public final class Collectors {
* {@code Map<Boolean, List<T>>}.
*
* There are no guarantees on the type, mutability,
* serializability, or thread-safety of the {@code Map} returned.
* serializability, or thread-safety of the {@code Map} or {@code List}
* returned.
*
* @param <T> the type of the input elements
* @param predicate a predicate used for classifying input elements
@ -1212,6 +1216,9 @@ public final class Collectors {
* may have duplicates, use {@link #toMap(Function, Function, BinaryOperator)}
* instead.
*
* <p>There are no guarantees on the type, mutability, serializability,
* or thread-safety of the {@code Map} returned.
*
* @apiNote
* It is common for either the key or the value to be the input elements.
* In this case, the utility method
@ -1271,6 +1278,9 @@ public final class Collectors {
* the value mapping function is applied to each equal element, and the
* results are merged using the provided merging function.
*
* <p>There are no guarantees on the type, mutability, serializability,
* or thread-safety of the {@code Map} returned.
*
* @apiNote
* There are multiple ways to deal with collisions between multiple elements
* mapping to the same key. The other forms of {@code toMap} simply use
@ -1382,6 +1392,9 @@ public final class Collectors {
* may have duplicates, use
* {@link #toConcurrentMap(Function, Function, BinaryOperator)} instead.
*
* <p>There are no guarantees on the type, mutability, or serializability
* of the {@code ConcurrentMap} returned.
*
* @apiNote
* It is common for either the key or the value to be the input elements.
* In this case, the utility method
@ -1436,6 +1449,9 @@ public final class Collectors {
* the value mapping function is applied to each equal element, and the
* results are merged using the provided merging function.
*
* <p>There are no guarantees on the type, mutability, or serializability
* of the {@code ConcurrentMap} returned.
*
* @apiNote
* There are multiple ways to deal with collisions between multiple elements
* mapping to the same key. The other forms of {@code toConcurrentMap} simply use