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

Bug 320347

Summary: PartServiceImpl#createPart(MPartDescriptor) is wrong!
Product: [Eclipse Project] e4 Reporter: Thomas Schindl <tom.schindl>
Component: UIAssignee: Thomas Schindl <tom.schindl>
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: P3 CC: bokowski, emoffatt, john.arthorne, pwebster, remy.suen
Version: 0.9Flags: remy.suen: review+
bokowski: review+
Target Milestone: 1.0 RC3   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
patch
none
patch none

Description Thomas Schindl CLA 2010-07-20 02:35:37 EDT
Created attachment 174700 [details]
patch

It takes the attributes from menus/toolbar/handler and *moves* them from the PartDescriptor to the Part-Instance!

This means on 2nd use of the descriptor there are NO menus and Toolbar informations available. One needs to copy those elements because they are containments which means adding them to another container removes them from the original one (you can see that this happens in bug 320235 comment 3)
Comment 1 Thomas Schindl CLA 2010-07-20 02:38:51 EDT
Created attachment 174701 [details]
patch

adds a null check (though not needed technically because EcoreUtil.copy) does such a check too internally it's JavaDoc doesn't say something about it.
Comment 2 Remy Suen CLA 2010-07-20 05:54:38 EDT
Thanks for catching this, Tom.
Comment 3 Boris Bokowski CLA 2010-07-20 14:38:06 EDT
Looks good.
Comment 4 Thomas Schindl CLA 2010-07-20 14:58:16 EDT
fixed in HEAD