Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrapper 类无序,是否可以改为有序 #4578

Closed
zhaojigang opened this issue Jul 16, 2019 · 2 comments
Closed

wrapper 类无序,是否可以改为有序 #4578

zhaojigang opened this issue Jul 16, 2019 · 2 comments

Comments

@zhaojigang
Copy link
Contributor

hi,由于 Dubbo SPI AOP 的 wrapper 类使用 ConcurrentHashSet 来存储的,导致无法确定 wrapper 类的顺序,建议改为 TreeSet 或者 List 来存储
image

Environment

  • Dubbo version: 2.6.6 2.7.3-SNAPSHOT也有这个问题
  • Operating System version: mac
  • Java version: jdk8
@beiwei30
Copy link
Member

beiwei30 commented Aug 1, 2019

这样做没有意义,因为 classloader 加载的顺序也是未知的。应当确保 wrapper class 本身的实现与顺序无关。

@anLA7856
Copy link
Contributor

可否给出更详细说明一下?从 代码外层中加载 SPI 对应类名文件来看,是按行从上往下读取,单个加载。是有顺序行的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants