Source:
<code>private static boolean isMatch(Method method, List<Object> args, Class<?>[] paramClasses, String lookupMethodName) { if (!method.getName().equals(lookupMethodName)) { return false; } Class<?> types[] = method.getParameterTypes(); if (types.length != args.size()) { return false; } for (int i = 0; i < types.length; i++) { Class<?> type = types[i]; Object arg = args.get(i); if (paramClasses != null && type != paramClasses[i]) { return false; } if (arg == null) { if (type.isPrimitive()) { throw new NullPointerException(String.format("The type of No.%d parameter is primitive(%s), " + "but the value passed is null.", i + 1, type.getName())); } continue; } if (ReflectUtils.isPrimitive(arg.getClass())) { if (arg instanceof String && type.isEnum()) { continue; } if (!ReflectUtils.isPrimitive(type)) { return false; } if (!ReflectUtils.isCompatible(type, arg)) { return false; } } else if (arg instanceof JSONObject) { try { <START> ((JSONObject) arg).toJavaObject(type); <END> } catch (Exception ex) { return false; } } else if (arg instanceof Collection) { if (!type.isArray() && !type.isAssignableFrom(arg.getClass())) { return false; } } else { if (!type.isAssignableFrom(arg.getClass())) { return false; } } } return true; }</code><technical_language>java @Data public class User1 implements Serializable { private static final long serialVersionUID = -4729079781904156102L; private String name; } java @Data public class User2 implements Serializable { private static final long serialVersionUID = -2112637973209566052L; private String name; } java public interface XXXService{ String hello(User1 user); String hello(User2 user); } find correct overload method; I **class** param method is overloaded. telnet: invoke xxxService.hello({"name":"xxxx"})</technical_language>

Target:
private static boolean isMatch(Method method, List<Object> args, Class<?>[] paramClasses, String lookupMethodName) { if (!method.getName().equals(lookupMethodName)) { return false; } Class<?> types[] = method.getParameterTypes(); if (types.length != args.size()) { return false; } for (int i = 0; i < types.length; i++) { Class<?> type = types[i]; Object arg = args.get(i); if (paramClasses != null && type != paramClasses[i]) { return false; } if (arg == null) { if (type.isPrimitive()) { throw new NullPointerException(String.format("The type of No.%d parameter is primitive(%s), " + "but the value passed is null.", i + 1, type.getName())); } continue; } if (ReflectUtils.isPrimitive(arg.getClass())) { if (arg instanceof String && type.isEnum()) { continue; } if (!ReflectUtils.isPrimitive(type)) { return false; } if (!ReflectUtils.isCompatible(type, arg)) { return false; } } else if (arg instanceof Map) { String name = (String) ((Map<?, ?>) arg).get("class"); if (StringUtils.isNotEmpty(name)) { Class<?> cls = ReflectUtils.forName(name); if (!type.isAssignableFrom(cls)) { return false; } } else { if (arg instanceof JSONObject) { try { ((JSONObject) arg).toJavaObject(type); } catch (Exception ex) { return false; } } } } else if (arg instanceof Collection) { if (!type.isArray() && !type.isAssignableFrom(arg.getClass())) { return false; } } else { if (!type.isAssignableFrom(arg.getClass())) { return false; } } } return true; }