Polish "Use Map#forEach instead of Map#entrySet#forEach"

Closes gh-1449
This commit is contained in:
Stephane Nicoll
2017-06-12 14:28:24 +02:00
parent 2efa06237a
commit 451b419624
5 changed files with 13 additions and 21 deletions

View File

@@ -265,7 +265,6 @@ public abstract class BeanFactoryUtils {
if (hbf.getParentBeanFactory() instanceof ListableBeanFactory) {
Map<String, T> parentResult = beansOfTypeIncludingAncestors(
(ListableBeanFactory) hbf.getParentBeanFactory(), type);
parentResult.forEach((beanName, beanType) -> {
if (!result.containsKey(beanName) && !hbf.containsLocalBean(beanName)) {
result.put(beanName, beanType);
@@ -314,7 +313,6 @@ public abstract class BeanFactoryUtils {
if (hbf.getParentBeanFactory() instanceof ListableBeanFactory) {
Map<String, T> parentResult = beansOfTypeIncludingAncestors(
(ListableBeanFactory) hbf.getParentBeanFactory(), type, includeNonSingletons, allowEagerInit);
parentResult.forEach((beanName, beanType) -> {
if (!result.containsKey(beanName) && !hbf.containsLocalBean(beanName)) {
result.put(beanName, beanType);

View File

@@ -1187,11 +1187,9 @@ public abstract class AbstractBeanFactory extends FactoryBeanRegistrySupport imp
}
}
if (!this.customEditors.isEmpty()) {
this.customEditors.forEach(
(requiredType, editorClass)
-> registry.registerCustomEditor(requiredType, BeanUtils.instantiateClass(editorClass))
);
}
this.customEditors.forEach((requiredType, editorClass) ->
registry.registerCustomEditor(requiredType, BeanUtils.instantiateClass(editorClass)));
}
}