From 569138aa3a1b96bed173430656b4552fd6fdf6b3 Mon Sep 17 00:00:00 2001 From: Jae-Young98 Date: Mon, 2 Dec 2024 18:31:21 +0900 Subject: [PATCH] Refactor Remove redundant null check for sorter --- .../springframework/boot/context/annotation/Configurations.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; }