Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 200235

Summary: [api] guard against circular dependencies (sub-tasks)
Product: z_Archived Reporter: Robert Elves <robert.elves>
Component: MylynAssignee: Robert Elves <robert.elves>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P2 CC: mjmeijer, steffen.pingel
Version: unspecified   
Target Milestone: 3.0   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
patch
none
mylyn/context/zip none

Description Robert Elves CLA 2007-08-16 15:04:56 EDT
If a connector doesn't guard against circular dependencies (sub tasks) this can result in stack overflow. The framework therefore need to be defensive in this respect.
Comment 1 maarten meijer CLA 2008-01-31 15:39:27 EST
 FYI:
 There is a cyclic dependency check in AbstractTaskContainerPropertySource.java in method
 public boolean containsCyclic(AbstractTaskContainer parent) in the sandbox.dev tools.
 Maybe its a question of moving this functionality.
Comment 2 maarten meijer CLA 2008-01-31 15:40:24 EST
See bug 210639
Comment 3 Shawn Minto CLA 2008-04-08 16:41:29 EDT
Steffen, I will have a look at creating a patch for this.
Comment 4 Shawn Minto CLA 2008-04-08 17:25:33 EDT
Created attachment 95273 [details]
patch

I have attached a patch that removes the MAX_SUBTASK_DEPTH constant and uses a depth first search of the hierarchy.  This is similar to Maarten's approach.  There were more changes than expected, so it would be good to have this code reviewed carefully.
Comment 5 Shawn Minto CLA 2008-04-08 17:25:35 EDT
Created attachment 95274 [details]
mylyn/context/zip
Comment 6 Steffen Pingel CLA 2008-04-08 19:01:50 EDT
Thanks Shawn. I have applied the part of the patch that touches tasks.core and tasks.tests. I would like to work on the task list model first before we take a look at the UI classes that traverse the task list.
Comment 7 Steffen Pingel CLA 2008-04-12 22:03:05 EDT
Rob, reassigning to you. This is related to implementing a concurrency model that ensures that the task list data model never has cycles.
Comment 8 Steffen Pingel CLA 2008-04-19 15:02:18 EDT
TaskList.addTask() now validates any modifications made to the task list model and does not allow cycles anymore.