This is an automated email from the ASF dual-hosted git repository. liujun pushed a commit to branch master-hsf in repository https://gitbox.apache.org/repos/asf/dubbo.git
commit 3b8f3d454119564060d87e570caed9eb787fc96f Author: qinliujie <[email protected]> AuthorDate: Thu Nov 21 13:51:00 2019 +0800 get method list from proxy target object --- .../src/main/java/org/apache/dubbo/rpc/model/ConsumerModel.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/model/ConsumerModel.java b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/model/ConsumerModel.java index c778ca8..fa6f6e5 100644 --- a/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/model/ConsumerModel.java +++ b/dubbo-rpc/dubbo-rpc-api/src/main/java/org/apache/dubbo/rpc/model/ConsumerModel.java @@ -43,8 +43,11 @@ public class ConsumerModel { } public void init(Map<String, Object> attributes) { - for (Method method : serviceMetadata.getServiceType().getMethods()) { - methodModels.put(method, new ConsumerMethodModel(method, attributes)); + Class[] interfaceList = serviceMetadata.getTarget().getClass().getInterfaces(); + for (Class interfaceClass : interfaceList) { + for (Method method : interfaceClass.getMethods()) { + methodModels.put(method, new ConsumerMethodModel(method, attributes)); + } } } @@ -88,7 +91,7 @@ public class ConsumerModel { public ConsumerMethodModel getMethodModel(String method, String[] argsType) { Optional<ConsumerMethodModel> consumerMethodModel = methodModels.entrySet().stream() .filter(entry -> entry.getKey().getName().equals(method)) - .map(Map.Entry::getValue).filter(methodModel -> Arrays.equals(argsType, methodModel.getParameterTypes())) + .map(Map.Entry::getValue).filter(methodModel -> Arrays.equals(argsType, methodModel.getParameterTypes())) .findFirst(); return consumerMethodModel.orElse(null); }
