<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have searched the <a href="https://github.com/apache/dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> I have checked the <a href="https://github.com/apache/dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.6.6</li>
<li>Operating System version: *nix</li>
<li>Java version: 1.7</li>
</ul>
<p dir="auto">When we use complex arguments, in telnet mode , we need use  jsonArray to parse.<br>
But in our code ,someone try to resolve an overwrite problem ,so make an issue <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="159891353" data-permission-text="Title is private" data-url="https://github.com/apache/dubbo/issues/257" data-hovercard-type="issue" data-hovercard-url="/apache/dubbo/issues/257/hovercard" href="https://github.com/apache/dubbo/issues/257">#257</a><br>
then <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/beiwei30/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/beiwei30">@beiwei30</a> try to fix this issue use this code below <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/apache/dubbo/commit/27917f2e86bbd97ee047d69817730a57bdf5ad6b/hovercard" href="https://github.com/apache/dubbo/commit/27917f2e86bbd97ee047d69817730a57bdf5ad6b"><tt>27917f2</tt></a></p>
<p dir="auto">The code will make the default method not take effect.</p>
<p dir="auto">The code before like this</p>
<div class="highlight highlight-source-java notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content=" private static Method findMethod(Exporter&lt;?&gt; exporter, String method, List&lt;Object&gt; args) {
        Invoker&lt;?&gt; invoker = exporter.getInvoker();
        Method[] methods = invoker.getInterface().getMethods();
        Method invokeMethod = null;
        for (Method m : methods) {
            if (m.getName().equals(method) &amp;&amp; m.getParameterTypes().length == args.size()) {
                if (invokeMethod != null) { // 重载
                    if (isMatch(invokeMethod.getParameterTypes(), args)) {
                        invokeMethod = m;
                        break;
                    }
                } else {
                    invokeMethod = m;
                }
                invoker = exporter.getInvoker();
            }
        }
        return invokeMethod;"><pre class="notranslate"> <span class="pl-k">private</span> <span class="pl-k">static</span> <span class="pl-smi">Method</span> <span class="pl-s1">findMethod</span>(<span class="pl-smi">Exporter</span>&lt;?&gt; <span class="pl-s1">exporter</span>, <span class="pl-smi">String</span> <span class="pl-s1">method</span>, <span class="pl-smi">List</span>&lt;<span class="pl-smi">Object</span>&gt; <span class="pl-s1">args</span>) {
        <span class="pl-smi">Invoker</span>&lt;?&gt; <span class="pl-s1">invoker</span> = <span class="pl-s1">exporter</span>.<span class="pl-en">getInvoker</span>();
        <span class="pl-smi">Method</span>[] <span class="pl-s1">methods</span> = <span class="pl-s1">invoker</span>.<span class="pl-en">getInterface</span>().<span class="pl-en">getMethods</span>();
        <span class="pl-smi">Method</span> <span class="pl-s1">invokeMethod</span> = <span class="pl-c1">null</span>;
        <span class="pl-k">for</span> (<span class="pl-smi">Method</span> <span class="pl-s1">m</span> : <span class="pl-s1">methods</span>) {
            <span class="pl-k">if</span> (<span class="pl-s1">m</span>.<span class="pl-en">getName</span>().<span class="pl-en">equals</span>(<span class="pl-s1">method</span>) &amp;&amp; <span class="pl-s1">m</span>.<span class="pl-en">getParameterTypes</span>().<span class="pl-s1">length</span> == <span class="pl-s1">args</span>.<span class="pl-en">size</span>()) {
                <span class="pl-k">if</span> (<span class="pl-s1">invokeMethod</span> != <span class="pl-c1">null</span>) { <span class="pl-c">// 重载</span>
                    <span class="pl-k">if</span> (<span class="pl-en">isMatch</span>(<span class="pl-s1">invokeMethod</span>.<span class="pl-en">getParameterTypes</span>(), <span class="pl-s1">args</span>)) {
                        <span class="pl-s1">invokeMethod</span> = <span class="pl-s1">m</span>;
                        <span class="pl-k">break</span>;
                    }
                } <span class="pl-k">else</span> {
                    <span class="pl-s1">invokeMethod</span> = <span class="pl-s1">m</span>;
                }
                <span class="pl-s1">invoker</span> = <span class="pl-s1">exporter</span>.<span class="pl-en">getInvoker</span>();
            }
        }
        <span class="pl-k">return</span> <span class="pl-s1">invokeMethod</span>;</pre></div>
<p dir="auto">We can have a default method with the the methodName and the same length arguments.<br>
But after the code  change , it must provides the correct arguments type. We should know<br>
json parse cannot give the corrent type. It maybe  JsonObject or even HashMap.<br>
So someone points out this problem <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="379014397" data-permission-text="Title is private" data-url="https://github.com/apache/dubbo/issues/2766" data-hovercard-type="issue" data-hovercard-url="/apache/dubbo/issues/2766/hovercard" href="https://github.com/apache/dubbo/issues/2766">#2766</a>.<br>
In my opinion ,we should not define the same name method. Such as retry or timeout , these configs may just take  effect in method or service or provider .In these cases ,methodName can stands for method. That is to say ,a lot of configs just consider the method name .<br>
In dubbo 2.7.x, for this issue ,dubbo provides a new telnet command called select.<br>
So ,We should consider which is better.</p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/apache/dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/apache/dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.7.3</li>
<li>Operating System version:  win7</li>
<li>Java version: jdk8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>define a service Interface like this.</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="public interface HelloBOMService {
  PersonResponseType get(PersonRequestType request) throws Exception;
}"><pre class="notranslate"><code class="notranslate">public interface HelloBOMService {
  PersonResponseType get(PersonRequestType request) throws Exception;
}
</code></pre></div>
<ol start="2" dir="auto">
<li>getServiceDefinition and print Method Parameter</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content=" ServiceDefinition serviceDefinition = ServiceDefinitionBuilder.build(HelloBOMService.class);
        System.out.println(serviceDefinition.getMethods().get(0).getParameters());"><pre class="notranslate"><code class="notranslate"> ServiceDefinition serviceDefinition = ServiceDefinitionBuilder.build(HelloBOMService.class);
        System.out.println(serviceDefinition.getMethods().get(0).getParameters());
</code></pre></div>
<ol start="3" dir="auto">
<li>
<p dir="auto">the methodDefition return  an empty list</p>
</li>
<li>
<p dir="auto">Extends TypeBuilder to construct Protobuf typeBuilder and add SPI file.</p>
</li>
</ol>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="@SPI
public interface TypeBuilder {"><pre class="notranslate"><code class="notranslate">@SPI
public interface TypeBuilder {
</code></pre></div>
<ol start="2" dir="auto">
<li>Use serviceDefition.getTypes() to obtains all TypeDefinitions. It is nessary to know which TypeDefinitionBuilder build this TypeDefition.When TypeBuilder generate same ServiceDefinition<br>
use different logic.</li>
</ol>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">We could get parameter type list from MethodDefition.<br>
We should know which Builder build this TypeDefition.</p>