Bug 440030 - [Model] ModelAssembler always merges elements even when fragment apply policy is "notexists"
Summary: [Model] ModelAssembler always merges elements even when fragment apply policy...
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.4   Edit
Hardware: PC Windows 8
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 487748 547503 (view as bug list)
Depends on:
Blocks: 562497 546777
  Show dependency tree
 
Reported: 2014-07-21 12:14 EDT by Sun Volland CLA
Modified: 2021-06-04 00:54 EDT (History)
6 users (show)

See Also:


Attachments
Basic E4 application to show the not_exists merge problem (16.29 KB, application/octet-stream)
2015-03-18 12:23 EDT, Sun Volland CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sun Volland CLA 2014-07-21 12:14:19 EDT
fragment.merge() is always called (line 192) even when the element already exists and notexists tag is set.
Comment 1 Sun Volland CLA 2014-10-13 15:09:38 EDT
Pushed a fix to https://git.eclipse.org/r/34817
Comment 2 Sun Volland CLA 2015-03-18 12:23:11 EDT
Created attachment 251707 [details]
Basic E4 application to show the not_exists merge problem

The zip contains a simple e4 application project to reproduce this issue  :

- test-fragments is the main plugin containing the application model

- fragment is a plugin that contributes a part to the main model using a fragment.xmi. This fragment is contributed using the "notexists" apply policy (see extensions tab of plugin.xml, fragment extension element details), meaning the fragment shall be merged only if not already found in the application model.

Launch the app (clear workspace when prompted), select the "Fragment Part" view and click the button inside : this changes the label of the part to "Label 0", "Label 1", etc.
Now quit the app and restart it without clearing the workspace.
You'll notice that the contributed part is named "Fragment Part" again, meaning the fragment was merged again in the application model despite being tagged "notexists".
Comment 3 Sun Volland CLA 2015-03-18 12:25:01 EDT
I forgot to mention that the example runs with Luna SR2 target platform
Comment 4 Rolf Theunissen CLA 2019-06-01 16:58:47 EDT
*** Bug 487748 has been marked as a duplicate of this bug. ***
Comment 5 Rolf Theunissen CLA 2019-06-01 17:01:05 EDT
*** Bug 547503 has been marked as a duplicate of this bug. ***
Comment 6 Eclipse Genie CLA 2019-06-21 08:21:38 EDT
New Gerrit change created: https://git.eclipse.org/r/144622
Comment 7 Wernke zur Borg CLA 2020-09-15 09:20:45 EDT
This problem is hitting us really badly because parts get duplicated on restart after they were moved to a different part stack.

I do not quite understand why the proposed fix is not getting accepted Jonas' comment does not make much sense to me either.

Can we do anything to get it merged?
Comment 8 Alexander Kurtakov CLA 2021-01-07 03:07:40 EST
Mass move 4.19 M1 bugs to M3
Comment 9 Niraj Modi CLA 2021-02-19 07:59:12 EST
Removing milestone from 4.19 M3 to 4.19, please re-target accordingly.
Comment 10 Kalyan Prasad Tatavarthi CLA 2021-03-02 02:07:40 EST
Mass move out of 4.19
Comment 11 Kalyan Prasad Tatavarthi CLA 2021-06-04 00:54:31 EDT
Mass Move out of 4.20