Simulant87 commented on a change in pull request #279:
URL:
https://github.com/apache/commons-collections/pull/279#discussion_r810532515
##########
File path: src/main/java/org/apache/commons/collections4/CollectionUtils.java
##########
@@ -419,16 +419,14 @@ private CollectionUtils() {}
* cost of an additional space complexity O(n).
* </p>
*
- * @param coll1 the first collection, must not be null
- * @param coll2 the second collection, must not be null
* @return {@code true} iff the intersection of the collections has the
same cardinality
* as the set of unique elements from the second collection
- * @throws NullPointerException if coll1 or coll2 is null
+ * @returns true if first and second collection is null
* @since 4.0
*/
public static boolean containsAll(final Collection<?> coll1, final
Collection<?> coll2) {
- Objects.requireNonNull(coll1, "coll1");
- Objects.requireNonNull(coll2, "coll2");
+ if (coll1 == null && coll2 == null) return true;
+
Review comment:
The code below will still throw a now no longer documented and expected
NullPointerException if coll1 if not null but coll2 is null.
It's the same thing for the change in the method below, and possible more, I
haven't read through the whole PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]