From d3271b9b3fdf2c144e1cbc02f4f3b8b3ed1cf8eb Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Sun, 25 Aug 2024 18:24:09 -0400 Subject: [PATCH] Can't rename protected instance variable - Javadoc: Better @link --- .../collections4/iterators/LoopingIterator.java | 2 +- .../iterators/LoopingListIterator.java | 2 +- .../collections4/multiset/AbstractMapMultiSet.java | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/org/apache/commons/collections4/iterators/LoopingIterator.java b/src/main/java/org/apache/commons/collections4/iterators/LoopingIterator.java index 7f0752005..ac62a1ce8 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/LoopingIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/LoopingIterator.java @@ -94,7 +94,7 @@ public class LoopingIterator implements ResettableIterator { * Removes the previously retrieved item from the underlying collection. *

* This feature is only supported if the underlying collection's - * {@link Collection#iterator iterator} method returns an implementation + * {@link Collection#iterator()} method returns an implementation * that supports it. *

* This method can only be called after at least one {@link #next} method call. diff --git a/src/main/java/org/apache/commons/collections4/iterators/LoopingListIterator.java b/src/main/java/org/apache/commons/collections4/iterators/LoopingListIterator.java index 279728e9b..0282fb2ac 100644 --- a/src/main/java/org/apache/commons/collections4/iterators/LoopingListIterator.java +++ b/src/main/java/org/apache/commons/collections4/iterators/LoopingListIterator.java @@ -206,7 +206,7 @@ public class LoopingListIterator implements ResettableListIterator { * Removes the previously retrieved item from the underlying list. *

* This feature is only supported if the underlying list's - * {@link List#iterator iterator} method returns an implementation + * {@link List#iterator()} method returns an implementation * that supports it. *

* This method can only be called after at least one {@link #next} diff --git a/src/main/java/org/apache/commons/collections4/multiset/AbstractMapMultiSet.java b/src/main/java/org/apache/commons/collections4/multiset/AbstractMapMultiSet.java index 98f81dddf..dfdfaedbd 100644 --- a/src/main/java/org/apache/commons/collections4/multiset/AbstractMapMultiSet.java +++ b/src/main/java/org/apache/commons/collections4/multiset/AbstractMapMultiSet.java @@ -54,7 +54,7 @@ public abstract class AbstractMapMultiSet extends AbstractMultiSet { /** * The source Iterator. */ - protected final Iterator> iterator; + protected final Iterator> decorated; /** The last returned entry */ protected Entry last; @@ -64,23 +64,23 @@ public abstract class AbstractMapMultiSet extends AbstractMultiSet { /** * Constructs a new instance. - * @param iterator the iterator to decorate + * @param decorated the iterator to decorate * @param parent the parent multiset */ - protected EntrySetIterator(final Iterator> iterator, + protected EntrySetIterator(final Iterator> decorated, final AbstractMapMultiSet parent) { - this.iterator = iterator; + this.decorated = decorated; this.parent = parent; } @Override public boolean hasNext() { - return iterator.hasNext(); + return decorated.hasNext(); } @Override public Entry next() { - last = new MultiSetEntry<>(iterator.next()); + last = new MultiSetEntry<>(decorated.next()); canRemove = true; return last; } @@ -90,7 +90,7 @@ public abstract class AbstractMapMultiSet extends AbstractMultiSet { if (!canRemove) { throw new IllegalStateException("Iterator remove() can only be called once after next()"); } - iterator.remove(); + decorated.remove(); last = null; canRemove = false; }