fix: fix sort contract info bugs

This commit is contained in:
CaiHQ 2022-01-06 20:35:33 +08:00
parent 893be2e954
commit 4315992b73

View File

@ -75,7 +75,6 @@ public class ContractManager {
Executors.newScheduledThreadPool(10); Executors.newScheduledThreadPool(10);
public static int logStage = 0; public static int logStage = 0;
public static Sigar sigar = null; // 获取network等资源什么 public static Sigar sigar = null; // 获取network等资源什么
@ -1674,11 +1673,14 @@ public class ContractManager {
if (o2.id.equals(firstID)) { if (o2.id.equals(firstID)) {
return 1; return 1;
} }
if (o1.name != null && o2.name != null) { String str1 = o1.name;
return o1.name.compareTo(o2.name); String str2 = o2.name;
} else { if (o1.name == null)
return -1; str1 = "";
} if (o2.name == null)
str2 = "";
return str1.compareTo(str2);
}); });
} }