Replace lambdas with method references

Closes gh-9049
This commit is contained in:
Eddú Meléndez
2017-04-30 00:26:29 -05:00
committed by Stephane Nicoll
parent d46591f141
commit 1d9fa8395c
6 changed files with 11 additions and 7 deletions

View File

@@ -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

View File

@@ -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);
}
}

View File

@@ -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

View File

@@ -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);
}
}