diff --git a/src/main/java/org/bdware/sc/ContractManager.java b/src/main/java/org/bdware/sc/ContractManager.java index 7f03415..8ef572d 100644 --- a/src/main/java/org/bdware/sc/ContractManager.java +++ b/src/main/java/org/bdware/sc/ContractManager.java @@ -75,7 +75,6 @@ public class ContractManager { Executors.newScheduledThreadPool(10); - public static int logStage = 0; public static Sigar sigar = null; // 获取network等资源什么 @@ -1674,11 +1673,14 @@ public class ContractManager { if (o2.id.equals(firstID)) { return 1; } - if (o1.name != null && o2.name != null) { - return o1.name.compareTo(o2.name); - } else { - return -1; - } + String str1 = o1.name; + String str2 = o2.name; + if (o1.name == null) + str1 = ""; + if (o2.name == null) + str2 = ""; + return str1.compareTo(str2); + }); }