Polish contribution

See gh-30271
This commit is contained in:
Sam Brannen 2023-04-03 16:45:42 +02:00
parent 7fcbc869a6
commit 02f2d94f57
1 changed files with 4 additions and 4 deletions

View File

@ -342,9 +342,9 @@ public class SpringFactoriesLoader {
Properties properties = PropertiesLoaderUtils.loadProperties(resource); Properties properties = PropertiesLoaderUtils.loadProperties(resource);
properties.forEach((name, value) -> { properties.forEach((name, value) -> {
String[] factoryImplementationNames = StringUtils.commaDelimitedListToStringArray((String) value); String[] factoryImplementationNames = StringUtils.commaDelimitedListToStringArray((String) value);
List<String> implementations = result.computeIfAbsent(((String) name).trim(), key -> new ArrayList<>(factoryImplementationNames.length)); List<String> implementations = result.computeIfAbsent(((String) name).trim(),
Arrays.stream(factoryImplementationNames) key -> new ArrayList<>(factoryImplementationNames.length));
.map(String::trim).forEach(implementations::add); Arrays.stream(factoryImplementationNames).map(String::trim).forEach(implementations::add);
}); });
} }
result.replaceAll(SpringFactoriesLoader::toDistinctUnmodifiableList); result.replaceAll(SpringFactoriesLoader::toDistinctUnmodifiableList);