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

Bug 319023

Summary: [Model Explorer] Diagram corruption - After copying a model (obtained by a save as command) some diagrams or views in diagrams are lost
Product: [Modeling] Papyrus Reporter: alanusse Mising name <agnes.lanusse>
Component: CoreAssignee: Patrick Tessier <Patrick.Tessier>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: sebastien.gerard, vincent.lorenzo, yann.tanguy
Version: 0.7.0   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Model for saveAs tests none

Description alanusse Mising name CLA 2010-07-06 11:49:18 EDT
Diagrams do not appear in the explorer for a model produced by  a Save as command.
I made a copy of a model containing three diagrams using the Save As command in the Package Explorer. When I open the new model, I cannot see the diagrams in the ModelExplorer while I could see them in the initial model. 

One of the effects is the following: in the model explorer, the diagrams which were present in the initial model are no longer visible in the copy, however they are still present in the diagram views.

Description 
Using the Papyrus perspective
1. I create a model Model using the Papyrus wizard selecting a class diagram
then I create two other diagrams,  a composite diagram and a sequence diagram.
2. I can see all of them in the Model explorer
3. I go in the Package Explorer (My model is active)
4. From the Tool bar I select File > SaveAs> ModelBis
Three files are produced (.di,.notation,.uml)
4. When I open the .di file and I go in the Model explorer I cannot see the diagrams
But in the diagram views I can still see them and navigate.

Remark : Even when diagrams appear in the model explorer trying to select them produces an error (bug 318986).
Comment 1 Patrick Tessier CLA 2011-02-08 11:21:45 EST
I can not reproduce the bug for the version 0.8.0
Comment 2 Yann Tanguy CLA 2012-06-12 05:16:56 EDT
Still reproducible in 0.9.0RC3, marked critical as this lead to diagram corruption.

Can you or someone else try to fix this before RC4 ?
Comment 3 Yann Tanguy CLA 2012-06-13 04:02:50 EDT
Created attachment 217253 [details]
Model for saveAs tests
Comment 4 Yann Tanguy CLA 2012-06-13 04:04:46 EDT
I have attached a model for testing, simple model 2 diagrams.

Not always reproducible, on  my last attempt, first saveAs succeed, the second one (one the initial version) failed.
Comment 5 Vincent Lorenzo CLA 2012-06-13 05:22:08 EDT
Thank you Yann for you example. The problem seems appears with the closed Diagram during the copy.
R8285 : I added an EcoreUtil.resolveAll before the SaveAs, and now it works fine with your example.
Could you confirm that this bug disappears.

I don't close the bug, because a JUnit test should be written to avoid regression.
Comment 6 Patrick Tessier CLA 2012-07-30 05:39:52 EDT
the priority of the bug becomes normal because it remains to add test
Comment 7 Sébastien Gérard CLA 2013-05-24 11:08:35 EDT
Fixed.
Comment 8 Sébastien Gérard CLA 2013-05-24 11:10:24 EDT
fixed.