Polish: Lambdas should be replaced with method references

This commit is contained in:
igor-suhorukov
2018-02-10 02:43:13 +03:00
committed by Juergen Hoeller
parent d3a1d44864
commit 6ea0af3540
9 changed files with 15 additions and 14 deletions

View File

@@ -18,6 +18,7 @@ package org.springframework.web.reactive.config;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.function.Function;
import java.util.stream.Collectors;
@@ -101,7 +102,7 @@ public class WebFluxConfigurerComposite implements WebFluxConfigurer {
@Nullable
private <T> T createSingleBean(Function<WebFluxConfigurer, T> factory, Class<T> beanType) {
List<T> result = this.delegates.stream().map(factory).filter(t -> t != null).collect(Collectors.toList());
List<T> result = this.delegates.stream().map(factory).filter(Objects::nonNull).collect(Collectors.toList());
if (result.isEmpty()) {
return null;
}