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 0049c24  Optimize the logic of obtaining the mock parameter value of 
the corresponding method in the MockInvoker#invoke method (#7840)
0049c24 is described below

commit 0049c24e88ed2fef799ec0dfcc3fd106df26490c
Author: 灼华 <[email protected]>
AuthorDate: Sun May 23 21:18:18 2021 +0800

    Optimize the logic of obtaining the mock parameter value of the 
corresponding method in the MockInvoker#invoke method (#7840)
---
 .../src/main/java/org/apache/dubbo/rpc/support/MockInvoker.java  | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git 
a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/support/MockInvoker.java
 
b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/support/MockInvoker.java
index 156494c..4b826bb 100644
--- 
a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/support/MockInvoker.java
+++ 
b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/support/MockInvoker.java
@@ -99,13 +99,8 @@ final public class MockInvoker<T> implements Invoker<T> {
         if (invocation instanceof RpcInvocation) {
             ((RpcInvocation) invocation).setInvoker(this);
         }
-        String mock = null;
-        if (getUrl().hasMethodParameter(invocation.getMethodName())) {
-            mock = getUrl().getParameter(invocation.getMethodName() + "." + 
MOCK_KEY);
-        }
-        if (StringUtils.isBlank(mock)) {
-            mock = getUrl().getParameter(MOCK_KEY);
-        }
+
+        String mock = 
getUrl().getMethodParameter(invocation.getMethodName(),MOCK_KEY);
 
         if (StringUtils.isBlank(mock)) {
             throw new RpcException(new IllegalAccessException("mock can not be 
null. url :" + url));

Reply via email to