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

Bug 522368

Summary: Internationalized palette elements are duplicated on reload
Product: [Modeling] Sirius Reporter: Pierre-Charles David <pierre-charles.david>
Component: DiagramAssignee: Florian Barbin <florian.barbin>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: florian.barbin, julien.dupont
Version: 4.1.1Keywords: triaged
Target Milestone: 4.1.8   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/111707
https://git.eclipse.org/r/111782
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=467a61c65a6a04fb01bd3ddd603aa664737cf627
Whiteboard:
Bug Depends on:    
Bug Blocks: 527397    
Attachments:
Description Flags
Sample modeler to reproduce the issue
none
Sample session to reproduce the issue
none
Screenshot showing duplicated entries
none
Sample modeler to reproduce the issue
none
Sample session to reproduce the issue none

Description Pierre-Charles David CLA 2017-09-15 09:02:12 EDT
When a model reload triggers a DDiagramEditorImpl.setInput(), elements from the palette which are configured to be internationalized are duplicated.
Comment 1 Pierre-Charles David CLA 2017-09-15 09:07:34 EDT
Created attachment 270221 [details]
Sample modeler to reproduce the issue
Comment 2 Pierre-Charles David CLA 2017-09-15 09:07:54 EDT
Created attachment 270222 [details]
Sample session to reproduce the issue
Comment 3 Pierre-Charles David CLA 2017-09-15 09:08:40 EDT
Created attachment 270223 [details]
Screenshot showing duplicated entries
Comment 4 Pierre-Charles David CLA 2017-09-15 09:12:12 EDT
Steps to reproduce:
1. Import the attached modeler.
2. Launch a separate runtime.
3. In the runtime, import the attached sample session.
4. Open the session and the diagram inside. The diagram is empty, and the palette shows a single section ("Outils") with a single entry ("Créer").
5. Open the MyEcore.ecore semantic model using a text editor (from Eclipse or outside, it doesn't matter). Add some blank lines at the end and save the file. If you modified the file from outside Eclipse you may need to refresh the workspace (or wait for it to happen automatically).
6. Go back to the diagram: the elements in the palette have been duplicated (sometimes twice, producing 3 copies).
Comment 5 Pierre-Charles David CLA 2017-09-15 09:16:11 EDT
The culprit seems to be PaletteManagerImpl.getPaletteEntry(PaletteContainer, String, Class<SectionPaletteDrawer>): to compare already existing palette entries with the complete set that should be visible, it compare the translated version of the label (e.g. "Outils") with the raw translation key from the VSM model (e.g. "%Tools"). They are always different so it always decide to add new entries instead of merging candidate entries with the already existing equivalents.
Comment 6 Pierre-Charles David CLA 2017-10-19 09:16:43 EDT
Not sure we'll have time to look at this for 4.1.7 should should normally be released very soon (maybe tomorrow), but I'm putting it here anyway, in case 4.1.7 slips by a few days, and to avoid forgetting it. If 4.1.7 is released without this, I'll move it to 4.1.8.
Comment 7 Eclipse Genie CLA 2017-11-16 09:04:04 EST
New Gerrit change created: https://git.eclipse.org/r/111707
Comment 9 Julien Dupont CLA 2017-12-07 09:16:22 EST
Created attachment 271809 [details]
Sample modeler to reproduce the issue
Comment 10 Julien Dupont CLA 2017-12-07 09:16:48 EST
Created attachment 271810 [details]
Sample session to reproduce the issue
Comment 11 Pierre-Charles David CLA 2017-12-08 03:26:35 EST
Available in Sirius 4.1.8, see https://wiki.eclipse.org/Sirius/4.1.8