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

Bug 558026

Summary: Deleting the container of semantic element of a representation do not close the editor
Product: [Modeling] Sirius Reporter: Maxime Porhel <maxime.porhel>
Component: DiagramAssignee: Maxime Porhel <maxime.porhel>
Status: CLOSED FIXED QA Contact: Maxime Porhel <maxime.porhel>
Severity: normal    
Priority: P3 CC: arthur.daussy, sirius.diagram-inbox
Version: 6.1.3   
Target Milestone: 6.1.4   
Hardware: PC   
OS: Windows 10   
See Also: https://git.eclipse.org/r/154122
https://git.eclipse.org/r/154121
https://git.eclipse.org/r/154123
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=fb35d68e9e19ec82e34977cfb2a034ddff3b852e
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=150812c4573ed203fa0f94b9853a234fa8b539df
https://git.eclipse.org/c/sirius/org.eclipse.sirius.git/commit/?id=93e9a6422e5a6dca1c5ff7be1167e8559e5ec076
Whiteboard:
Bug Depends on: 552839    
Bug Blocks: 553182, 558025    
Attachments:
Description Flags
ProjectToReproduce
none
ProjectToReproduce none

Description Maxime Porhel CLA 2019-12-09 09:13:46 EST
+++ This bug was initially created as a clone of Bug #552839 +++

When a "Delete from the model" action ends by deleting the container of the semantic target of the current opened editor representation, the session seems broken. Here are the list of the following symptoms:

* The editor is still open
* There is no * inidcating that the session is dirty
* The semantic elements are removed but the representation descriptor remains (see screenshot)
* Moving elements in the opened editor ends up with:

Caused by: java.lang.NullPointerException
	at org.eclipse.emf.transaction.RecordingCommand.getActiveTransaction(RecordingCommand.java:250)

The expected behavior would be:

* The editor should be closed
* The representation should be properly deleted
* The semantic elements should be properly deleted

To reproduce:

* Import "org.eclipse.sirius.sample.ecore.design"
* Launch a runtime
* Import the provided project (see attachment)
* Open the unique diagram
* In the opened editor select the package "P1_1_1" and use the action "Delete from model"
Comment 1 Eclipse Genie CLA 2019-12-09 10:11:46 EST
New Gerrit change created: https://git.eclipse.org/r/154122
Comment 2 Eclipse Genie CLA 2019-12-09 10:11:49 EST
New Gerrit change created: https://git.eclipse.org/r/154121
Comment 3 Eclipse Genie CLA 2019-12-09 10:11:51 EST
New Gerrit change created: https://git.eclipse.org/r/154123
Comment 7 Maxime Porhel CLA 2019-12-09 16:34:37 EST
Created attachment 281176 [details]
ProjectToReproduce
Comment 8 Maxime Porhel CLA 2019-12-09 16:44:25 EST
Created attachment 281177 [details]
ProjectToReproduce
Comment 9 Maxime Porhel CLA 2020-02-18 05:41:28 EST
Verified on Sirius 6.1.4-S20200120-085637
Comment 10 Pierre-Charles David CLA 2020-03-09 05:52:15 EDT
Available in Sirius 6.1.4, see https://wiki.eclipse.org/Sirius/6.1.4 for details.