Iteration over a map using EntrySet

This commit is contained in:
stsypanov
2019-05-13 14:27:01 +03:00
committed by Juergen Hoeller
parent 785e8d8116
commit 9ca8681f79
10 changed files with 45 additions and 36 deletions

View File

@@ -640,9 +640,10 @@ public abstract class AbstractMethodMessageHandler<T>
if (method != null) {
return new InvocableHandlerMethod(handlerMethod.getBean(), method);
}
for (MessagingAdviceBean advice : this.exceptionHandlerAdviceCache.keySet()) {
for (Map.Entry<MessagingAdviceBean, AbstractExceptionHandlerMethodResolver> entry : this.exceptionHandlerAdviceCache.entrySet()) {
MessagingAdviceBean advice = entry.getKey();
if (advice.isApplicableToBeanType(beanType)) {
resolver = this.exceptionHandlerAdviceCache.get(advice);
resolver = entry.getValue();
method = resolver.resolveMethod(exception);
if (method != null) {
return new InvocableHandlerMethod(advice.resolveBean(), method);

View File

@@ -155,9 +155,10 @@ class InvocableHelper {
exceptionHandlerMethod = new InvocableHandlerMethod(handlerMethod.getBean(), method);
}
else {
for (MessagingAdviceBean advice : this.exceptionHandlerAdviceCache.keySet()) {
for (Map.Entry<MessagingAdviceBean, AbstractExceptionHandlerMethodResolver> entry : this.exceptionHandlerAdviceCache.entrySet()) {
MessagingAdviceBean advice = entry.getKey();
if (advice.isApplicableToBeanType(beanType)) {
resolver = this.exceptionHandlerAdviceCache.get(advice);
resolver = entry.getValue();
method = resolver.resolveMethod(ex);
if (method != null) {
exceptionHandlerMethod = new InvocableHandlerMethod(advice.resolveBean(), method);