mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Merge branch '2.6.x' into 2.7.x
This commit is contained in:
commit
2382e8322b
@ -18,10 +18,10 @@ package org.springframework.boot.actuate.health;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
@ -43,8 +43,9 @@ abstract class NamedContributorsMapAdapter<V, C> implements NamedContributors<C>
|
||||
Assert.notNull(map, "Map must not be null");
|
||||
Assert.notNull(valueAdapter, "ValueAdapter must not be null");
|
||||
map.keySet().forEach(this::validateKey);
|
||||
this.map = Collections.unmodifiableMap(map.entrySet().stream()
|
||||
.collect(Collectors.toMap(Entry::getKey, (entry) -> adapt(entry.getValue(), valueAdapter))));
|
||||
this.map = Collections.unmodifiableMap(map.entrySet().stream().collect(LinkedHashMap::new,
|
||||
(result, entry) -> result.put(entry.getKey(), adapt(entry.getValue(), valueAdapter)), Map::putAll));
|
||||
|
||||
}
|
||||
|
||||
private void validateKey(String value) {
|
||||
|
Loading…
Reference in New Issue
Block a user