Skip to content

Commit

Permalink
fix async method call ClassCastException error
Browse files Browse the repository at this point in the history
  • Loading branch information
FoghostCn committed Mar 18, 2024
1 parent 0553d70 commit 352f53a
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,12 @@ public Result invoke(Invocation invocation) throws RpcException {
invocation instanceof RpcInvocation ? ((RpcInvocation) invocation).getInvokeMode() : null);
copiedInvocation.setObjectAttachment(CommonConstants.GROUP_KEY, protocolServiceKey.getGroup());
copiedInvocation.setObjectAttachment(CommonConstants.VERSION_KEY, protocolServiceKey.getVersion());
// When there are multiple MethodDescriptors with the same method name, the return type will be wrong
// same with org.apache.dubbo.rpc.stub.StubInvocationUtil.call
// fix https://github.com/apache/dubbo/issues/13931
if (invocation instanceof RpcInvocation) {
copiedInvocation.setReturnType(((RpcInvocation) invocation).getReturnType());
}
return originInvoker.invoke(copiedInvocation);
}

Expand Down

0 comments on commit 352f53a

Please sign in to comment.