You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ki...@apache.org on 2022/10/19 02:12:51 UTC
[commons-collections] branch master updated (06cc4554b -> 304a1bf3f)
This is an automated email from the ASF dual-hosted git repository.
kinow pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/commons-collections.git
from 06cc4554b Merge branch 'pr-325'
new 17bed2b55 [COLLECTIONS-814] CollectionUtils.removeAll() not throwing proper NullPointerException(NPE) if the first parameter is empty
new 8c91a5154 [COLLECTIONS-814] Add change log
new 304a1bf3f Merge branch 'pr-340'
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
src/changes/changes.xml | 5 ++++-
src/main/java/org/apache/commons/collections4/ListUtils.java | 2 ++
src/test/java/org/apache/commons/collections4/ListUtilsTest.java | 6 ++++++
3 files changed, 12 insertions(+), 1 deletion(-)
[commons-collections] 01/03: [COLLECTIONS-814] CollectionUtils.removeAll() not throwing proper NullPointerException(NPE) if the first parameter is empty
Posted by ki...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
kinow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-collections.git
commit 17bed2b5551c6489264d47e1009f45c27236f71c
Author: Angus <an...@gmail.com>
AuthorDate: Sat Sep 24 21:32:53 2022 +0100
[COLLECTIONS-814] CollectionUtils.removeAll() not throwing proper NullPointerException(NPE) if the first parameter is empty
Add null check
---
src/main/java/org/apache/commons/collections4/ListUtils.java | 2 ++
src/test/java/org/apache/commons/collections4/ListUtilsTest.java | 6 ++++++
2 files changed, 8 insertions(+)
diff --git a/src/main/java/org/apache/commons/collections4/ListUtils.java b/src/main/java/org/apache/commons/collections4/ListUtils.java
index e62a72f08..274e2b50a 100644
--- a/src/main/java/org/apache/commons/collections4/ListUtils.java
+++ b/src/main/java/org/apache/commons/collections4/ListUtils.java
@@ -533,6 +533,8 @@ public class ListUtils {
* @since 3.2
*/
public static <E> List<E> removeAll(final Collection<E> collection, final Collection<?> remove) {
+ Objects.requireNonNull(collection, "collection");
+ Objects.requireNonNull(remove, "remove");
final List<E> list = new ArrayList<>();
for (final E obj : collection) {
if (!remove.contains(obj)) {
diff --git a/src/test/java/org/apache/commons/collections4/ListUtilsTest.java b/src/test/java/org/apache/commons/collections4/ListUtilsTest.java
index b22f177ef..12d552584 100644
--- a/src/test/java/org/apache/commons/collections4/ListUtilsTest.java
+++ b/src/test/java/org/apache/commons/collections4/ListUtilsTest.java
@@ -369,6 +369,12 @@ public class ListUtilsTest {
assertThrows(NullPointerException.class, () -> ListUtils.removeAll(null, null),
"expecting NullPointerException");
+
+ assertThrows(NullPointerException.class, () -> ListUtils.removeAll(null, new ArrayList<Object>()),
+ "expecting NullPointerException");
+
+ assertThrows(NullPointerException.class, () -> ListUtils.removeAll(new ArrayList<Object>(), null),
+ "expecting NullPointerException");
}
@Test
[commons-collections] 02/03: [COLLECTIONS-814] Add change log
Posted by ki...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
kinow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-collections.git
commit 8c91a515467826ab1b75b516cea7c6a3303e590d
Author: Bruno P. Kinoshita <ki...@users.noreply.github.com>
AuthorDate: Wed Oct 19 15:09:21 2022 +1300
[COLLECTIONS-814] Add change log
---
src/changes/changes.xml | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index 096e732c8..f30cdb9e6 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -98,7 +98,10 @@
Fix flaky EmptyPropertiesTest#testSave.
</action>
<action type="fix" dev="ggregory" due-to="Steve Bosman">
- Use java.lang.Objects#equals; eliminate a couple of nulls #307
+ Use java.lang.Objects#equals; eliminate a couple of nulls #307.
+ </action>
+ <action issue="COLLECTIONS-814" type="fix" dev="kinow" due-to="angusdev">
+ CollectionUtils.removeAll() not throwing NPE #340.
</action>
<!-- ADD -->
<action issue="COLLECTIONS-760" dev="kinow" type="add" due-to="Isira Seneviratne">
[commons-collections] 03/03: Merge branch 'pr-340'
Posted by ki...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
kinow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-collections.git
commit 304a1bf3f37abb1740e5a1a378b69aa8bd70acfe
Merge: 06cc4554b 8c91a5154
Author: Bruno P. Kinoshita <ki...@users.noreply.github.com>
AuthorDate: Wed Oct 19 15:09:53 2022 +1300
Merge branch 'pr-340'
This closes #340
src/changes/changes.xml | 5 ++++-
src/main/java/org/apache/commons/collections4/ListUtils.java | 2 ++
src/test/java/org/apache/commons/collections4/ListUtilsTest.java | 6 ++++++
3 files changed, 12 insertions(+), 1 deletion(-)