Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 385439 - TaskList.deleteCategory() deletes task data but not ITasks for AutomaticRepositoryTaskContainers
Summary: TaskList.deleteCategory() deletes task data but not ITasks for AutomaticRepos...
Status: CLOSED MOVED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Sam Davis CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 349955
Blocks:
  Show dependency tree
 
Reported: 2012-07-18 17:05 EDT by Sam Davis CLA
Modified: 2013-04-23 07:02 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Davis CLA 2012-07-18 17:05:58 EDT
TaskList.deleteCategory() deletes task data but not ITasks for AutomaticRepositoryTaskContainers. For Unsubmitted, this results in tasks that can neither be opened nor deleted, but which go away when Eclipse is restarted. I suggest adding something like the following at the beginning of the method:

bc. 
if(category instanceof AutomaticRepositoryTaskContainer) {
	DeleteAction.prepareDeletion(container.getChildren());
	DeleteAction.performDeletion(container.getChildren());
	return;
}

prepareDeletion and performDeletion would have to be moved to core.
Comment 1 Steffen Pingel CLA 2012-07-18 17:40:18 EDT
Do you have a test case to demonstrate the problem? Moving deletion logic to the core is tracked on bug 349955.
Comment 2 Sam Davis CLA 2012-07-19 14:48:42 EDT
This fails on the last assertion:

bc. 
	public void testDeleteUnsubmitted() throws CoreException {
		TaskRepository repository = TaskTestUtil.createMockRepository();
		TasksUiPlugin.getRepositoryManager().addRepository(repository);
		// create unsubmitted container
		taskList.addUnmatchedContainer(new UnmatchedTaskContainer(repository.getConnectorKind(),
				repository.getRepositoryUrl()));
		UnsubmittedTaskContainer unsubmittedContainer = taskList.getUnsubmittedContainer(repository.getRepositoryUrl());
		assertEquals(0, taskList.getAllTasks().size());
		TaskTask unsubmittedTask = TaskTestUtil.createMockTask("123");
		taskList.addTask(unsubmittedTask, unsubmittedContainer);
		assertEquals(1, taskList.getAllTasks().size());
		assertTrue(unsubmittedContainer.contains(unsubmittedTask.getHandleIdentifier()));
		taskList.deleteCategory(unsubmittedContainer);
		assertEquals(0, taskList.getAllTasks().size());
	}
Comment 3 Steffen Pingel CLA 2012-07-20 07:43:41 EDT
Can you push a review with the failing test?
Comment 4 Sam Davis CLA 2012-07-20 12:56:35 EDT
6900: NEW - bug 385439: TaskList.deleteCategory() deletes task data but not ITasks for AutomaticRepositoryTaskContainers  https://bugs.eclipse.org/bugs/show_bug.cgi?id=385439 [I9c0dd0f0]
https://git.eclipse.org/r/#change,6900
Comment 5 Steffen Pingel CLA 2012-09-15 21:45:41 EDT
Sam, do you have time to work on this?
Comment 6 Sam Davis CLA 2012-09-17 14:31:40 EDT
Yes, probably, but I'm not sure what the solution is. Is it moving the deletion logic to the core?
Comment 7 Steffen Pingel CLA 2012-09-17 16:43:56 EDT
I think so. bug 349955 seems related.
Comment 8 Eclipse Webmaster CLA 2022-11-15 11:45:08 EST
Mylyn has been restructured, and our issue tracking has moved to GitHub [1].

We are closing ~14K Bugzilla issues to give the new team a fresh start. If you feel that this issue is still relevant, please create a new one on GitHub.

[1] https://github.com/orgs/eclipse-mylyn