@@ -97,8 +97,8 @@ public LinkedList() {}
9797 * collection, in the order they are returned by the collection's
9898 * iterator.
9999 *
100- * @param c the collection whose elements are to be placed into this list
101- * @throws NullPointerException if the specified collection is null
100+ * @param c the collection whose elements are to be placed into this list.
101+ * @throws NullPointerException if the specified collection is null.
102102 */
103103 public LinkedList (Collection <? extends E > c ) {
104104 this ();
@@ -110,7 +110,7 @@ public LinkedList(Collection<? extends E> c) {
110110 *
111111 * <p>This method is equivalent to {@link #addLast}.
112112 *
113- * @param e element to be appended to this list
113+ * @param e element to be appended to this list.
114114 * @return {@code true} (as specified by {@link Collection#add}).
115115 */
116116 @ Override
@@ -143,7 +143,7 @@ public void add(int index, E element) {
143143 * Appends all of the elements in the specified collection to the end of
144144 * this list, in the order they are returned by the specified collection's
145145 * iterator. The behavior of this operation is undefined if the specified
146- * collection is modified while the operation is in progress. (Note that
146+ * collection is modified while the operation is in progress. (Note that
147147 * this will occur if the specified collection is this list, and it's
148148 * nonempty.)
149149 *
@@ -171,6 +171,7 @@ public boolean addAll(Collection<? extends E> c) {
171171 @ Override
172172 public boolean addAll (int index , Collection <? extends E > c ) {
173173 checkPositionIndex (index );
174+
174175 if (c .isEmpty ()) {
175176 return false ;
176177 }
@@ -237,8 +238,8 @@ public void clear() {
237238 * formally, returns {@code true} if and only if this list contains at least
238239 * one element {@code e} such that {@code Objects.equals(o, e)}.
239240 *
240- * @param o element whose presence in this list is to be tested
241- * @return {@code true} if this list contains the specified element
241+ * @param o element whose presence in this list is to be tested.
242+ * @return {@code true} if this list contains the specified element.
242243 */
243244 @ Override
244245 public boolean contains (Object o ) {
@@ -442,17 +443,16 @@ public int lastIndexOf(Object o) {
442443 * sequence), starting at the specified position in the list.
443444 * Obeys the general contract of {@code List.listIterator(int)}.<p>
444445 *
445- * The list- iterator is <i>fail-fast</i>: if the list is structurally
446+ * The list iterator is <i>fail-fast</i>: if the list is structurally
446447 * modified at any time after the Iterator is created, in any way except
447- * through the list-iterator's own {@code remove} or {@code add}
448- * methods, the list-iterator will throw a
449- * {@code ConcurrentModificationException}. Thus, in the face of
450- * concurrent modification, the iterator fails quickly and cleanly, rather
451- * than risking arbitrary, non-deterministic behavior at an undetermined
452- * time in the future.
448+ * through the list iterator's own {@code remove} or {@code add} methods,
449+ * the list-iterator will throw a {@code ConcurrentModificationException}.
450+ * Thus, in the face of concurrent modification, the iterator fails quickly
451+ * and cleanly, rather than risking arbitrary, non-deterministic behavior at
452+ * an undetermined time in the future.
453453 *
454454 * @param index index of the first element to be returned from the
455- * list- iterator (by a call to {@code next}).
455+ * list iterator (by a call to {@code next}).
456456 * @return a ListIterator of the elements in this list (in proper
457457 * sequence), starting at the specified position in the list.
458458 * @throws IndexOutOfBoundsException {@inheritDoc}
@@ -477,7 +477,7 @@ public boolean offer(E e) {
477477 /**
478478 * Inserts the specified element at the front of this list.
479479 *
480- * @param e the element to insert
480+ * @param e the element to insert.
481481 * @return {@code true} (as specified by {@link Deque#offerFirst}).
482482 */
483483 @ Override
@@ -487,9 +487,9 @@ public boolean offerFirst(E e) {
487487 }
488488
489489 /**
490- * Inserts the specified element at the end of this list.
490+ * Appends the specified element at the end of this list.
491491 *
492- * @param e the element to insert.
492+ * @param e the element to append
493493 * @return {@code true} (as specified by {@link Deque#offerLast}).
494494 */
495495 @ Override
0 commit comments