Replace lambdas with method references

Closes gh-9049
pull/75/merge
Eddú Meléndez 8 years ago committed by Stephane Nicoll
parent d46591f141
commit 1d9fa8395c

@ -108,7 +108,7 @@ public class FlywayAutoConfiguration {
this.flywayDataSource = flywayDataSource.getIfAvailable(); this.flywayDataSource = flywayDataSource.getIfAvailable();
this.migrationStrategy = migrationStrategy.getIfAvailable(); this.migrationStrategy = migrationStrategy.getIfAvailable();
this.flywayCallbacks = flywayCallbacks this.flywayCallbacks = flywayCallbacks
.getIfAvailable(() -> Collections.emptyList()); .getIfAvailable(Collections::emptyList);
} }
@PostConstruct @PostConstruct

@ -30,6 +30,7 @@ import org.springframework.context.annotation.Configuration;
* {@link EnableAutoConfiguration Auto-configuration} for Reactor Core. * {@link EnableAutoConfiguration Auto-configuration} for Reactor Core.
* *
* @author Brian Clozel * @author Brian Clozel
* @author Eddú Meléndez
*/ */
@Configuration @Configuration
@ConditionalOnClass({ Mono.class, Flux.class }) @ConditionalOnClass({ Mono.class, Flux.class })
@ -39,7 +40,7 @@ public class ReactorCoreAutoConfiguration {
@Autowired @Autowired
protected void initialize(ReactorCoreProperties properties) { protected void initialize(ReactorCoreProperties properties) {
if (properties.getStacktraceMode().isEnabled()) { 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) { ObjectProvider<Collection<IDialect>> dialectsProvider) {
this.templateResolvers = templateResolvers; this.templateResolvers = templateResolvers;
this.dialects = dialectsProvider this.dialects = dialectsProvider
.getIfAvailable(() -> Collections.emptyList()); .getIfAvailable(Collections::emptyList);
} }
@Bean @Bean
@ -222,7 +222,7 @@ public class ThymeleafAutoConfiguration {
ObjectProvider<Collection<IDialect>> dialectsProvider) { ObjectProvider<Collection<IDialect>> dialectsProvider) {
this.templateResolvers = templateResolvers; this.templateResolvers = templateResolvers;
this.dialects = dialectsProvider this.dialects = dialectsProvider
.getIfAvailable(() -> Collections.emptyList()); .getIfAvailable(Collections::emptyList);
} }
@Bean @Bean

@ -73,6 +73,7 @@ import org.springframework.web.reactive.result.view.ViewResolver;
* @author Stephane Nicoll * @author Stephane Nicoll
* @author Andy Wilkinson * @author Andy Wilkinson
* @author Phillip Webb * @author Phillip Webb
* @author Eddú Meléndez
* @since 2.0.0 * @since 2.0.0
*/ */
@Configuration @Configuration
@ -157,7 +158,7 @@ public class WebFluxAutoConfiguration {
public void configureViewResolvers(ViewResolverRegistry registry) { public void configureViewResolvers(ViewResolverRegistry registry) {
if (this.viewResolvers != null) { if (this.viewResolvers != null) {
AnnotationAwareOrderComparator.sort(this.viewResolvers); 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 Phillip Webb
* @author Madhura Bhave * @author Madhura Bhave
* @author Eddú Meléndez
*/ */
public abstract class AbstractPropertyMapperTests { public abstract class AbstractPropertyMapperTests {
@ -52,7 +53,7 @@ public abstract class AbstractPropertyMapperTests {
PropertySource<?> propertySource = new MapPropertySource("test", PropertySource<?> propertySource = new MapPropertySource("test",
Collections.singletonMap(name, value)); Collections.singletonMap(name, value));
return getMapper().map(propertySource, ConfigurationPropertyName.of(name)) 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 Phillip Webb
* @author Madhura Bhave * @author Madhura Bhave
* @author Eddú Meléndez
*/ */
public class ConfigurationPropertyNameTests { public class ConfigurationPropertyNameTests {
@ -235,7 +236,7 @@ public class ConfigurationPropertyNameTests {
} }
private Iterator<String> streamElements(String name) { private Iterator<String> streamElements(String name) {
return ConfigurationPropertyName.of(name).stream().map((e) -> e.toString()) return ConfigurationPropertyName.of(name).stream().map(Element::toString)
.iterator(); .iterator();
} }

Loading…
Cancel
Save