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

Bug 473842

Summary: Line suppression does not suppress all cells of the tables causing problems
Product: [Modeling] Sirius Reporter: Pierre Guilet <pierre.guilet>
Component: TableAssignee: Project Inbox <sirius.table-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: major    
Priority: P3 CC: maxime.porhel
Version: 3.0.0Keywords: triaged
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
A table to reproduce the bug none

Description Pierre Guilet CLA 2015-07-29 09:39:13 EDT
Created attachment 255510 [details]
A table to reproduce the bug

With certain condition, the Sirius generic line suppression does not remove all cells of the line from the table with columns. The line is removed but not all the cells even if we don't see the cell not deleted.

This can provoks a bug were in other view like diagram one, property descriptor for references with the type of the deleted element  still provides the possibility to reference the deleted element because references are not cleaned in this descriptors.

The attached model allows the reproduction of the problem.

The scenario to reproduce is the following :
I initialize a class table from the metamodel.

I delete the A element. I save.

With the interpreter I look at the cells with the expression [self.eContainer(DTable).columns.cells/] and I see the cell that should have been deleted with the A element suppression.
Comment 1 Maxime Porhel CLA 2015-07-29 09:42:50 EDT
It seems that the delete tasks and/or the dangling ref removal trigger might be improved to better clean some parts of the Sirius model. 

This could also come from the Table/Tree refresh which does not seem to clean the cells  list.
Comment 2 Maxime Porhel CLA 2015-07-29 09:50:38 EDT
See org.eclipse.sirius.table.business.internal.refresh.DTableSynchronizerImpl.fillTableDCells(LineContainer)

It iterates over the lines feature but in this scenario: a line has been deleted, some cells are still referenced from the features. 

We might have to: 
 . add a columns.cells clean step
 . override org.eclipse.sirius.business.internal.helper.task.DeleteDRepresentationElementsTask.addDialectSpecificAdditionalDeleteSubTasks(DSemanticDecorator, List<ICommandTask>) in the table command factory
Comment 3 Maxime Porhel CLA 2015-07-29 09:55:01 EDT
Step 1.1 and 1.2 might also have to be updated to do different things as told in the comments: org.eclipse.sirius.business.api.helper.task.DeleteEObjectTask.execute()
Comment 4 Pierre Guilet CLA 2017-03-21 09:08:32 EDT

*** This bug has been marked as a duplicate of bug 492634 ***