From 0eb9a5403e95db8b423c89270cc1d6bbcc8448d4 Mon Sep 17 00:00:00 2001 From: beiwei30 Date: Tue, 11 Dec 2018 14:27:44 +0800 Subject: [PATCH 1/2] enhance isMatch --- .../rpc/protocol/dubbo/telnet/InvokeTelnetHandler.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/telnet/InvokeTelnetHandler.java b/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/telnet/InvokeTelnetHandler.java index b250c1e1f1c..f731a4e0061 100644 --- a/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/telnet/InvokeTelnetHandler.java +++ b/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/telnet/InvokeTelnetHandler.java @@ -76,14 +76,11 @@ private static boolean isMatch(Class[] types, List args) { } if (ReflectUtils.isPrimitive(arg.getClass())) { + // allow string arg to enum type, @see PojoUtils.realize0() if (arg instanceof String && type.isEnum()) { - try { - CompatibleTypeUtils.compatibleTypeConvert(arg, type); - } catch (RuntimeException e) { - return false; - } continue; } + if (!ReflectUtils.isPrimitive(type)) { return false; } From 5c017ab9bb2226e4473d68acb57305b09b35c452 Mon Sep 17 00:00:00 2001 From: beiwei30 Date: Tue, 11 Dec 2018 14:51:03 +0800 Subject: [PATCH 2/2] remove useless imports --- .../dubbo/rpc/protocol/dubbo/telnet/InvokeTelnetHandler.java | 1 - 1 file changed, 1 deletion(-) diff --git a/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/telnet/InvokeTelnetHandler.java b/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/telnet/InvokeTelnetHandler.java index f731a4e0061..df3ffd302dc 100644 --- a/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/telnet/InvokeTelnetHandler.java +++ b/dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/telnet/InvokeTelnetHandler.java @@ -17,7 +17,6 @@ package org.apache.dubbo.rpc.protocol.dubbo.telnet; import org.apache.dubbo.common.extension.Activate; -import org.apache.dubbo.common.utils.CompatibleTypeUtils; import org.apache.dubbo.common.utils.PojoUtils; import org.apache.dubbo.common.utils.ReflectUtils; import org.apache.dubbo.common.utils.StringUtils;