andymc12 commented on a change in pull request #656: Consolidate
getTargetMethod calls
URL: https://github.com/apache/cxf/pull/656#discussion_r399315562
##########
File path:
core/src/main/java/org/apache/cxf/validation/AbstractValidationInterceptor.java
##########
@@ -108,15 +107,7 @@ protected Method getServiceMethod(Message message) {
Message inMessage = message.getExchange().getInMessage();
Method method = null;
if (inMessage != null) {
- method = (Method)inMessage.get("org.apache.cxf.resource.method");
- if (method == null) {
- BindingOperationInfo bop =
inMessage.getExchange().getBindingOperationInfo();
- if (bop != null) {
- MethodDispatcher md = (MethodDispatcher)
-
inMessage.getExchange().getService().get(MethodDispatcher.class.getName());
- method = md.getMethod(bop);
- }
- }
+ method = MessageUtils.getTargetMethod(inMessage, null);
Review comment:
Good idea! I'll give the `Optional<Method>` approach a try. Thanks!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services