second commit #1789 update JobRegistryMonitorHelper.java, replace String with StringBuilder

master
lilu 4 years ago
parent 289f02185b
commit c942d442e8
  1. 5
      xxl-job-admin/src/main/java/com/xxl/job/admin/core/thread/JobRegistryMonitorHelper.java

@ -66,10 +66,11 @@ public class JobRegistryMonitorHelper {
String addressListStr = null; String addressListStr = null;
if (registryList!=null && !registryList.isEmpty()) { if (registryList!=null && !registryList.isEmpty()) {
Collections.sort(registryList); Collections.sort(registryList);
addressListStr = ""; StringBuilder sb = new StringBuilder();
for (String item:registryList) { for (String item:registryList) {
addressListStr += item + ","; sb.append(item).append(",");
} }
addressListStr = sb.toString();
addressListStr = addressListStr.substring(0, addressListStr.length()-1); addressListStr = addressListStr.substring(0, addressListStr.length()-1);
} }
group.setAddressList(addressListStr); group.setAddressList(addressListStr);

Loading…
Cancel
Save