Skip to content

获取自动激活的扩展接口实现类后的排序算法问题 #3390

@dongYES

Description

@dongYES
  • I have searched the issues of this repository and believe that this is not a duplicate.
  • I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

  • Dubbo version: 2.6.5
  • Operating System version: xxx
  • Java version: xxx

问题:
排序会出现问题
com.alibaba.dubbo.common.extension.support.ActivateComparator 这个比较器在这种场景下的排序会出现问题。

现象:
扩展接口的实现类实现了多个接口,其中包括当前SPI接口,还有其它接口,如果实现类实现接口的顺序第一个不是SPI接口,则排序是错误的。

原因:
因为ActivateComparator 代码的表逻辑判定是第一个必须是SPI接口---》o1.getClass().getInterfaces()[0].isAnnotationPresent(SPI.class)。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions