From 33428eb9eb9ea3a27574ee2b983dcd158518b5ae Mon Sep 17 00:00:00 2001 From: Pengyu Nie Date: Fri, 29 Nov 2019 11:15:44 -0600 Subject: [PATCH 1/4] [COLLECTIONS-738]: Remove the redundant assertNull in IterableUtilsTest.find. --- .../java/org/apache/commons/collections4/IterableUtilsTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From f6eba479b40e6dc9ac7be3ba1f0016c10e0cafc7 Mon Sep 17 00:00:00 2001 From: Pengyu Nie Date: Sat, 30 Nov 2019 16:23:51 -0600 Subject: [PATCH 2/4] [COLLECTIONS-738]: Update JavaDoc of {IterableUtils,IteratorUtils}.find to clarify the parameter predicate must not be null. --- .../java/org/apache/commons/collections4/IterableUtils.java | 2 +- .../java/org/apache/commons/collections4/IteratorUtils.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/apache/commons/collections4/IterableUtils.java b/src/main/java/org/apache/commons/collections4/IterableUtils.java index 0e3bcb444..019e353e8 100644 --- a/src/main/java/org/apache/commons/collections4/IterableUtils.java +++ b/src/main/java/org/apache/commons/collections4/IterableUtils.java @@ -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 */ 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 From 888058b629205141dd31aa3fa4cae8be94dde069 Mon Sep 17 00:00:00 2001 From: Pengyu Nie Date: Thu, 19 Dec 2019 13:29:40 -0600 Subject: [PATCH 3/4] [COLLECTIONS-738]: Javadoc update in IterableUtils. --- .../java/org/apache/commons/collections4/IterableUtils.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/apache/commons/collections4/IterableUtils.java b/src/main/java/org/apache/commons/collections4/IterableUtils.java index 019e353e8..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 */ @@ -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 */ From ea190a8ae3b2b537df5d3914eb3d3f74f310de3b Mon Sep 17 00:00:00 2001 From: "Bruno P. Kinoshita" Date: Thu, 9 Jan 2020 20:18:38 +1300 Subject: [PATCH 4/4] [COLLECTIONS-738]: add changes.xml entry --- src/changes/changes.xml | 3 +++ 1 file changed, 3 insertions(+) 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.