diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java index ecb3bbac9a..047cc2860b 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java @@ -1304,8 +1304,7 @@ public class SpringApplication { } private static Set asUnmodifiableOrderedSet(Collection elements) { - List list = new ArrayList<>(); - list.addAll(elements); + List list = new ArrayList<>(elements); list.sort(AnnotationAwareOrderComparator.INSTANCE); return new LinkedHashSet<>(list); }