Use Map#forEach instead of Map#entrySet#forEach
See gh-1449
This commit is contained in:
@@ -265,10 +265,10 @@ public abstract class BeanFactoryUtils {
|
||||
if (hbf.getParentBeanFactory() instanceof ListableBeanFactory) {
|
||||
Map<String, T> parentResult = beansOfTypeIncludingAncestors(
|
||||
(ListableBeanFactory) hbf.getParentBeanFactory(), type);
|
||||
parentResult.entrySet().forEach(entry -> {
|
||||
String beanName = entry.getKey();
|
||||
|
||||
parentResult.forEach((beanName, beanType) -> {
|
||||
if (!result.containsKey(beanName) && !hbf.containsLocalBean(beanName)) {
|
||||
result.put(beanName, entry.getValue());
|
||||
result.put(beanName, beanType);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -314,11 +314,10 @@ public abstract class BeanFactoryUtils {
|
||||
if (hbf.getParentBeanFactory() instanceof ListableBeanFactory) {
|
||||
Map<String, T> parentResult = beansOfTypeIncludingAncestors(
|
||||
(ListableBeanFactory) hbf.getParentBeanFactory(), type, includeNonSingletons, allowEagerInit);
|
||||
|
||||
parentResult.entrySet().forEach(entry -> {
|
||||
String beanName = entry.getKey();
|
||||
|
||||
parentResult.forEach((beanName, beanType) -> {
|
||||
if (!result.containsKey(beanName) && !hbf.containsLocalBean(beanName)) {
|
||||
result.put(beanName, entry.getValue());
|
||||
result.put(beanName, beanType);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1187,12 +1187,11 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
|
||||
}
|
||||
}
|
||||
if (!this.customEditors.isEmpty()) {
|
||||
this.customEditors.entrySet().forEach(entry -> {
|
||||
Class<?> requiredType = entry.getKey();
|
||||
Class<? extends PropertyEditor> editorClass = entry.getValue();
|
||||
registry.registerCustomEditor(requiredType, BeanUtils.instantiateClass(editorClass));
|
||||
});
|
||||
}
|
||||
this.customEditors.forEach(
|
||||
(requiredType, editorClass)
|
||||
-> registry.registerCustomEditor(requiredType, BeanUtils.instantiateClass(editorClass))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user