Use Collections.addAll instead of Collection.addAll
See gh-24636
This commit is contained in:
parent
5532615361
commit
dbbdd044cd
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue