Use lambdas for map entry iteration where possible
See gh-12626
This commit is contained in:
committed by
Phillip Webb
parent
78a94cafe1
commit
69bc19e0ca
@@ -123,15 +123,14 @@ public class ConditionsReportEndpoint {
|
||||
this.negativeMatches = new LinkedHashMap<>();
|
||||
this.exclusions = report.getExclusions();
|
||||
this.unconditionalClasses = report.getUnconditionalClasses();
|
||||
for (Map.Entry<String, ConditionAndOutcomes> entry : report
|
||||
.getConditionAndOutcomesBySource().entrySet()) {
|
||||
if (entry.getValue().isFullMatch()) {
|
||||
add(this.positiveMatches, entry.getKey(), entry.getValue());
|
||||
report.getConditionAndOutcomesBySource().forEach((key, value) -> {
|
||||
if (value.isFullMatch()) {
|
||||
add(this.positiveMatches, key, value);
|
||||
}
|
||||
else {
|
||||
add(this.negativeMatches, entry.getKey(), entry.getValue());
|
||||
add(this.negativeMatches, key, value);
|
||||
}
|
||||
}
|
||||
});
|
||||
this.parentId = context.getParent() == null ? null
|
||||
: context.getParent().getId();
|
||||
}
|
||||
|
||||
@@ -44,10 +44,7 @@ public abstract class CompositeHealthIndicatorConfiguration<H extends HealthIndi
|
||||
}
|
||||
CompositeHealthIndicator composite = new CompositeHealthIndicator(
|
||||
this.healthAggregator);
|
||||
for (Map.Entry<String, S> entry : beans.entrySet()) {
|
||||
composite.addHealthIndicator(entry.getKey(),
|
||||
createHealthIndicator(entry.getValue()));
|
||||
}
|
||||
beans.forEach((key, value) -> composite.addHealthIndicator(key, createHealthIndicator(value)));
|
||||
return composite;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,10 +43,7 @@ public abstract class CompositeReactiveHealthIndicatorConfiguration<H extends Re
|
||||
}
|
||||
CompositeReactiveHealthIndicator composite = new CompositeReactiveHealthIndicator(
|
||||
this.healthAggregator);
|
||||
for (Map.Entry<String, S> entry : beans.entrySet()) {
|
||||
composite.addHealthIndicator(entry.getKey(),
|
||||
createHealthIndicator(entry.getValue()));
|
||||
}
|
||||
beans.forEach((key, value) -> composite.addHealthIndicator(key, createHealthIndicator(value)));
|
||||
return composite;
|
||||
}
|
||||
|
||||
|
||||
@@ -84,11 +84,11 @@ public class DataSourceHealthIndicatorAutoConfiguration extends
|
||||
return null;
|
||||
}
|
||||
Map<String, DataSource> dataSources = new LinkedHashMap<>();
|
||||
for (Map.Entry<String, DataSource> entry : candidates.entrySet()) {
|
||||
if (!(entry.getValue() instanceof AbstractRoutingDataSource)) {
|
||||
dataSources.put(entry.getKey(), entry.getValue());
|
||||
candidates.forEach((key, value) -> {
|
||||
if (!(value instanceof AbstractRoutingDataSource)) {
|
||||
dataSources.put(key, value);
|
||||
}
|
||||
}
|
||||
});
|
||||
return dataSources;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user