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

Bug 248069

Summary: EObjectObservableMap should allow to observe none existant attributes
Product: [Modeling] EMF Reporter: Thomas Schindl <tom.schindl>
Component: CoreAssignee: Ed Merks <Ed.Merks>
Status: VERIFIED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: Alfredo.Bencomo, arash.aghevli, eclipse-bugs
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
URL: http://www.eclipsezone.com/eclipse/forums/t112822.html
Whiteboard:
Attachments:
Description Flags
A first patch
none
Example project
none
Improved fix. none

Description Thomas Schindl CLA 2008-09-21 16:12:49 EDT
Created attachment 113085 [details]
A first patch

The title seems confusing though it isn't really. ObservableMaps are used most of the times int Table/Tree implementations in conjunction with JFace-LabelProviders and there often the value observed is different. The same feature for JavaBeans is discussed in bug 247997 and the implementation for EMF seems even simpler but would align to the proposed one from JavaBeans. This a first draft implementation for EMF which currently would throw an NPE.
Comment 1 Thomas Schindl CLA 2008-09-21 16:21:58 EDT
Created attachment 113086 [details]
Example project
Comment 2 Ed Merks CLA 2008-10-17 07:35:37 EDT
Tom,

I'll try to catch up with my backlog of committable things next week when I'm back from Germany...
Comment 3 Ed Merks CLA 2008-10-21 06:43:06 EDT
Created attachment 115671 [details]
Improved fix.

Tom, this is a more general approach that takes some of the gross XML Schema-isms into account. Note that I've guarded only to the doGet.  I suspect that the doPut should fail since it doesn't make sense to try to modify something that doesn't exist and won't persist the state you are trying to set.  Maybe that's a bad assumption and I need the same guard for the doPut case?  Please advise.
Comment 4 Thomas Schindl CLA 2008-10-21 06:56:14 EDT
You don't need to guard doPut, so your patch is perfect.
Comment 5 Ed Merks CLA 2008-10-21 07:04:27 EDT
The changes have been committed to CVS for 2.5.
Comment 6 Nick Boldt CLA 2008-10-30 22:58:22 EDT
Fix available in HEAD: 2.5.0.I200810211800.
Comment 7 Dave Steinberg CLA 2009-06-25 02:57:05 EDT
Fix available in HEAD: 2.5.0 (R200906151043).