Browse Source

Polish contribution

See gh-30271
pull/30283/head
Sam Brannen 3 years ago
parent
commit
02f2d94f57
  1. 8
      spring-core/src/main/java/org/springframework/core/io/support/SpringFactoriesLoader.java

8
spring-core/src/main/java/org/springframework/core/io/support/SpringFactoriesLoader.java

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

Loading…
Cancel
Save