Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 329071 - [context] newly activated task gets polluted with last selected element in previous task
Summary: [context] newly activated task gets polluted with last selected element in pr...
Status: CLOSED MOVED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Mylyn (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Mylyn Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-29 13:33 EDT by Sam Davis CLA
Modified: 2011-08-11 08:31 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Davis CLA 2010-10-29 13:33:59 EDT
Sometimes, when I activate a task, the element that I had previously selected before activating the task gets added to the new task's context. I'm not sure under what conditions this happens. It might have something to do with Eclipse batching selection events and sending them after the task has activated. Maybe the fix is to check the date stamps on the events and ignore any that are from before the task was activated.
Comment 1 Steffen Pingel CLA 2010-11-08 05:34:06 EST
The context stores the last selection that was active when a task is deactivated. The reason is to provide a minimal editor restore even if a workbench memento is not available. 

Shawn, does this still make sense? Shouldn't we check if the active selection is also part of the context?
Comment 2 Shawn Minto CLA 2010-12-07 13:04:55 EST
This sounds like a different problem actually since it has to do with the previously selected element and not the active selection.  Sam, have you been able to track down how this could be reproduced so that I can investigate what the problem could be?
Comment 3 Steffen Pingel CLA 2011-04-05 15:20:40 EDT
Sam, are you still seeing this consistently?
Comment 4 Sam Davis CLA 2011-04-05 15:58:39 EDT
I think I still see this. I definitely am sometimes surprised by what's in my context.
Comment 5 Sam Davis CLA 2011-04-27 17:13:10 EDT
I just created a new task, activated it, selected a couple of things, submitted the task, and then noticed that my context included a method I looked at several hours ago. The method is not in the context of the task I was working on most recently.
Comment 6 Shawn Minto CLA 2011-05-06 13:39:01 EDT
This is really interesting. I dont know how this can actually happen.  We should look at adding some logging in your workspace to figure out how these events are getting into your new context.
Comment 7 Sam Davis CLA 2011-06-23 14:23:51 EDT
It's rather strange that I didn't see the previous comment until I opened this task just now, was told it had incoming changes, and clicked refresh. Anyway, I will consider adding logging when I have time.
Comment 8 Steffen Pingel CLA 2011-08-11 08:31:13 EDT
Looking at the Java monitor implementation, there is some funky code that retains the previous selection to determine if an interaction is an edit or selection. Is it possible that that is causing the described bug?
Comment 9 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