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

Bug 437099

Summary: Repair action should not save the session when the user choice is No.
Product: [Modeling] Sirius Reporter: Maxime Porhel <maxime.porhel>
Component: CoreAssignee: Maxime Porhel <maxime.porhel>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P3 CC: pierre-charles.david
Version: 0.9Keywords: triaged
Target Milestone: 2.0.0   
Hardware: PC   
OS: Windows NT   
Whiteboard: trivial
Bug Depends on:    
Bug Blocks: 437542    

Description Maxime Porhel CLA 2014-06-11 04:17:08 EDT
Repair action should not save the session when the user choice is No. In this case the expected behavior is to close the session without saving it. 

The issues comes from a wrong report. 
It has been introduced by commit 825388b5e120bfe30c75e8bf0539bf1736fadc23 (2013-09-18 09:58:41) Report recent code changes from the previous code base.

>  if (saveSessions) {
>   session.save();
>  }
>  session.close();

became 

>  if (saveSessions) {
>   session.save(new NullProgressMonitor());
>  }
>  session.save(new NullProgressMonitor());

instead of 

>  if (saveSessions) {
>   session.save(new NullProgressMonitor());
>  }
>  session.close(new NullProgressMonitor());

(as it was done in the Viewpoint repository, commit e4ba2e3c3989c89cb598e90d334523285809df35)
Comment 1 Maxime Porhel CLA 2014-06-11 04:27:32 EDT
See https://git.eclipse.org/r/28315
Comment 2 Maxime Porhel CLA 2014-06-16 11:21:09 EDT
Corrected by commit 3eb1bf031d64711399216968e119f890af8e9ed7
Comment 3 Maxime Porhel CLA 2014-08-18 04:59:31 EDT
Steps to reproduce: 
. Open/create a session an a sample model. 
. Open/create a diagram, save
. make a modification (move an element at the bottom right for example)
. do not save, the editor should be dirty
. right-clic on the aird -> repair
. clic on No when the action asks to save the session
. the repair is done
. reopen the diagram
. you must not see the modifications done after the save (step3). They must be reverted between choice No and repair.
Comment 4 Pierre-Charles David CLA 2014-10-27 06:52:22 EDT
Available in Sirius 2.0.0.
Comment 5 Pierre-Charles David CLA 2014-11-05 04:11:51 EST
Removing the "backport" tag; this was indeed backported to Sirius 1.0.1 as bug 437542.