| Summary: | Unstability on resource reload | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Modeling] Sirius | Reporter: | Belqassim Djafer <belqassim.djafer> | ||||||||||
| Component: | Core | Assignee: | Project inbox <sirius.core-inbox> | ||||||||||
| Status: | CLOSED FIXED | QA Contact: | Belqassim Djafer <belqassim.djafer> | ||||||||||
| Severity: | normal | ||||||||||||
| Priority: | P3 | CC: | laurent.redor, pierre-charles.david, steve.monnier | ||||||||||
| Version: | unspecified | Keywords: | triaged | ||||||||||
| Target Milestone: | 3.0.0M6 | ||||||||||||
| Hardware: | PC | ||||||||||||
| OS: | Windows 8 | ||||||||||||
| Whiteboard: | |||||||||||||
| Bug Depends on: | 458721 | ||||||||||||
| Bug Blocks: | |||||||||||||
| Attachments: |
|
||||||||||||
Created attachment 250189 [details]
Unstability on session reload
Replace the previous rar archive with a zip one
For information, org.eclipse.sirius.diagram.ui.tools.internal.providers.decorators.EditModeDecorator.getDecorationImage(EditPart) "makes" the red crosses. The problem is linked to the fragment. I have created a junit test to isolate the problem: "EMFUnloadWithStrangeProxyURITests". In this test, we can see that the test testURIAfterUnloadWithoutFragment() is OK but the test testURIAfterUnloadWithFragment() is KO. There is several sysout in these tests that reveal that after unload, in case of fragment, the URI of the proxy is file:/pathToGit/org.eclipse.sirius/plugins/org.eclipse.sirius.tests.junit/B1.ecore#//b2.1/ClassB instead of file:/pathToGit/org.eclipse.sirius/plugins/org.eclipse.sirius.tests.junit/B1.ecore#//b2/ClassB Created attachment 250265 [details] JUnit test corresponding to comment 3 Created attachment 250268 [details] JUnit test corresponding to comment 3 New version of the JUnit test (simpler, more focused on the problem) I posted this [1] on EMF forum to have help on this bug [1] https://www.eclipse.org/forums/index.php/t/967104/ By adapting the JUnit test, I observed that the behavior is different if B1.ecore is a fragment of B.ecore or if B1.ecore is a "standalone" resource. In case of B1.ecore as "standalone" resource, the behavior is OK. But if B1.ecore is a fragment, there is the mentioned bug. The difference is in BasicEObjectImpl.eInternalResource(). In case of "standalone" resource, no resource is returned. And so the proxy is not resolved. But in case of fragment, the "parent" resource is returned, B.ecore, in our case. And this is sufficient to resolve the proxy and then have the problem. EPackageImpl(BasicEObjectImpl).eInternalResource() line: 939 EPackageImpl(BasicEObjectImpl).eResource() line: 920 EcoreUtil.resolve(EObject, EObject) line: 258 EPackageImpl(BasicEObjectImpl).eResolveProxy(InternalEObject) line: 1473 EObjectContainmentWithInverseEList$Resolving<E>(EcoreEList<E>).resolveProxy(EObject) line: 206 EObjectContainmentWithInverseEList$Resolving<E>(EcoreEList<E>).resolve(int, EObject) line: 161 EObjectContainmentWithInverseEList$Resolving<E>.resolve(int, E) line: 105 EObjectContainmentWithInverseEList$Resolving<E>(BasicEList<E>).get(int) line: 348 ENamedElementImpl$1$1(EContentsEList$FeatureIteratorImpl<E>).hasNext() line: 471 EPackageImpl(EModelElementImpl).eURIFragmentSegment(EStructuralFeature, EObject) line: 332 EcoreResourceFactoryImpl$1(ResourceImpl).getURIFragment(EObject) line: 680 EcoreResourceFactoryImpl$1(XMLResourceImpl).getURIFragment(EObject) line: 630 EcoreResourceFactoryImpl$1(ResourceImpl).unloaded(InternalEObject) line: 1594 EcoreResourceFactoryImpl$1(ResourceImpl).doUnload() line: 1655 EcoreResourceFactoryImpl$1(XMLResourceImpl).doUnload() line: 713 EcoreResourceFactoryImpl$1(ResourceImpl).unload() line: 1670 EMFUnloadWithStrangeProxyURITests.init(boolean) line: 114 EMFUnloadWithStrangeProxyURITests.testURIAfterUnloadWithFragment() line: 51 Work interrupted: Waiting news about bug 458721 The fix proposed by Ed in bug 458721 fix the problem. The problem is solved by bug 458721 (it will be available only on Mars TP). KO on Sirius 3.0.0M6 Because the proposed fix in bug 458721 in not included in Eclipse Mars Verified with Sirius 3.0.0 RC1 Available in Sirius 3.0.0. See https://wiki.eclipse.org/Sirius/3.0.0. |
Created attachment 250148 [details] Unstability on session reload Instabilities occur when reloading resources. To reproduce : 1- Extract and import the attached projects in the workspace. 2- Open "P0 representation" in the LoadResource project. 3- By using tools, create a new Container, BorderedNode and a new Reference between the created BorderedNode and "C4" BorderedNode. 4- Save the representation. 5- Open LoadResourceToPast project and copy My_P0.aird and My_P0.ecore files. Past them into LoadResource project (Click yes to replace files). 6- New created elements dispears from the representation -> OK. But also BorderedNodes are deleted and red crosses appears -> KO