Skip to content

Commit

Permalink
Replace lambdas with method references
Browse files Browse the repository at this point in the history
  • Loading branch information
eddumelendez authored and snicoll committed May 3, 2017
1 parent d46591f commit 1d9fa83
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public FlywayConfiguration(FlywayProperties properties,
this.flywayDataSource = flywayDataSource.getIfAvailable();
this.migrationStrategy = migrationStrategy.getIfAvailable();
this.flywayCallbacks = flywayCallbacks
.getIfAvailable(() -> Collections.emptyList());
.getIfAvailable(Collections::emptyList);
}

@PostConstruct
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
* {@link EnableAutoConfiguration Auto-configuration} for Reactor Core.
*
* @author Brian Clozel
* @author Eddú Meléndez
*/
@Configuration
@ConditionalOnClass({ Mono.class, Flux.class })
Expand All @@ -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);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public ThymeleafDefaultConfiguration(
ObjectProvider<Collection<IDialect>> dialectsProvider) {
this.templateResolvers = templateResolvers;
this.dialects = dialectsProvider
.getIfAvailable(() -> Collections.emptyList());
.getIfAvailable(Collections::emptyList);
}

@Bean
Expand Down Expand Up @@ -222,7 +222,7 @@ static class ThymeleafReactiveConfiguration {
ObjectProvider<Collection<IDialect>> dialectsProvider) {
this.templateResolvers = templateResolvers;
this.dialects = dialectsProvider
.getIfAvailable(() -> Collections.emptyList());
.getIfAvailable(Collections::emptyList);
}

@Bean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
* @author Stephane Nicoll
* @author Andy Wilkinson
* @author Phillip Webb
* @author Eddú Meléndez
* @since 2.0.0
*/
@Configuration
Expand Down Expand Up @@ -157,7 +158,7 @@ public void addResourceHandlers(ResourceHandlerRegistry registry) {
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);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
*
* @author Phillip Webb
* @author Madhura Bhave
* @author Eddú Meléndez
*/
public abstract class AbstractPropertyMapperTests {

Expand All @@ -52,7 +53,7 @@ protected final Iterator<String> namesFromConfiguration(String name, String valu
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();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
*
* @author Phillip Webb
* @author Madhura Bhave
* @author Eddú Meléndez
*/
public class ConfigurationPropertyNameTests {

Expand Down Expand Up @@ -235,7 +236,7 @@ public void streamShouldReturnElements() throws Exception {
}

private Iterator<String> streamElements(String name) {
return ConfigurationPropertyName.of(name).stream().map((e) -> e.toString())
return ConfigurationPropertyName.of(name).stream().map(Element::toString)
.iterator();
}

Expand Down

0 comments on commit 1d9fa83

Please sign in to comment.