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

Bug 482162

Summary: [backports] Eclipse crashes with NPE on existing workspace (after closing window twice)
Product: [Eclipse Project] Platform Reporter: Markus Keller <markus.kell.r>
Component: UIAssignee: Markus Keller <markus.kell.r>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, markus.kell.r
Version: 4.2Flags: daniel_megert: review+
Target Milestone: 4.2.2+   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on: 381555    
Bug Blocks:    
Attachments:
Description Flags
patch482162_R4_2_maintenance.txt daniel_megert: review+

Description Markus Keller CLA 2015-11-13 15:15:40 EST
Backport of bug 381555 to R4_2_maintenance and later maintenance branches.

I think we should also backport bug 416673 and bug 463125. They are not strictly required in new workspaces, but they would
- allow to recover a broken workspace
- serve as a fallback in case clicking the close box twice is not the only way to create a broken workbench.xmi
Comment 1 Markus Keller CLA 2015-11-13 15:30:28 EST
Pushed http://git.eclipse.org/c/platform/eclipse.platform.ui.git/log/?h=mkeller/Bug_482162_R4_2_maintenance with proposed fixes for 4.2.2+

I verified that the first 3 commits
- avoid writing a bad workbench.xmi
- allow to start up with a bad workbench.xmi (thereby losing perspective configs)

The 4th commit resolves the root problem (that the window gets removed from the model).

Cherry-picking was quite painful in EGit. Filed bug 482154.
Comment 2 Markus Keller CLA 2015-11-18 08:08:03 EST
Created attachment 258120 [details]
patch482162_R4_2_maintenance.txt

Here's a flat patch file that includes the changes from all 4 commits.
Comment 3 Dani Megert CLA 2015-11-21 04:37:04 EST
I've reviewed the new code and the other 3 commits. The code looks good and I could not reproduce the problem and also not the regression reported in bug 381555 comment 36.

The copyright dates should be updated to 2015.
Comment 4 Markus Keller CLA 2015-11-23 07:04:18 EST
Pushed to R4_2_maintenance: http://git.eclipse.org/c/platform/eclipse.platform.ui.git/commit/?id=7edf74a51a1f56d4aa08e5bba9fe8658822cc51c

Backporting to the later maintenance branches now.