8023340: Clarify that unmodifiable List.replaceAll() may not throw UOE if there are no items to be replaced.
Reviewed-by: psandoz, jjg
--- a/jdk/src/share/classes/java/util/List.java Fri Sep 27 13:30:31 2013 -0700
+++ b/jdk/src/share/classes/java/util/List.java Fri Sep 27 13:30:35 2013 -0700
@@ -396,11 +396,13 @@
* replacing the first element.
*
* @param operator the operator to apply to each element
- * @throws UnsupportedOperationException if the {@code set}
- * operation is not supported by this list
+ * @throws UnsupportedOperationException if this list is unmodifiable.
+ * Implementations may throw this exception if an element
+ * cannot be replaced or if, in general, modification is not
+ * supported
* @throws NullPointerException if the specified operator is null or
- * if the element is replaced with a null value and this list
- * does not permit null elements
+ * if the operator result is a null value and this list does
+ * not permit null elements
* (<a href="Collection.html#optional-restrictions">optional</a>)
* @since 1.8
*/
@@ -685,4 +687,3 @@
return Spliterators.spliterator(this, Spliterator.ORDERED);
}
}
-