Commit 91ac9440 authored by Stephane Nicoll's avatar Stephane Nicoll

Merge pull request #9049 from eddumelendez:polish-lambdas

* pr/9049:
  Replace lambdas with method references
parents d46591f1 1d9fa839
......@@ -108,7 +108,7 @@ public class FlywayAutoConfiguration {
this.flywayDataSource = flywayDataSource.getIfAvailable();
this.migrationStrategy = migrationStrategy.getIfAvailable();
this.flywayCallbacks = flywayCallbacks
.getIfAvailable(() -> Collections.emptyList());
.getIfAvailable(Collections::emptyList);
}
@PostConstruct
......
......@@ -30,6 +30,7 @@ import org.springframework.context.annotation.Configuration;
* {@link EnableAutoConfiguration Auto-configuration} for Reactor Core.
*
* @author Brian Clozel
* @author Eddú Meléndez
*/
@Configuration
@ConditionalOnClass({ Mono.class, Flux.class })
......@@ -39,7 +40,7 @@ public class ReactorCoreAutoConfiguration {
@Autowired
protected void initialize(ReactorCoreProperties properties) {
if (properties.getStacktraceMode().isEnabled()) {
Hooks.onOperator(h -> h.operatorStacktrace());
Hooks.onOperator(Hooks.OperatorHook::operatorStacktrace);
}
}
......
......@@ -138,7 +138,7 @@ public class ThymeleafAutoConfiguration {
ObjectProvider<Collection<IDialect>> dialectsProvider) {
this.templateResolvers = templateResolvers;
this.dialects = dialectsProvider
.getIfAvailable(() -> Collections.emptyList());
.getIfAvailable(Collections::emptyList);
}
@Bean
......@@ -222,7 +222,7 @@ public class ThymeleafAutoConfiguration {
ObjectProvider<Collection<IDialect>> dialectsProvider) {
this.templateResolvers = templateResolvers;
this.dialects = dialectsProvider
.getIfAvailable(() -> Collections.emptyList());
.getIfAvailable(Collections::emptyList);
}
@Bean
......
......@@ -73,6 +73,7 @@ import org.springframework.web.reactive.result.view.ViewResolver;
* @author Stephane Nicoll
* @author Andy Wilkinson
* @author Phillip Webb
* @author Eddú Meléndez
* @since 2.0.0
*/
@Configuration
......@@ -157,7 +158,7 @@ public class WebFluxAutoConfiguration {
public void configureViewResolvers(ViewResolverRegistry registry) {
if (this.viewResolvers != null) {
AnnotationAwareOrderComparator.sort(this.viewResolvers);
this.viewResolvers.forEach(resolver -> registry.viewResolver(resolver));
this.viewResolvers.forEach(registry::viewResolver);
}
}
......
......@@ -27,6 +27,7 @@ import org.springframework.core.env.PropertySource;
*
* @author Phillip Webb
* @author Madhura Bhave
* @author Eddú Meléndez
*/
public abstract class AbstractPropertyMapperTests {
......@@ -52,7 +53,7 @@ public abstract class AbstractPropertyMapperTests {
PropertySource<?> propertySource = new MapPropertySource("test",
Collections.singletonMap(name, value));
return getMapper().map(propertySource, ConfigurationPropertyName.of(name))
.stream().map((mapping) -> mapping.getPropertySourceName()).iterator();
.stream().map(PropertyMapping::getPropertySourceName).iterator();
}
}
......@@ -37,6 +37,7 @@ import static org.assertj.core.api.Assertions.fail;
*
* @author Phillip Webb
* @author Madhura Bhave
* @author Eddú Meléndez
*/
public class ConfigurationPropertyNameTests {
......@@ -235,7 +236,7 @@ public class ConfigurationPropertyNameTests {
}
private Iterator<String> streamElements(String name) {
return ConfigurationPropertyName.of(name).stream().map((e) -> e.toString())
return ConfigurationPropertyName.of(name).stream().map(Element::toString)
.iterator();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment