Merge pull request #24636 from chenqimiao

* pr/24636:
  Update copyright year of changed file
  Use Collections.addAll instead of Collection.addAll

Closes gh-24636
This commit is contained in:
Stephane Nicoll 2021-12-21 09:50:09 +01:00
commit f64ede3c83
1 changed files with 2 additions and 4 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright 2002-2020 the original author or authors.
* Copyright 2002-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -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);
}
/**