diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 4a34df5ea..3b93a5fee 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -87,9 +87,12 @@ Add org.apache.commons.collections4.IterableUtils.first(Iterable). - + Modify IteratorUtils.peekingIterator signature to return PeekingIterator. + + Modify IteratorUtils.pushbackIterator signature to return PushbackIterator. + diff --git a/src/main/java/org/apache/commons/collections4/IteratorUtils.java b/src/main/java/org/apache/commons/collections4/IteratorUtils.java index 8863cd31d..f0d2ba268 100644 --- a/src/main/java/org/apache/commons/collections4/IteratorUtils.java +++ b/src/main/java/org/apache/commons/collections4/IteratorUtils.java @@ -873,8 +873,9 @@ public class IteratorUtils { * @return a pushback iterator * @throws NullPointerException if the iterator is null * @since 4.0 + * @since 4.2 returns a {@link PushbackIterator} instead of a {@link Iterator}. */ - public static Iterator pushbackIterator(final Iterator iterator) { + public static PushbackIterator pushbackIterator(final Iterator iterator) { return PushbackIterator.pushbackIterator(iterator); }