Merge branch 'pr-176'

This closes #176
This commit is contained in:
Bruno P. Kinoshita 2020-08-26 13:54:19 +12:00
commit 0fbfbfca65
2 changed files with 7 additions and 3 deletions

View File

@ -21,6 +21,9 @@
</properties>
<body>
<release version="4.5" date="2020-MM-DD" description="Maintenance release.">
<action issue="COLLECTIONS-765" dev="kinow" type="fix" due-to="Tobias Kiecker">
Update Javadoc of ListIteratorWrapper#remove.
</action>
<action issue="COLLECTIONS-708" dev="kinow" type="fix" due-to="dota17">
Add hashCode method to CollectionUtils that supports an equator parameter.
</action>

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;