This commit is contained in:
Redkale
2017-10-22 11:14:49 +08:00
parent 969f7ada82
commit 66ec26e0ce
4 changed files with 5 additions and 6 deletions

View File

@@ -400,9 +400,8 @@ public abstract class NodeServer {
Collections.sort(swlist, (o1, o2) -> {
Priority p1 = o1.getClass().getAnnotation(Priority.class);
Priority p2 = o2.getClass().getAnnotation(Priority.class);
int v1 = p1 == null ? 0 : p1.value();
int v2 = p2 == null ? 0 : p2.value();
if (v1 != v2) return v1 - v2;
int v = (p2 == null ? 0 : p2.value()) - (p1 == null ? 0 : p1.value());
if (v != 0) return v;
int rs = Sncp.getResourceType(o1).getName().compareTo(Sncp.getResourceType(o2).getName());
if (rs == 0) rs = Sncp.getResourceName(o1).compareTo(Sncp.getResourceName(o2));
return rs;