You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by al...@apache.org on 2021/03/11 14:42:57 UTC
[dubbo] branch master updated: to fix something wrong with
MergeableClusterInvoker (#7360)
This is an automated email from the ASF dual-hosted git repository.
albumenj pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/master by this push:
new a588723 to fix something wrong with MergeableClusterInvoker (#7360)
a588723 is described below
commit a5887235f9a40b9bad4ac8c257db5511b80448ae
Author: zhangxin1932 <32...@users.noreply.github.com>
AuthorDate: Thu Mar 11 22:42:37 2021 +0800
to fix something wrong with MergeableClusterInvoker (#7360)
* as MergeableClusterInvoker was used, when 'resultList.size() == 1', the resultType of "resultList.iterator().next()" is AppResponse, which would throw an exception of UnsupportedOperationException
* as MergeableClusterInvoker was used, when 'resultList.size() == 1', the resultType of "resultList.iterator().next()" is AppResponse, which would throw an exception of UnsupportedOperationException
Co-authored-by: jerry <je...@zy.com>
---
.../org/apache/dubbo/rpc/cluster/support/MergeableClusterInvoker.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/MergeableClusterInvoker.java b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/MergeableClusterInvoker.java
index 37dbbca..056aa36 100644
--- a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/MergeableClusterInvoker.java
+++ b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/MergeableClusterInvoker.java
@@ -114,7 +114,7 @@ public class MergeableClusterInvoker<T> extends AbstractClusterInvoker<T> {
if (resultList.isEmpty()) {
return AsyncRpcResult.newDefaultAsyncResult(invocation);
} else if (resultList.size() == 1) {
- return resultList.iterator().next();
+ return AsyncRpcResult.newDefaultAsyncResult(resultList.get(0).getValue(), invocation);
}
if (returnType == void.class) {