You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Dubbo route compareTo method donot work correctly #3249
Have the following questions:
1.java requires that the results obtained by A.compareTo(B) and B.compareTo(A) should be equivalent. But in ScriptRoute
` @Override
Public int compareTo(Router o) {
If (o == null || o.getClass() != ScriptRouter.class) {
Return 1;
}
ScriptRouter c = (ScriptRouter) o;
Return this.priority == c.priority ? rule.compareTo(c.rule) : (this.priority > c.priority ? 1 : -1);
}
let ScriptRoute.compareTo(others) to be equivalent to others.compareTo(scriptRoute). In fact, some other scripts have this problem if they customize their compareTo.
2.6 and 2.7 compatible issues
How the order of 2.6 and 2.7 can meet the reasonable requirements, while meeting the first point requirements.
Make a record first, and the problem is to be refined.
I have submitted the pr to fix this problem on both 2.7 and 2.6. The method compareTo is no need to
overwrite in the most cases since the method getPriority existing.
Activity
carryxyh commentedon Jan 16, 2019
第一个问题在master上已经修复了,那位提交者没有提交到2.6.x分支上,可以艾特他再提交一个到2.6.x上好了
Extract compareTo impl to Router interface and concrete Router only r…
beiwei30 commentedon Feb 2, 2019
@cvictory is this fixed on both 2.7 and 2.6?
lexburner commentedon Feb 12, 2019
I have submitted the pr to fix this problem on both 2.7 and 2.6. The method
compareTois no need tooverwrite in the most cases since the method
getPriorityexisting.Merge master branch to 3.x dev branch (#3718)