Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 375269 - Menus items from fragments multiply after restart (MCommand persistence is wrong)
Summary: Menus items from fragments multiply after restart (MCommand persistence is wr...
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.2   Edit
Hardware: PC Linux
: P3 critical (vote)
Target Milestone: 4.2 M7   Edit
Assignee: Oleg Besedin CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 375375 (view as bug list)
Depends on: 375375
Blocks:
  Show dependency tree
 
Reported: 2012-03-25 04:58 EDT by Karl Weber CLA
Modified: 2012-05-01 11:44 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Karl Weber CLA 2012-03-25 04:58:47 EDT
I am bold and mark it critical... :)

I have some model fragments defined through fragment.e4xmi files. All menu items specified in these fragments show up only once if the application is started for the first time. If the application is restarted for the first time, these menu items show up twice, if the application is started for the second time, they are shown trice, ... and if it is started for the n-th time, they are shown (n+1)-times.

When the run-time workspace data are cleared, the menu items again show up only once.

Menu items specified in Application.e4xmi are not affected.

As far as I can tell, the MCommand model elements are persisted multiple times, if the application is stopped.

I am using http://download.eclipse.org/eclipse/updates/4.2-I-builds as target. The problem showed up after my latest update.
Comment 1 Brian de Alwis CLA 2012-03-25 14:13:00 EDT
*** Bug 375264 has been marked as a duplicate of this bug. ***
Comment 2 Oleg Besedin CLA 2012-03-26 14:44:04 EDT
I can duplicate it.
Comment 3 Oleg Besedin CLA 2012-03-26 16:00:19 EDT
I added model fragment to the contacts demo so that this problem would be easier to see in future, Git reference:

http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=d260d1bea8f977b396660fad7a4acb81075054bc

(adds Help -> Feedback menu item)

The fix is:

http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=4d10c1a37a911bb20f12b49088e20d72ed1eb9ea

Rather then adding items, we check if there is an item with the same ID and if it needs to be updated.

Hopefully, we can spend more time in 4.3 on the RCP side, the model assembly story could be improved.
Comment 4 Oleg Besedin CLA 2012-03-27 10:43:27 EDT
*** Bug 375375 has been marked as a duplicate of this bug. ***
Comment 5 Oleg Besedin CLA 2012-05-01 11:44:10 EDT
Verified using I20120430-1800.