Refactor iterator of Map with Java8's Map.forEach
See gh-1459
This commit is contained in:
@@ -225,12 +225,8 @@ public class JmsListenerAnnotationBeanPostProcessor
|
||||
}
|
||||
else {
|
||||
// Non-empty set of methods
|
||||
for (Map.Entry<Method, Set<JmsListener>> entry : annotatedMethods.entrySet()) {
|
||||
Method method = entry.getKey();
|
||||
for (JmsListener listener : entry.getValue()) {
|
||||
processJmsListener(listener, method, bean);
|
||||
}
|
||||
}
|
||||
annotatedMethods.forEach((method, listeners) ->
|
||||
listeners.forEach(listener -> processJmsListener(listener, method, bean)));
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug(annotatedMethods.size() + " @JmsListener methods processed on bean '" + beanName +
|
||||
"': " + annotatedMethods);
|
||||
|
||||
@@ -158,12 +158,10 @@ public class MappingJackson2MessageConverter implements SmartMessageConverter, B
|
||||
*/
|
||||
public void setTypeIdMappings(Map<String, Class<?>> typeIdMappings) {
|
||||
this.idClassMappings = new HashMap<>();
|
||||
for (Map.Entry<String, Class<?>> entry : typeIdMappings.entrySet()) {
|
||||
String id = entry.getKey();
|
||||
Class<?> clazz = entry.getValue();
|
||||
typeIdMappings.forEach((id, clazz) -> {
|
||||
this.idClassMappings.put(id, clazz);
|
||||
this.classIdMappings.put(clazz, id);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user