caishunfeng commented on code in PR #10850:
URL: https://github.com/apache/dolphinscheduler/pull/10850#discussion_r916701562


##########
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ExecutorServiceImpl.java:
##########
@@ -984,15 +984,12 @@ private boolean isValidateScheduleTime(String schedule) {
      * @param scheduleTimeList
      * @return remove duplicate date list
      */
-    private String removeDuplicates(String scheduleTimeList) {
+    private static String removeDuplicates(String scheduleTimeList) {
         HashSet<String> removeDate = new HashSet<String>();
-        List<String> resultList = new ArrayList<String>();
         if (StringUtils.isNotEmpty(scheduleTimeList)) {
-            String[] dateArrays = scheduleTimeList.split(COMMA);
-            List<String> dateList = Arrays.asList(dateArrays);
-            removeDate.addAll(dateList);
-            resultList.addAll(removeDate);
-            return String.join(COMMA, resultList);
+            List<String> inputDateList  = 
Arrays.stream(scheduleTimeList.split(COMMA)).map(String::trim).collect(Collectors.toList());

Review Comment:
   And the name `removeDate` seems ambiguous, suggestion: dateSet.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to