Skip to content

Commit a93055c

Browse files
committed
Merge pull request #43343 from Jae-Young98
* pr/43343: Polish "Remove redundant null check for sorter" Remove redundant null check for sorter Closes gh-43343
2 parents 5e33808 + 07bc5f2 commit a93055c

File tree

1 file changed

+1
-2
lines changed
  • spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/annotation

1 file changed

+1
-2
lines changed

Diff for: spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/annotation/Configurations.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,8 @@ protected Configurations(Collection<Class<?>> classes) {
9090
protected Configurations(UnaryOperator<Collection<Class<?>>> sorter, Collection<Class<?>> classes,
9191
Function<Class<?>, String> beanNameGenerator) {
9292
Assert.notNull(classes, "Classes must not be null");
93-
sorter = (sorter != null) ? sorter : UnaryOperator.identity();
94-
Collection<Class<?>> sorted = sorter.apply(classes);
9593
this.sorter = (sorter != null) ? sorter : UnaryOperator.identity();
94+
Collection<Class<?>> sorted = this.sorter.apply(classes);
9695
this.classes = Collections.unmodifiableSet(new LinkedHashSet<>(sorted));
9796
this.beanNameGenerator = beanNameGenerator;
9897
}

0 commit comments

Comments
 (0)