cn.hutool.core.collection.CollUtil#addAll(java.util.Collection<T>, java.lang.Iterable<T>) 判断空指针

This commit is contained in:
不忘初心 2020-12-09 18:27:01 +08:00 committed by Gitee
parent 5bb4ff9c40
commit 0ee10efa04

View File

@ -2108,7 +2108,7 @@ public class CollUtil {
* @return 原集合
*/
public static <T> Collection<T> addAll(Collection<T> collection, Iterable<T> iterable) {
if(iterable == null){
if (iterable == null) {
return collection;
}
return addAll(collection, iterable.iterator());