CalvinKirs commented on a change in pull request #4931:
URL:
https://github.com/apache/incubator-dolphinscheduler/pull/4931#discussion_r586023753
##########
File path:
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
##########
@@ -1401,35 +1401,27 @@ private void importSubProcess(User loginUser, Project
targetProject, ArrayNode j
return result;
}
-
/**
* whether the graph has a ring
*
- * @param taskNodeResponseList task node response list
+ * @param taskNodeList task node list
* @return if graph has cycle flag
*/
- private boolean graphHasCycle(List<TaskNode> taskNodeResponseList) {
- DAG<String, TaskNode, String> graph = new DAG<>();
-
- // Fill the vertices
- for (TaskNode taskNodeResponse : taskNodeResponseList) {
- graph.addNode(taskNodeResponse.getName(), taskNodeResponse);
- }
-
- // Fill edge relations
- for (TaskNode taskNodeResponse : taskNodeResponseList) {
- taskNodeResponse.getPreTasks();
- List<String> preTasks =
JSONUtils.toList(taskNodeResponse.getPreTasks(), String.class);
+ private boolean graphHasCycle(List<TaskNode> taskNodeList) {
+ List<String> preTaskList = new ArrayList<>();
Review comment:
It’s best to make a judgment here to avoid NPE
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]