Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 492634

Summary: DCells are kept when lines are deleted from an edition table.
Product: [Modeling] Sirius Reporter: Yann Mortier <yann.mortier>
Component: TableAssignee: Project Inbox <sirius.table-inbox>
Status: CLOSED FIXED QA Contact: Florian Barbin <florian.barbin>
Severity: normal    
Priority: P3 CC: florian.barbin, maxime.porhel, pierre-charles.david, pierre.guilet
Version: 3.1.0Keywords: triaged
Target Milestone: 4.0.0   
Hardware: PC   
OS: Windows 7   
See Also: https://git.eclipse.org/r/71587
https://git.eclipse.org/r/71588
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=a072d2c1484ee82bfb77cdd9ecdb8f92091b125b
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=6d7e5a887dadb1a3c9a2f72722d08212d2dec9e7
Whiteboard: backport
Attachments:
Description Flags
Reproduction case
none
Corrected test case. none

Description Yann Mortier CLA 2016-04-28 05:08:59 EDT
Sirius version is 3.1.3

When some lines are deleted from a table, the cells of the removed lines are still referenced by the table's columns. It leads to retain references toward deleted semantic objects. 

The problem is that the deleted semantic objects are collected by 

org.eclipse.emf.edit.provider.ItemPropertyDescriptor.collectReachableObjectsOfType(Collection<EObject>, LinkedList<EObject>, Collection<EObject>, EObject, EClassifier)

when the user want to set a property.
Comment 1 Eclipse Genie CLA 2016-04-28 06:02:13 EDT
New Gerrit change created: https://git.eclipse.org/r/71587
Comment 2 Eclipse Genie CLA 2016-04-28 06:02:16 EDT
New Gerrit change created: https://git.eclipse.org/r/71588
Comment 3 Maxime Porhel CLA 2016-04-28 08:08:49 EDT
Created attachment 261335 [details]
Reproduction case

Steps to reproduce: 
 . unzip the attached data
 . open the 492634 table
 . select the "neweclass1 : NewEClass1" reference and look at the EType possible values in the properties view: you should see NewEClass1, NewEClass2 and NewEClass3 (among ecore types) 
 . delete the line "NewEClass3"
 . re-select the "neweclass1 : NewEClass1" reference and check the proposed values for EType in the properties view. 

NewEClass3 must not be proposed anymore as it has been deleted (detached/removed from its resources and all semantic references to it have been removed)
Comment 6 Maxime Porhel CLA 2016-05-11 10:05:37 EDT
Resolved on master for 4.0.0 RC1
Comment 7 Florian Barbin CLA 2016-05-26 05:04:19 EDT
I followed the use case described here https://bugs.eclipse.org/bugs/show_bug.cgi?id=492634#c3 and the NewEClass3 is still available in the EType choices after having deleted it.
Comment 8 Maxime Porhel CLA 2016-05-26 10:03:18 EDT
It is my mistake, I have added a diagram in the reproduction use case. This diagram contains a DNodeList showing the EClass3. As the diagram is closed in the scenario, it is not refreshed and the EClass3 can still be found.

This bugzilla is about the DCells kept by the refresh of the current opened table, this does not invalidate the correction. 
I will update a corrected reproduction case soon.
Comment 9 Maxime Porhel CLA 2016-05-26 10:08:43 EDT
Created attachment 262029 [details]
Corrected test case.
Comment 10 Florian Barbin CLA 2016-05-26 11:39:32 EDT
Verified on Sirius 4.0.0.RC2
Comment 11 Pierre-Charles David CLA 2016-06-24 08:01:28 EDT
Available in Sirius 4.0.0.
Comment 12 Pierre Guilet CLA 2017-03-21 09:08:32 EDT
*** Bug 473842 has been marked as a duplicate of this bug. ***