Merge branch 'pr-121'

This closes #121
This commit is contained in:
Bruno P. Kinoshita 2020-01-09 20:19:29 +13:00
commit 7b83356791
4 changed files with 9 additions and 6 deletions

View File

@ -21,6 +21,9 @@
</properties> </properties>
<body> <body>
<release version="4.5" date="2019-MM-DD" description="Maintenance release."> <release version="4.5" date="2019-MM-DD" description="Maintenance release.">
<action issue="COLLECTIONS-738" dev="kinow" type="update" due-to="Pengyu Nie">
Remove the redundant assertNull in IterableUtilsTest.find and update Javadocs.
</action>
<action issue="COLLECTIONS-724" dev="ggregory" type="update" due-to="Eitan Adler"> <action issue="COLLECTIONS-724" dev="ggregory" type="update" due-to="Eitan Adler">
Simplify two remove-if loops #77. Simplify two remove-if loops #77.
</action> </action>

View File

@ -196,8 +196,8 @@ public class IterableUtils {
* corresponding input iterator supports it. * corresponding input iterator supports it.
* *
* @param <E> the element type * @param <E> the element type
* @param a the first iterable, may not be null * @param a the first iterable, must not be null
* @param b the second iterable, may not be null * @param b the second iterable, must not be null
* @return a filtered view on the specified iterable * @return a filtered view on the specified iterable
* @throws NullPointerException if either of the provided iterables is null * @throws NullPointerException if either of the provided iterables is null
*/ */
@ -603,7 +603,7 @@ public class IterableUtils {
* *
* @param <E> the element type * @param <E> the element type
* @param iterable the iterable to search, may be null * @param iterable the iterable to search, may be null
* @param predicate the predicate to use, may not be null * @param predicate the predicate to use, must not be null
* @return the first element of the iterable which matches the predicate or null if none could be found * @return the first element of the iterable which matches the predicate or null if none could be found
* @throws NullPointerException if predicate is null * @throws NullPointerException if predicate is null
*/ */
@ -619,7 +619,7 @@ public class IterableUtils {
* *
* @param <E> the element type * @param <E> the element type
* @param iterable the iterable to search, may be null * @param iterable the iterable to search, may be null
* @param predicate the predicate to use, may not be null * @param predicate the predicate to use, must not be null
* @return the index of the first element which matches the predicate or -1 if none matches * @return the index of the first element which matches the predicate or -1 if none matches
* @throws NullPointerException if predicate is null * @throws NullPointerException if predicate is null
*/ */

View File

@ -1211,7 +1211,7 @@ public class IteratorUtils {
* *
* @param <E> the element type * @param <E> the element type
* @param iterator the iterator to search, may be null * @param iterator the iterator to search, may be null
* @param predicate the predicate to use, may not be null * @param predicate the predicate to use, must not be null
* @return the first element of the iterator which matches the predicate or null if none could be found * @return the first element of the iterator which matches the predicate or null if none could be found
* @throws NullPointerException if predicate is null * @throws NullPointerException if predicate is null
* @since 4.1 * @since 4.1

View File

@ -274,7 +274,7 @@ public class IterableUtilsTest {
assertTrue(test == null); assertTrue(test == null);
assertNull(IterableUtils.find(null,testPredicate)); assertNull(IterableUtils.find(null,testPredicate));
try { try {
assertNull(IterableUtils.find(iterableA, null)); IterableUtils.find(iterableA, null);
fail("expecting NullPointerException"); fail("expecting NullPointerException");
} catch (final NullPointerException npe) { } catch (final NullPointerException npe) {
// expected // expected