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

Bug 529615

Summary: Memento could fail if representation split is activated
Product: [Modeling] Sirius Reporter: Laurent Fasani <laurent.fasani>
Component: CoreAssignee: Project inbox <sirius.core-inbox>
Status: CLOSED FIXED QA Contact: Florian Barbin <florian.barbin>
Severity: normal    
Priority: P3 CC: florian.barbin, pierre-charles.david
Version: 5.1.0Keywords: triaged
Target Milestone: 6.0.0   
Hardware: All   
OS: All   
See Also: https://git.eclipse.org/r/115128
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=bc43b06ef40f17e31a85e6e7b552967b24fcc3ba
Whiteboard:

Description Laurent Fasani CLA 2018-01-10 04:06:43 EST
This ticket is to support scenario when the representation split is activated and where the creation of a resource in the resource would have unexpected result if the resource physically exists.

scenario:
* create a modeling project with a representation
* open the representation
* restart eclipse

The following code is called to create the resource containing the representation.
domain.getResourceSet().createResource(uri.trimFragment());
It has no meaning to create a represenation resource because the aim is to load an existing one.

So, as the resource exists physically, we should call domain.getResourceSet().getResource(uri.trimFragment(), true)

As homologation scenario, execute the previous one and check that the representation editor is opened after restarting the eclipse that is there is no regression.
Comment 1 Laurent Fasani CLA 2018-01-10 04:22:27 EST
The homologation scenario must be done in representation split mode and non split.
-non split mode scenario is needed to test the non regression
-split mode scenario is usefull because the potential issue would probably occur in that mode.(Indeed, before executing domain.getResourceSet().createResource, the session is opened and all resources are already loaded and then createResource is not called in non split mode) 

To activate the rep split for local project, start eclipse with -DcreateLocalRepresentationInSeparateResource=true property system.
Comment 2 Laurent Fasani CLA 2018-01-10 05:29:49 EST
added https://git.eclipse.org/r/#/c/115128/
Comment 4 Laurent Redor CLA 2018-06-27 11:54:59 EDT
Available in Sirius 6.0.0, see https://wiki.eclipse.org/Sirius/6.0.0 for details