diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/annotation/Configurations.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/annotation/Configurations.java index b00121071f26..84b137cf176f 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/annotation/Configurations.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/annotation/Configurations.java @@ -92,7 +92,7 @@ protected Configurations(UnaryOperator>> sorter, Collection< Assert.notNull(classes, "Classes must not be null"); sorter = (sorter != null) ? sorter : UnaryOperator.identity(); Collection> sorted = sorter.apply(classes); - this.sorter = (sorter != null) ? sorter : UnaryOperator.identity(); + this.sorter = sorter; this.classes = Collections.unmodifiableSet(new LinkedHashSet<>(sorted)); this.beanNameGenerator = beanNameGenerator; }