Avoid synthesizable annotation creation for @Bean/@Scope processing

Includes consistent (non-)use of AnnotationUtils/AnnotatedElementUtils.

Issue: SPR-16933
This commit is contained in:
Juergen Hoeller
2018-08-01 11:43:28 +02:00
parent 9b671f8408
commit 589b7048ec
6 changed files with 68 additions and 47 deletions

View File

@@ -192,7 +192,6 @@ public class SendToMethodReturnValueHandler implements HandlerMethodReturnValueH
}
private DestinationHelper getDestinationHelper(MessageHeaders headers, MethodParameter returnType) {
SendToUser m1 = AnnotatedElementUtils.findMergedAnnotation(returnType.getExecutable(), SendToUser.class);
SendTo m2 = AnnotatedElementUtils.findMergedAnnotation(returnType.getExecutable(), SendTo.class);
if ((m1 != null && !ObjectUtils.isEmpty(m1.value())) || (m2 != null && !ObjectUtils.isEmpty(m2.value()))) {
@@ -205,8 +204,8 @@ public class SendToMethodReturnValueHandler implements HandlerMethodReturnValueH
return new DestinationHelper(headers, c1, c2);
}
return m1 != null || m2 != null ?
new DestinationHelper(headers, m1, m2) : new DestinationHelper(headers, c1, c2);
return (m1 != null || m2 != null ?
new DestinationHelper(headers, m1, m2) : new DestinationHelper(headers, c1, c2));
}
@Nullable
@@ -291,9 +290,9 @@ public class SendToMethodReturnValueHandler implements HandlerMethodReturnValueH
return this.sendToUser;
}
public String expandTemplateVars(String destination) {
return placeholderHelper.replacePlaceholders(destination, this.placeholderResolver);
}
}
}