-
2022.5.6
- private static Map<String, List<String>> loadSpringFactories(ClassLoader classLoader) {
- Map<String, List<String>> result = (Map)cache.get(classLoader);
- if (result != null) {
- return result;
- } else {
- HashMap result = new HashMap();
- try {
- Enumeration urls = classLoader.getResources("META-INF/spring.factories");
- while(urls.hasMoreElements()) {
- URL url = (URL)urls.nextElement();
- UrlResource resource = new UrlResource(url);
- Properties properties = PropertiesLoaderUtils.loadProperties(resource);
- Iterator var6 = properties.entrySet().iterator();
- while(var6.hasNext()) {
- Map.Entry<?, ?> entry = (Map.Entry)var6.next();
- String factoryTypeName = ((String)entry.getKey()).trim();
- String[] factoryImplementationNames = StringUtils.commaDelimitedListToStringArray((String)entry.getValue());
- String[] var10 = factoryImplementationNames;
- int var11 = factoryImplementationNames.length;
- for(int var12 = 0; var12 < var11; ++var12) {
- String factoryImplementationName = var10[var12];
- ((List)result.computeIfAbsent(factoryTypeName, (key) -> {
- return new ArrayList();
- })).add(factoryImplementationName.trim());
- }
- }
- }
- result.replaceAll((factoryType, implementations) -> {
- return (List)implementations.stream().distinct().collect(Collectors.collectingAndThen(Collectors.toList(), Collections::unmodifiableList));
- });
- cache.put(classLoader, result);
- return result;
- } catch (IOException var14) {
- throw new IllegalArgumentException("Unable to load factories from location [META-INF/spring.factories]", var14);
- }
- }
- }
-
相关阅读:
php json_encode怪问题
给phpcms v9添加热门搜索关键词
magento 1.6 后台无法登录解决办法
08 baidu QA
java exception
java thread / process / thread runnable / thread sleep / thread run
java reflect
db sysbase
内存单元
分段的方式来管理内存
-
原文地址:https://www.cnblogs.com/qiangini/p/15808465.html
Copyright © 2020-2023
润新知