You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by li...@apache.org on 2019/11/04 04:39:03 UTC
[dubbo] branch master updated: fix how compatibleParamSignatures is
generated.
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 0680ed6 fix how compatibleParamSignatures is generated.
0680ed6 is described below
commit 0680ed627d84f8107f590d6e3951c4c7db67635f
Author: ken.lj <ke...@gmail.com>
AuthorDate: Mon Nov 4 12:38:19 2019 +0800
fix how compatibleParamSignatures is generated.
---
.../src/main/java/org/apache/dubbo/rpc/model/ConsumerModel.java | 6 +++++-
.../src/main/java/org/apache/dubbo/rpc/model/MethodDescriptor.java | 5 ++++-
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/dubbo-common/src/main/java/org/apache/dubbo/rpc/model/ConsumerModel.java b/dubbo-common/src/main/java/org/apache/dubbo/rpc/model/ConsumerModel.java
index d6be59b..2c18e57 100644
--- a/dubbo-common/src/main/java/org/apache/dubbo/rpc/model/ConsumerModel.java
+++ b/dubbo-common/src/main/java/org/apache/dubbo/rpc/model/ConsumerModel.java
@@ -184,7 +184,7 @@ public class ConsumerModel {
/* *************** Start, metadata compatible **************** */
private ServiceMetadata serviceMetadata;
- private final Map<Method, ConsumerMethodModel> methodModels = new IdentityHashMap<Method, ConsumerMethodModel>();
+ private Map<Method, ConsumerMethodModel> methodModels = new IdentityHashMap<Method, ConsumerMethodModel>();
public ConsumerModel(String serviceKey
, Object proxyObject
@@ -201,6 +201,10 @@ public class ConsumerModel {
}
}
+ public ClassLoader getClassLoader() {
+ return serviceMetadata.getServiceType().getClassLoader();
+ }
+
/**
* @return serviceMetadata
*/
diff --git a/dubbo-common/src/main/java/org/apache/dubbo/rpc/model/MethodDescriptor.java b/dubbo-common/src/main/java/org/apache/dubbo/rpc/model/MethodDescriptor.java
index cd5bf91..f53767f 100644
--- a/dubbo-common/src/main/java/org/apache/dubbo/rpc/model/MethodDescriptor.java
+++ b/dubbo-common/src/main/java/org/apache/dubbo/rpc/model/MethodDescriptor.java
@@ -20,6 +20,7 @@ import org.apache.dubbo.common.utils.ReflectUtils;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
+import java.util.stream.Stream;
import static org.apache.dubbo.common.constants.CommonConstants.$INVOKE;
import static org.apache.dubbo.common.constants.CommonConstants.$INVOKE_ASYNC;
@@ -46,7 +47,9 @@ public class MethodDescriptor {
this.returnClass = method.getReturnType();
this.returnTypes = ReflectUtils.getReturnTypes(method);
this.paramDesc = ReflectUtils.getDesc(parameterClasses);
- this.compatibleParamSignatures = ReflectUtils.getDescArray(method);
+ this.compatibleParamSignatures = Stream.of(parameterClasses)
+ .map(Class::getName)
+ .toArray(String[]::new);
this.methodName = method.getName();
this.generic = (methodName.equals($INVOKE) || methodName.equals($INVOKE_ASYNC)) && parameterClasses.length == 3;
}