You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ki...@apache.org on 2020/08/26 02:01:03 UTC

[commons-collections] 01/03: [COLLECTIONS-765] Corrected javadoc and thrown exception type to match the functionallity

This is an automated email from the ASF dual-hosted git repository.

kinow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-collections.git

commit 7b92e562abac1d96abf492a3e91918253d6db39e
Author: Tobi <ki...@informatik.hu-berlin.de>
AuthorDate: Fri Aug 21 16:40:39 2020 +0200

    [COLLECTIONS-765] Corrected javadoc and thrown exception type to match the functionallity
---
 .../apache/commons/collections4/iterators/ListIteratorWrapper.java | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/commons/collections4/iterators/ListIteratorWrapper.java b/src/main/java/org/apache/commons/collections4/iterators/ListIteratorWrapper.java
index 52a89d2..7784dfb 100644
--- a/src/main/java/org/apache/commons/collections4/iterators/ListIteratorWrapper.java
+++ b/src/main/java/org/apache/commons/collections4/iterators/ListIteratorWrapper.java
@@ -203,12 +203,13 @@ public class ListIteratorWrapper<E> implements ResettableListIterator<E> {
     }
 
     /**
-     * Throws {@link UnsupportedOperationException} if {@link #previous()} has ever been called.
+     * Removes the last element that was returned by {@link #next()} or {@link #previous()} from the underlying collection.
+     * This call can only be made once per call to {@code next} or {@code previous} and only if {@link #add()} was not called in between.
      *
-     * @throws UnsupportedOperationException always
+     * @throws IllegalStateException if {@code next} or {@code previous} have not been called before, or if {@code remove} or {@code add} have been called after the last call to {@code next} or {@code previous}
      */
     @Override
-    public void remove() throws UnsupportedOperationException {
+    public void remove() throws IllegalStateException {
         if (iterator instanceof ListIterator) {
             iterator.remove();
             return;