[COLLECTIONS-765] Corrected javadoc and thrown exception type to match the functionallity

This commit is contained in:
Tobi 2020-08-21 16:40:39 +02:00 committed by Bruno P. Kinoshita
parent ac61e06bc1
commit 7b92e562ab
1 changed files with 4 additions and 3 deletions

View File

@ -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;