Skip to content

Commit e3c70ff

Browse files
beiwei30khanimteyaz
authored andcommitted
enhance org.apache.dubbo.rpc.protocol.dubbo.telnet.InvokeTelnetHandler#isMatch (apache#2941)
* enhance isMatch * remove useless imports
1 parent e75d72c commit e3c70ff

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package org.apache.dubbo.rpc.protocol.dubbo.telnet;
1818

1919
import org.apache.dubbo.common.extension.Activate;
20-
import org.apache.dubbo.common.utils.CompatibleTypeUtils;
2120
import org.apache.dubbo.common.utils.PojoUtils;
2221
import org.apache.dubbo.common.utils.ReflectUtils;
2322
import org.apache.dubbo.common.utils.StringUtils;
@@ -76,14 +75,11 @@ private static boolean isMatch(Class<?>[] types, List<Object> args) {
7675
}
7776

7877
if (ReflectUtils.isPrimitive(arg.getClass())) {
78+
// allow string arg to enum type, @see PojoUtils.realize0()
7979
if (arg instanceof String && type.isEnum()) {
80-
try {
81-
CompatibleTypeUtils.compatibleTypeConvert(arg, type);
82-
} catch (RuntimeException e) {
83-
return false;
84-
}
8580
continue;
8681
}
82+
8783
if (!ReflectUtils.isPrimitive(type)) {
8884
return false;
8985
}

0 commit comments

Comments
 (0)