diff --git a/src/main/java/org/apache/commons/collections4/IterableUtils.java b/src/main/java/org/apache/commons/collections4/IterableUtils.java index d5cb44424..104f4d135 100644 --- a/src/main/java/org/apache/commons/collections4/IterableUtils.java +++ b/src/main/java/org/apache/commons/collections4/IterableUtils.java @@ -775,10 +775,14 @@ public class IterableUtils { } /** + * Shortcut for {@code get(iterator, 0)}. + *

* Returns the first value in the iterable's {@link Iterator}, throwing * IndexOutOfBoundsException if there is no such element. + *

*

* If the {@link Iterable} is a {@link List}, then it will use {@link List#get(int)}. + *

* * @param the type of object in the {@link Iterable}. * @param iterable the {@link Iterable} to get a value from, may be null diff --git a/src/main/java/org/apache/commons/collections4/IteratorUtils.java b/src/main/java/org/apache/commons/collections4/IteratorUtils.java index 86a2c09b0..79ce159f3 100644 --- a/src/main/java/org/apache/commons/collections4/IteratorUtils.java +++ b/src/main/java/org/apache/commons/collections4/IteratorUtils.java @@ -1413,14 +1413,17 @@ public class IteratorUtils { } /** + * Shortcut for {@code get(iterator, 0)}. + *

* Returns the first value in {@link Iterator}, throwing * IndexOutOfBoundsException if there is no such element. + *

*

- * The Iterator is advanced to index (or to the end, if - * index exceeds the number of entries) as a side effect of this method. - * + * The Iterator is advanced to 0 (or to the end, if + * 0 exceeds the number of entries) as a side effect of this method. + *

* @param the type of object in the {@link Iterator} - * @param iterator the iterator to get a value from + * @param iterator the iterator to get a value from * @return the first object * @throws IndexOutOfBoundsException if the request is invalid * @since 4.2