This is an automated email from the ASF dual-hosted git repository.

liujun 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 2c05248  repair MockClusterInvoker#selectMockInvoker annotation (#7095)
2c05248 is described below

commit 2c05248b87f2a453333c990e522d81177daf8fa2
Author: ggox <[email protected]>
AuthorDate: Wed Feb 24 10:49:40 2021 +0800

    repair MockClusterInvoker#selectMockInvoker annotation (#7095)
---
 .../apache/dubbo/rpc/cluster/support/wrapper/MockClusterInvoker.java  | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/wrapper/MockClusterInvoker.java
 
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/wrapper/MockClusterInvoker.java
index a682297..51d0a49 100644
--- 
a/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/wrapper/MockClusterInvoker.java
+++ 
b/dubbo-cluster/src/main/java/org/apache/dubbo/rpc/cluster/support/wrapper/MockClusterInvoker.java
@@ -162,7 +162,7 @@ public class MockClusterInvoker<T> implements 
ClusterInvoker<T> {
     /**
      * Return MockInvoker
      * Contract:
-     * directory.list() will return a list of normal invokers if 
Constants.INVOCATION_NEED_MOCK is present in invocation, otherwise, a list of 
mock invokers will return.
+     * directory.list() will return a list of normal invokers if 
Constants.INVOCATION_NEED_MOCK is absent or not true in invocation, otherwise, 
a list of mock invokers will return.
      * if directory.list() returns more than one mock invoker, only one of 
them will be used.
      *
      * @param invocation
@@ -174,7 +174,7 @@ public class MockClusterInvoker<T> implements 
ClusterInvoker<T> {
         if (invocation instanceof RpcInvocation) {
             //Note the implicit contract (although the description is added to 
the interface declaration, but extensibility is a problem. The practice placed 
in the attachment needs to be improved)
             ((RpcInvocation) invocation).setAttachment(INVOCATION_NEED_MOCK, 
Boolean.TRUE.toString());
-            //directory will return a list of normal invokers if 
Constants.INVOCATION_NEED_MOCK is present in invocation, otherwise, a list of 
mock invokers will return.
+            //directory will return a list of normal invokers if 
Constants.INVOCATION_NEED_MOCK is absent or not true in invocation, otherwise, 
a list of mock invokers will return.
             try {
                 invokers = directory.list(invocation);
             } catch (RpcException e) {

Reply via email to