Browse Source

[Bug][Api] Complete Data workflow remove duplicates. (#10850)

* [Bug][Api] Complete Data workflow remove duplicates.

Co-authored-by: houshitao <shitaohou@163.com>
Co-authored-by: kezhenxu94 <kezhenxu94@apache.org>
3.1.0-release
houshitao 2 years ago committed by GitHub
parent
commit
73f4846c49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java

8
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java

@ -985,14 +985,8 @@ public class ExecutorServiceImpl extends BaseServiceImpl implements ExecutorServ
* @return remove duplicate date list * @return remove duplicate date list
*/ */
private String removeDuplicates(String scheduleTimeList) { private String removeDuplicates(String scheduleTimeList) {
HashSet<String> removeDate = new HashSet<String>();
List<String> resultList = new ArrayList<String>();
if (StringUtils.isNotEmpty(scheduleTimeList)) { if (StringUtils.isNotEmpty(scheduleTimeList)) {
String[] dateArrays = scheduleTimeList.split(COMMA); return Arrays.stream(scheduleTimeList.split(COMMA)).map(String::trim).collect(Collectors.joining(COMMA));
List<String> dateList = Arrays.asList(dateArrays);
removeDate.addAll(dateList);
resultList.addAll(removeDate);
return String.join(COMMA, resultList);
} }
return null; return null;
} }

Loading…
Cancel
Save