Use Collections.addAll instead of Collection.addAll

See gh-24636
This commit is contained in:
陈其苗 2020-03-04 11:46:50 +08:00 committed by Stephane Nicoll
parent 5532615361
commit dbbdd044cd
1 changed files with 1 additions and 3 deletions

View File

@ -129,9 +129,7 @@ public abstract class CollectionUtils {
@SuppressWarnings("unchecked")
public static <E> void mergeArrayIntoCollection(@Nullable Object array, Collection<E> collection) {
Object[] arr = ObjectUtils.toObjectArray(array);
for (Object elem : arr) {
collection.add((E) elem);
}
Collections.addAll(collection, (E[])arr);
}
/**