Skip to content

Commit

Permalink
feat: 定时任务兼容不合法主机 #3305
Browse files Browse the repository at this point in the history
处理 Code Review
  • Loading branch information
wangyu096 committed Dec 2, 2024
1 parent f6a8737 commit cfd53f0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,24 @@ public static <E, K, V> Map<K, V> convertToMap(List<E> entityCollection,
}

public static <T> ArrayList<T> mergeToArrayList(List<T> list1, List<T> list2) {
ArrayList<T> mergeList = new ArrayList<>(list1.size() + list2.size());
mergeList.addAll(list1);
mergeList.addAll(list2);
return mergeList;
ArrayList<T> mergeList;

boolean isList1NotEmpty = CollectionUtils.isNotEmpty(list1);
boolean isList2NotEmpty = CollectionUtils.isNotEmpty(list2);

if (isList1NotEmpty && isList2NotEmpty) {
mergeList = new ArrayList<>(list1.size() + list2.size());
mergeList.addAll(list1);
mergeList.addAll(list2);
return mergeList;
} else if (isList1NotEmpty) {
mergeList = new ArrayList<>(list1);
return mergeList;
} else if (isList2NotEmpty) {
mergeList = new ArrayList<>(list2);
return mergeList;
} else {
return new ArrayList<>(0);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ private String buildInitialFileTaskUploadLogContent(boolean isSourceValid,
} else if (!isSourceAgentInstalled) {
return "Agent is not installed";
} else {
// 源、目标正常,无法写入错误日志
// 源、目标正常,无需写入错误日志
return null;
}
}
Expand Down

0 comments on commit cfd53f0

Please sign in to comment.