| Summary: | Representation disappears from Model Explorer on session reload | ||
|---|---|---|---|
| Product: | [Modeling] Sirius | Reporter: | Esteban DUGUEPEROUX <esteban.dugueperoux> |
| Component: | Core | Assignee: | Laurent Redor <laurent.redor> |
| Status: | CLOSED FIXED | QA Contact: | Belqassim Djafer <belqassim.djafer> |
| Severity: | normal | ||
| Priority: | P3 | CC: | belqassim.djafer, florian.barbin, laurent.redor |
| Version: | 2.0.0 | Keywords: | triaged |
| Target Milestone: | 3.0.0M5 | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Bug Depends on: | |||
| Bug Blocks: | 457265 | ||
| Attachments: | |||
Issue reproduced on Sirius master This regression is certainly due to bug 442337 that optimizes the DialectServices.getRepresentations(EObject, Session) by using the CrossReferencer. But in case of semantic reloading, the crossReferencer does not work. I confirm the source of the regression. Reverting the 2 commits [1] and [2] of bug 442337 solves the problem. [1] http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=b0db82260a3846ca89eb22f60ed46c8393510e50 [2] http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=a4ba105590228efbe30bfa9bde4509a23b061865 Created attachment 249825 [details]
Simple Junit test that focus on the problem of crossReference broke after a reloading
Created attachment 249857 [details]
Simple Junit test that focus on the problem of crossReference broke after a reloading
This new version of test is more complete after analysis of the problem. There are:
* 2 tests with and without resolution proxy
* 2 tests with proposed solution to avoid to always do proxy resolution
Created attachment 249858 [details]
Simple Junit test that focus on the problem of crossReference broke after a reloading
Analysis: When a resource is unloaded and the reloaded, all cross-references that point to this resource are "KO". They are stored in crossReferencer#inverseCrossReferencer#proxyMap. We should ask the cross-referencer to resolve the proxy (calling ECrossReferenceAdapter.getInverseReferences(EObject, boolean) with boolean set to true). This is a first option but at each use of cross-referencer, there is a resolution cost even if in most cases this is unnecessary. Another option is to force the resolution just after the unload/reload of a resource made by Sirius. Proposed fix here: https://git.eclipse.org/r/39398 This fix breaks API and is not applicable on maintenance branch. I will try to adapt it for maintenance branch. Created attachment 250088 [details]
Simple Junit test that focus on the problem of crossReference broke after a reloading
The test has been completed for another solution that works even with target platform Kepler and Juno (see bugzilla 457265 for details)
Another commit [1] has been necessay to fix the problem for post Juno target platfrom (see bug 457265 comment 6 and bug 457265 comment 7 for more details) [1] http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=fb6277008e1b9f83dd4330568fe54dc3bce4e959 A test has also been added: http://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=7d5d88dcf2b3eb0ccea1a1bcdffa34033cdedbe2 Verified on Sirius 3.0.0M6 Verified with Sirius 3.0.0 RC1 Available in Sirius 3.0.0. See https://wiki.eclipse.org/Sirius/3.0.0. |
Created attachment 248829 [details] An example to reproduce Using the attached example : 1. open My.ecore 2. Expand the My.ecore from Model Explorer to see the diagram under the root package. 3. In the My.ecore opened with the Sample Ecore Model Editor, copy and paste "c1" then save 4. Under My.ecore in Model Explorer, the root EPackage is collapsed and when you expand it the diagram does not appears. It appears only under the .aird hierarchy. We must close and reopen the Modeling Project to see again the diagram under root EPackage in Model Explorer or do another changes in the Sample Ecore Model Editor.