提交 986e6ee6 编写于 作者: M mduigou

8023340: Clarify that unmodifiable List.replaceAll() may not throw UOE if...

8023340: Clarify that unmodifiable List.replaceAll() may not throw UOE if there are no items to be replaced.
Reviewed-by: psandoz, jjg
上级 182ba02f
...@@ -396,11 +396,13 @@ public interface List<E> extends Collection<E> { ...@@ -396,11 +396,13 @@ public interface List<E> extends Collection<E> {
* replacing the first element. * replacing the first element.
* *
* @param operator the operator to apply to each element * @param operator the operator to apply to each element
* @throws UnsupportedOperationException if the {@code set} * @throws UnsupportedOperationException if this list is unmodifiable.
* operation is not supported by this list * 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 * @throws NullPointerException if the specified operator is null or
* if the element is replaced with a null value and this list * if the operator result is a null value and this list does
* does not permit null elements * not permit null elements
* (<a href="Collection.html#optional-restrictions">optional</a>) * (<a href="Collection.html#optional-restrictions">optional</a>)
* @since 1.8 * @since 1.8
*/ */
...@@ -685,4 +687,3 @@ public interface List<E> extends Collection<E> { ...@@ -685,4 +687,3 @@ public interface List<E> extends Collection<E> {
return Spliterators.spliterator(this, Spliterator.ORDERED); return Spliterators.spliterator(this, Spliterator.ORDERED);
} }
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册