Bug 457435 - StackOverFlows and NPEs when session not loaded from memento
Summary: StackOverFlows and NPEs when session not loaded from memento
Status: CLOSED FIXED
Alias: None
Product: Sirius
Classification: Modeling
Component: Core (show other bugs)
Version: 2.0.0   Edit
Hardware: PC Mac OS X
: P3 critical (vote)
Target Milestone: 2.0.3   Edit
Assignee: Maxime Porhel CLA
QA Contact: Maxime Porhel CLA
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks: 457443
  Show dependency tree
 
Reported: 2015-01-14 06:04 EST by Maxime Porhel CLA
Modified: 2015-01-22 10:03 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.