Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 320347 - PartServiceImpl#createPart(MPartDescriptor) is wrong!
Summary: PartServiceImpl#createPart(MPartDescriptor) is wrong!
Status: RESOLVED FIXED
Alias: None
Product: e4
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 0.9   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 critical (vote)
Target Milestone: 1.0 RC3   Edit
Assignee: Thomas Schindl CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-20 02:35 EDT by Thomas Schindl CLA
Modified: 2010-07-20 14:58 EDT (History)
5 users (show)

See Also:
remy.suen: review+
bokowski: review+


Attachments
patch (2.24 KB, patch)
2010-07-20 02:35 EDT, Thomas Schindl CLA
no flags Details | Diff
patch (2.29 KB, text/plain)
2010-07-20 02:38 EDT, Thomas Schindl CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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