Commit 4857b45e authored by dreis2211's avatar dreis2211 Committed by Stephane Nicoll

Replace lambdas with method reference or call

Closes gh-14937
parent eb61b2bb
...@@ -123,8 +123,7 @@ public class ConditionsReportEndpoint { ...@@ -123,8 +123,7 @@ public class ConditionsReportEndpoint {
this.negativeMatches = new LinkedHashMap<>(); this.negativeMatches = new LinkedHashMap<>();
this.exclusions = report.getExclusions(); this.exclusions = report.getExclusions();
this.unconditionalClasses = report.getUnconditionalClasses(); this.unconditionalClasses = report.getUnconditionalClasses();
report.getConditionAndOutcomesBySource().forEach( report.getConditionAndOutcomesBySource().forEach(this::add);
(source, conditionAndOutcomes) -> add(source, conditionAndOutcomes));
this.parentId = (context.getParent() != null) ? context.getParent().getId() this.parentId = (context.getParent() != null) ? context.getParent().getId()
: null; : null;
} }
......
...@@ -26,6 +26,7 @@ import java.util.Map; ...@@ -26,6 +26,7 @@ import java.util.Map;
import java.util.Objects; import java.util.Objects;
import java.util.Set; import java.util.Set;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function;
import java.util.function.Supplier; import java.util.function.Supplier;
import java.util.stream.Collectors; import java.util.stream.Collectors;
...@@ -147,7 +148,7 @@ public abstract class EndpointDiscoverer<E extends ExposableEndpoint<O>, O exten ...@@ -147,7 +148,7 @@ public abstract class EndpointDiscoverer<E extends ExposableEndpoint<O>, O exten
private void addExtensionBeans(Collection<EndpointBean> endpointBeans) { private void addExtensionBeans(Collection<EndpointBean> endpointBeans) {
Map<EndpointId, EndpointBean> byId = endpointBeans.stream() Map<EndpointId, EndpointBean> byId = endpointBeans.stream()
.collect(Collectors.toMap(EndpointBean::getId, (bean) -> bean)); .collect(Collectors.toMap(EndpointBean::getId, Function.identity()));
String[] beanNames = BeanFactoryUtils.beanNamesForAnnotationIncludingAncestors( String[] beanNames = BeanFactoryUtils.beanNamesForAnnotationIncludingAncestors(
this.applicationContext, EndpointExtension.class); this.applicationContext, EndpointExtension.class);
for (String beanName : beanNames) { for (String beanName : beanNames) {
......
...@@ -49,7 +49,7 @@ public interface PathMapper { ...@@ -49,7 +49,7 @@ public interface PathMapper {
*/ */
@Deprecated @Deprecated
static PathMapper useEndpointId() { static PathMapper useEndpointId() {
return (id) -> id.toString(); return EndpointId::toString;
} }
/** /**
......
...@@ -80,8 +80,7 @@ public class CassandraAutoConfiguration { ...@@ -80,8 +80,7 @@ public class CassandraAutoConfiguration {
map.from(this::getSocketOptions).to(builder::withSocketOptions); map.from(this::getSocketOptions).to(builder::withSocketOptions);
map.from(properties::isSsl).whenTrue().toCall(builder::withSSL); map.from(properties::isSsl).whenTrue().toCall(builder::withSSL);
map.from(this::getPoolingOptions).to(builder::withPoolingOptions); map.from(this::getPoolingOptions).to(builder::withPoolingOptions);
map.from(properties::getContactPoints) map.from(properties::getContactPoints).as(StringUtils::toStringArray)
.as((list) -> StringUtils.toStringArray(list))
.to(builder::addContactPoints); .to(builder::addContactPoints);
map.from(properties::isJmxEnabled).whenFalse() map.from(properties::isJmxEnabled).whenFalse()
.toCall(builder::withoutJMXReporting); .toCall(builder::withoutJMXReporting);
......
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