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

Bug 369789

Summary: EReference setEType(null) and wrong change description
Product: [Modeling] EMF Reporter: Maxime Porhel <maxime.porhel>
Component: EditAssignee: Ed Merks <Ed.Merks>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: cedric.brun
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Maxime Porhel CLA 2012-01-26 06:15:38 EST
Build Identifier: 20110916-0149

When setting the eType of a reference from an EClass to null, the change is not well recorded.

I could reproduce with the Sample Ecore Editor, when unsetting the eType reference from the properties view : the change is not reverted when using undo.

The SetCommand executed from the properties view is not able to undo the change : during prepare it sets the oldValue to SetCommand .UNSET_VALUE because myRef.eIsSet(eGenericType) return false (event if there is a value).







Reproducible: Always

Steps to Reproduce:
It can be reproduced with the Sample Ecore Editor and the following steps.

1. Create an ecore model.
2. Create 2 EClass : c0 and c1
3. Add a new EReference in C0
4. Set its eType to C1

5. Undo/Redo unset/reset the reference : ok

6. Set the eType to null
7. Undo do not change the eType back to C1 : ko
Comment 1 Maxime Porhel CLA 2012-01-26 06:17:06 EST
The current behavior is the same with eclipse 3.3, 3.6, 3.7
Comment 2 Ed Merks CLA 2012-01-26 07:12:33 EST
The fix (specialize set command to record proper old value) has been committed to git for 2.8.
Comment 3 Maxime Porhel CLA 2012-01-26 09:03:35 EST
Hi Ed, 

Thanks for the correction on 2.8 but Indigo SR2 is coming soon. So could you commit the fix for 2.7 ?
Comment 4 Ed Merks CLA 2012-01-27 01:57:36 EST
Normally I'd not deal with this in the maintenance stream because it's really not all that serious a problem that many people would notice but given that Obeo is asking and considering how much Obeo does for open source, I'll make an exception and commit this fix for the upcoming 2.7.2 release.
Comment 5 Cedric Brun CLA 2012-01-27 03:55:34 EST
That's indeed helping us providing a polished product.

Thanks Ed :)
Comment 6 Maxime Porhel CLA 2012-01-27 03:58:45 EST
Thanks Ed
Comment 7 Ed Merks CLA 2012-03-31 14:24:06 EDT
The changes are available in the M6 build.