From 73f4846c49a95e5e84e3a6b1102c115e4a031c0a Mon Sep 17 00:00:00 2001 From: houshitao <33045461+hstdream@users.noreply.github.com> Date: Sat, 9 Jul 2022 21:29:11 +0800 Subject: [PATCH] [Bug][Api] Complete Data workflow remove duplicates. (#10850) * [Bug][Api] Complete Data workflow remove duplicates. Co-authored-by: houshitao Co-authored-by: kezhenxu94 --- .../api/service/impl/ExecutorServiceImpl.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java b/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java index e8092ee9fa..d4baa59d9d 100644 --- a/dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java +++ b/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 */ private String removeDuplicates(String scheduleTimeList) { - HashSet removeDate = new HashSet(); - List resultList = new ArrayList(); if (StringUtils.isNotEmpty(scheduleTimeList)) { - String[] dateArrays = scheduleTimeList.split(COMMA); - List dateList = Arrays.asList(dateArrays); - removeDate.addAll(dateList); - resultList.addAll(removeDate); - return String.join(COMMA, resultList); + return Arrays.stream(scheduleTimeList.split(COMMA)).map(String::trim).collect(Collectors.joining(COMMA)); } return null; }