Browse Source

Fix Java 17 compiler warning about varargs

pull/28188/head
Sam Brannen 3 years ago
parent
commit
65066bd1e1
  1. 1
      spring-beans/src/main/java/org/springframework/beans/factory/support/ManagedList.java
  2. 1
      spring-beans/src/main/java/org/springframework/beans/factory/support/ManagedSet.java

1
spring-beans/src/main/java/org/springframework/beans/factory/support/ManagedList.java

@ -64,6 +64,7 @@ public class ManagedList<E> extends ArrayList<E> implements Mergeable, BeanMetad @@ -64,6 +64,7 @@ public class ManagedList<E> extends ArrayList<E> implements Mergeable, BeanMetad
* @since 5.3.16
*/
@SafeVarargs
@SuppressWarnings("varargs")
public static <E> ManagedList<E> of(E... elements) {
ManagedList<E> list = new ManagedList<>();
Collections.addAll(list, elements);

1
spring-beans/src/main/java/org/springframework/beans/factory/support/ManagedSet.java

@ -63,6 +63,7 @@ public class ManagedSet<E> extends LinkedHashSet<E> implements Mergeable, BeanMe @@ -63,6 +63,7 @@ public class ManagedSet<E> extends LinkedHashSet<E> implements Mergeable, BeanMe
* @since 5.3.16
*/
@SafeVarargs
@SuppressWarnings("varargs")
public static <E> ManagedSet<E> of(E... elements) {
ManagedSet<E> set = new ManagedSet<>();
Collections.addAll(set, elements);

Loading…
Cancel
Save