Skip to content

Commit 07bc5f2

Browse files
committed
Polish "Remove redundant null check for sorter"
See gh-43343
1 parent bd36780 commit 07bc5f2

File tree

1 file changed

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

1 file changed

+2
-3
lines changed

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

+2-3
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);
95-
this.sorter = sorter;
93+
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)