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

Bug 457435

Summary: StackOverFlows and NPEs when session not loaded from memento
Product: [Modeling] Sirius Reporter: Maxime Porhel <maxime.porhel>
Component: CoreAssignee: Maxime Porhel <maxime.porhel>
Status: CLOSED FIXED QA Contact: Maxime Porhel <maxime.porhel>
Severity: critical    
Priority: P3 Keywords: triaged
Version: 2.0.0   
Target Milestone: 2.0.3   
Hardware: PC   
OS: Mac OS X   
Whiteboard:
Bug Depends on:    
Bug Blocks: 457443    

Description Maxime Porhel CLA 2015-01-14 06:04:52 EST
In some cases, when Eclipse is restarted after a close with opened Sirus editor(s), when the session cannot be loaded or when an OperationCanceledException occurs, the editor is partially loaded in error and a lot of StackOverFlowsErrors and NPEs are thrown on every mouse clicks (set focus, clic in editor, attempt to close the editor, ..). 


Steps to reproduce: 
* Open/Create a session.
* Open/Create a diagram (optional: and a tree/table editor)
* Save
* Restart Eclipse
* During the restart: cancel the load
* The diagram editor is loaded with errors
* Try to close it or to use your IDE: a lot of NPE, unhandled event loop, stack overflows occur.
Comment 1 Maxime Porhel CLA 2015-01-14 06:17:51 EST
See https://git.eclipse.org/r/39574

Scenario for developers: in DAnalysisSessionImpl.open(), add a throws new OperationCanceledException to have nothing to do during reload step. 

The provided patch make the SessionInputEditorFactory return null when we detect that the load from memento is not valid. 

The editor displays : Factory org.eclipse.sirius.ui.business.api.session.SessionEditorInputFactory returned null from createElement for editor id=org.eclipse.sirius.diagram.ui.part.SiriusDiagramEditorID name=null

It can be closed without errors and not other error occurs when the user manipulates its IDE.
Comment 2 Maxime Porhel CLA 2015-01-15 04:56:48 EST
Fixed with commit c95eaa35b97819c591a2628a36c22b1f4c2bedc7 on v2.0.x branch
Comment 3 Maxime Porhel CLA 2015-01-20 12:14:44 EST
Validated on Sirius Stable pre-2.0.3 (2.0.3-S20150116-162634)
Comment 4 Maxime Porhel CLA 2015-01-22 10:03:16 EST
Available in Sirius 2.0.3.