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 17, 2024
1 parent 0553d70 commit 5a1bd65
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,11 @@ 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 5a1bd65

Please sign in to comment.