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

Bug 475399

Summary: SelectionModel#updateSelection does not produce accurate events
Product: [Tools] GEF Reporter: Camille Letavernier <cletavernier>
Component: GEF MVCAssignee: Alexander Nyßen <nyssen>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: nyssen
Version: 0.1.0   
Target Milestone: 3.10.1 (Mars SR1) RC2   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Proposed patch nyssen: iplog+

Description Camille Letavernier CLA 2015-08-19 11:24:50 EDT
When using SelectionModel#updateSelection(), the selection change event is not built properly. What happens is that the first step of this method is to clear the current selection, so when building the selection change event, oldSelection is always empty.

This causes some issues, because these events can be ignored when the old value equals the new value (i.e. when updating from a non-empty selection to an empty selection)
Comment 1 Camille Letavernier CLA 2015-08-19 11:40:32 EDT
Created attachment 255958 [details]
Proposed patch

Properly store the current (old) selection before changing it, so that we can produce an accurate change event

This approach duplicates most of the code from select(), so it can probably be improved a little bit further
Comment 2 Alexander Nyßen CLA 2015-08-20 02:48:08 EDT
Camille, thanks for having reported this. Can you please confirm that your contribution conforms to https://www.eclipse.org/legal/CoO.php?
Comment 3 Camille Letavernier CLA 2015-08-20 03:19:36 EDT
I certify that:

I have authored 100% of the contribution.
I have the necessary rights to submit this contribution, including any necessary permissions from my employer.
I am providing this contribution under the license(s) associated with the Eclipse Foundation project I am contributing to.
I understand and agree that Eclipse projects and my contributions are public, and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with the license(s) involved.
Comment 4 Alexander Nyßen CLA 2015-08-20 07:16:51 EDT
Thanks Camille. I applied your changes and pushed them to origin/master. Marking as fixed in 3.10.1 RC2.