Community
Participate
Working Groups
Created attachment 188748 [details] Simple model for getting the issue Here is one issue in updating metaclasses instances number (left panel of model browser) when one model is updated. Opening the attached uml model : leftPanel displays TemplateSignature(1). Then, in executing following update on the model : TemplateSignature newTS = UMLFactory.INSTANCE.createTemplateSignature(); model.setOwnedTemplateSignature(newTS); Then, the old TemplateSignature does not below to the model anymore. But leftPanel will display TemplateSignature(2).
The problem is in MetaclassInstancesAdapter.handleChanged() method. The old TemplateSignature is not removed from the Maps. Calling "setOwnedTemplateSignature" produces 3 events : - SET from old TS to null (reference template "container") - SET from model to newTS (reference ownedTemplateSignature "containment") - SET from newTS to model (reference template "container") There is no event "SET from model to null" which would remove old TS from cache.
Created attachment 188777 [details] Proposed MetaclassInstancesAdapter patch Nicolas, could you have a look on the proposed patch ? I also fix another problem : the management of EObject which is moved from Resource.contents to another EObject.
Nicolas Bros, could you have a look on the proposed patch ? I also fix another problem : the management of EObject which is moved from Resource.contents to another EObject.
Created attachment 188780 [details] Proposed MetaclassInstancesAdapter patch last patch was not based on last revision.
Comment on attachment 188780 [details] Proposed MetaclassInstancesAdapter patch I have reviewed your patch, and it looks OK. You can commit it.
The fix has been commited into SVN (rev 3905) with its associated junit test.
Bug solved.