Skip to content

Commit 8380031

Browse files
CHANMYUNGsnicoll
authored andcommitted
Simplify ArrayList calling addAll() immediately
Closes gh-15033
1 parent 62782e5 commit 8380031

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,8 +1304,7 @@ private static void close(ApplicationContext context) {
13041304
}
13051305

13061306
private static <E> Set<E> asUnmodifiableOrderedSet(Collection<E> elements) {
1307-
List<E> list = new ArrayList<>();
1308-
list.addAll(elements);
1307+
List<E> list = new ArrayList<>(elements);
13091308
list.sort(AnnotationAwareOrderComparator.INSTANCE);
13101309
return new LinkedHashSet<>(list);
13111310
}

0 commit comments

Comments
 (0)