<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/incubator-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/incubator-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.5</li>
<li>Operating System version: xxx</li>
<li>Java version: xxx</li>
</ul>
<p dir="auto"><strong>问题：</strong><br>
排序会出现问题<br>
com.alibaba.dubbo.common.extension.support.ActivateComparator 这个比较器在这种场景下的排序会出现问题。</p>
<p dir="auto"><strong>现象：</strong><br>
扩展接口的实现类实现了多个接口，其中包括当前SPI接口，还有其它接口，如果实现类实现接口的顺序第一个不是SPI接口，则排序是错误的。</p>
<p dir="auto"><strong>原因：</strong><br>
因为ActivateComparator 代码的表逻辑判定是第一个必须是SPI接口---》o1.getClass().getInterfaces()[0].isAnnotationPresent(SPI.class)。</p>
<ul class="contains-task-list">
<li class="task-list-item">
<p dir="auto"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/apache/incubator-dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</p>
</li>
<li class="task-list-item">
<p dir="auto"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/apache/incubator-dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</p>
<p dir="auto">I am wondering whether you want a code static analysis tool to avoid simple mistakes in Dubbo, I saw <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="308545875" data-permission-text="Title is private" data-url="https://github.com/apache/dubbo/issues/1513" data-hovercard-type="issue" data-hovercard-url="/apache/dubbo/issues/1513/hovercard" href="https://github.com/apache/dubbo/issues/1513">#1513</a> this suggestion, and maybe a Error Prone (<a href="https://github.com/google/error-prone">https://github.com/google/error-prone</a>) from google is a good choice.</p>
<p dir="auto">Maybe it sometimes annoys us, but it can definitely help us to eliminate some serious bug.</p>
<p dir="auto">How do you guys think?</p>
</li>
</ul>