diff --git a/src/changes/changes.xml b/src/changes/changes.xml index 2e2f1ae55..3ac3a78c2 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -21,6 +21,9 @@ + + Remove the redundant assertNull in IterableUtilsTest.find and update Javadocs. + Simplify two remove-if loops #77. diff --git a/src/main/java/org/apache/commons/collections4/IterableUtils.java b/src/main/java/org/apache/commons/collections4/IterableUtils.java index 0e3bcb444..55c31239b 100644 --- a/src/main/java/org/apache/commons/collections4/IterableUtils.java +++ b/src/main/java/org/apache/commons/collections4/IterableUtils.java @@ -196,8 +196,8 @@ public class IterableUtils { * corresponding input iterator supports it. * * @param the element type - * @param a the first iterable, may not be null - * @param b the second iterable, may not be null + * @param a the first iterable, must not be null + * @param b the second iterable, must not be null * @return a filtered view on the specified iterable * @throws NullPointerException if either of the provided iterables is null */ @@ -603,7 +603,7 @@ public class IterableUtils { * * @param the element type * @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 * @throws NullPointerException if predicate is null */ @@ -619,7 +619,7 @@ public class IterableUtils { * * @param the element type * @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 * @throws NullPointerException if predicate is null */ diff --git a/src/main/java/org/apache/commons/collections4/IteratorUtils.java b/src/main/java/org/apache/commons/collections4/IteratorUtils.java index bf389be03..bf3779f65 100644 --- a/src/main/java/org/apache/commons/collections4/IteratorUtils.java +++ b/src/main/java/org/apache/commons/collections4/IteratorUtils.java @@ -1211,7 +1211,7 @@ public class IteratorUtils { * * @param the element type * @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 * @throws NullPointerException if predicate is null * @since 4.1 diff --git a/src/test/java/org/apache/commons/collections4/IterableUtilsTest.java b/src/test/java/org/apache/commons/collections4/IterableUtilsTest.java index 3cfb0e910..dbe83cacc 100644 --- a/src/test/java/org/apache/commons/collections4/IterableUtilsTest.java +++ b/src/test/java/org/apache/commons/collections4/IterableUtilsTest.java @@ -274,7 +274,7 @@ public class IterableUtilsTest { assertTrue(test == null); assertNull(IterableUtils.find(null,testPredicate)); try { - assertNull(IterableUtils.find(iterableA, null)); + IterableUtils.find(iterableA, null); fail("expecting NullPointerException"); } catch (final NullPointerException npe) { // expected