From 6806aaf162f396e89cc07735d399737c87bcd2a1 Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Thu, 11 Aug 2022 08:28:43 +0200 Subject: [PATCH] Polish "Add missing TreeSet to CollectionFactory.createCollection()" See gh-28949 --- .../main/java/org/springframework/core/CollectionFactory.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-core/src/main/java/org/springframework/core/CollectionFactory.java b/spring-core/src/main/java/org/springframework/core/CollectionFactory.java index 5a2bb2bb45..ffe3b58093 100644 --- a/spring-core/src/main/java/org/springframework/core/CollectionFactory.java +++ b/spring-core/src/main/java/org/springframework/core/CollectionFactory.java @@ -191,7 +191,8 @@ public final class CollectionFactory { else if (LinkedList.class == collectionType) { return new LinkedList<>(); } - else if (TreeSet.class == collectionType || SortedSet.class == collectionType || NavigableSet.class == collectionType) { + else if (TreeSet.class == collectionType || NavigableSet.class == collectionType + || SortedSet.class == collectionType) { return new TreeSet<>(); } else if (EnumSet.class.isAssignableFrom(collectionType)) {