enhance org.apache.dubbo.rpc.protocol.dubbo.telnet.InvokeTelnetHandler#isMatch (...
authorIan Luo <ian.luo@gmail.com>
Tue, 11 Dec 2018 07:10:42 +0000 (15:10 +0800)
committerGitHub <noreply@github.com>
Tue, 11 Dec 2018 07:10:42 +0000 (15:10 +0800)
* enhance isMatch

* remove useless imports

dubbo-rpc/dubbo-rpc-dubbo/src/main/java/org/apache/dubbo/rpc/protocol/dubbo/telnet/InvokeTelnetHandler.java

index b13a7f0..caa9f9a 100644 (file)
@@ -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;
@@ -76,14 +75,11 @@ public class InvokeTelnetHandler implements TelnetHandler {
             }
 
             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;
                 }