Bug 461602

Summary: The LocalResourceCollector is badly updated at external delete/update semantic resource modification
Product: [Modeling] Sirius Reporter: Laurent Fasani <laurent.fasani>
Component: CoreAssignee: Project inbox <sirius.core-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: maxime.porhel, steve.monnier
Version: 2.0.0Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=470457
https://git.eclipse.org/r/148637
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=8e17f58534dc50ad784dc901a240a4723c9904d9
Whiteboard:
Bug Depends on: 459237    
Bug Blocks:    
Attachments:
Description Flags
libraryAndConsumerProjects none

Description Laurent Fasani CLA 2015-03-06 10:26:18 EST
Created attachment 251365 [details]
libraryAndConsumerProjects

scenario:
use capella and import the attach projects libraryAndConsumerProjects
 * open library session
 * open fragment System
 * fragment SystemAnalysis
 * save model.aird
 * unfragment SystemAnalysis
 * fragment SystemAnalysis =>le LRC is not clean
 * unfragment SystemAnalysis
 * save model.aird
 * fragment SystemAnalysis => the model.aird is not modified

The issue comes from the LocalResourceCollector that is badly updated at semantic resource modification.
Comment 1 Laurent Fasani CLA 2015-03-09 11:33:33 EDT
The methods LocalResourceCollector.LocalInverseCrossReferencer.remove/add are overloaded to create bi directional links between used/using resources.

When LocalInverseCrossReferencer.remove(EObject eObject, EReference eReference, EObject crossReferencedEObject), crossReferencedEObject.eResource() can be null if the resource has been unloaded. This leads to let the link between resources  when it should be removed.

A proposal is to maintain a map of EObject to its resource to retreive the resource that was containing the EObject.
Comment 3 Maxime Porhel CLA 2019-08-30 09:23:11 EDT
See work done in Bug 550371, the ResourceLocator has been integrated in the session semantic cross referencer. 

This issue is still existing but some symptoms might be different. 
We made a modification in order to have better results even if the internal state of the IResourceLocator is not valid: the resulting resources are filtered to remove resources with no resource set.