ruanwenjun commented on a change in pull request #8309:
URL: https://github.com/apache/dolphinscheduler/pull/8309#discussion_r801555543



##########
File path: 
dolphinscheduler-service/src/main/java/org/apache/dolphinscheduler/service/process/ProcessService.java
##########
@@ -2416,7 +2416,13 @@ public int saveTaskRelation(User operator, long 
projectCode, long processDefinit
         Map<Long, TaskDefinitionLog> taskDefinitionLogMap = null;
         if (CollectionUtils.isNotEmpty(taskDefinitionLogs)) {
             taskDefinitionLogMap = taskDefinitionLogs.stream()
-                    .collect(Collectors.toMap(TaskDefinition::getCode, 
taskDefinitionLog -> taskDefinitionLog));
+                    .collect(
+                        Collectors.toMap(
+                            TaskDefinition::getCode,
+                            taskDefinitionLog -> taskDefinitionLog,
+                            (entityOld , entityNew) -> entityOld

Review comment:
       I am actually not sure the logic here, but I guess you want to retain 
the latest `taskDefinitionLog` in the map?
   If so, you bettered compared by id or operateTime to determine which should 
retain.




-- 
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