You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by al...@apache.org on 2021/09/03 13:50:53 UTC
[dubbo] branch master updated: fix issue-8387 on master (#8624)
This is an automated email from the ASF dual-hosted git repository.
albumenj pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/master by this push:
new 7d95364 fix issue-8387 on master (#8624)
7d95364 is described below
commit 7d95364a4d605cf21d077882724340b749b4e63b
Author: changfu <ch...@gmail.com>
AuthorDate: Fri Sep 3 21:50:38 2021 +0800
fix issue-8387 on master (#8624)
---
.../extension/support/WrapperComparator.java | 26 ++--------------------
1 file changed, 2 insertions(+), 24 deletions(-)
diff --git a/dubbo-common/src/main/java/org/apache/dubbo/common/extension/support/WrapperComparator.java b/dubbo-common/src/main/java/org/apache/dubbo/common/extension/support/WrapperComparator.java
index ead4a4f..2fc54bd 100644
--- a/dubbo-common/src/main/java/org/apache/dubbo/common/extension/support/WrapperComparator.java
+++ b/dubbo-common/src/main/java/org/apache/dubbo/common/extension/support/WrapperComparator.java
@@ -17,7 +17,6 @@
package org.apache.dubbo.common.extension.support;
import org.apache.dubbo.common.extension.Activate;
-import org.apache.dubbo.common.extension.SPI;
import java.util.Comparator;
@@ -46,36 +45,15 @@ public class WrapperComparator implements Comparator<Object> {
Class clazz1 = (Class) o1;
Class clazz2 = (Class) o2;
- Class<?> inf = findSpi(clazz1);
-
OrderInfo a1 = parseOrder(clazz1);
OrderInfo a2 = parseOrder(clazz2);
- int n1 = a1 == null ? 0 : a1.order;
- int n2 = a2 == null ? 0 : a2.order;
+ int n1 = a1.order;
+ int n2 = a2.order;
// never return 0 even if n1 equals n2, otherwise, o1 and o2 will override each other in collection like HashSet
return n1 > n2 ? 1 : -1;
}
- private Class<?> findSpi(Class clazz) {
- if (clazz.getInterfaces().length == 0) {
- return null;
- }
-
- for (Class<?> intf : clazz.getInterfaces()) {
- if (intf.isAnnotationPresent(SPI.class)) {
- return intf;
- } else {
- Class result = findSpi(intf);
- if (result != null) {
- return result;
- }
- }
- }
-
- return null;
- }
-
private OrderInfo parseOrder(Class<?> clazz) {
OrderInfo info = new OrderInfo();
if (clazz.isAnnotationPresent(Activate.class)) {