commit
304a1bf3f3
|
@ -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">
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue