Bug 461602 - The LocalResourceCollector is badly updated at external delete/update semantic resource modification
Summary: The LocalResourceCollector is badly updated at external delete/update semanti...
Status: NEW
Alias: None
Product: Sirius
Classification: Modeling
Component: Core (show other bugs)
Version: 2.0.0   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on: 459237
Blocks:
  Show dependency tree
 
Reported: 2015-03-06 10:26 EST by Laurent Fasani CLA
Modified: 2019-08-30 09:23 EDT (History)
2 users (show)

See Also:


Attachments
libraryAndConsumerProjects (18.47 KB, application/x-zip)
2015-03-06 10:26 EST, Laurent Fasani CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.