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

Bug 327952

Summary: NPE when trying to hide a part in a detached window
Product: [Eclipse Project] e4 Reporter: Remy Suen <remy.suen>
Component: UIAssignee: Remy Suen <remy.suen>
Status: VERIFIED FIXED QA Contact: Remy Suen <remy.suen>
Severity: major    
Priority: P3    
Version: 1.0   
Target Milestone: 4.1 M3   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
EPartService patch v1
none
EPartService patch v2 none

Description Remy Suen CLA 2010-10-15 15:46:39 EDT
Caused by: java.lang.NullPointerException
	at org.eclipse.e4.ui.internal.workbench.PartActivationHistory.isInArea(PartActivationHistory.java:136)
	at org.eclipse.e4.ui.internal.workbench.PartActivationHistory.isInArea(PartActivationHistory.java:139)
	at org.eclipse.e4.ui.internal.workbench.PartActivationHistory.isInArea(PartActivationHistory.java:139)
	at org.eclipse.e4.ui.internal.workbench.PartActivationHistory.isInArea(PartActivationHistory.java:139)
	at org.eclipse.e4.ui.internal.workbench.PartActivationHistory.getActivationCandidate(PartActivationHistory.java:193)
	at org.eclipse.e4.ui.internal.workbench.PartActivationHistory.getNextActivationCandidate(PartActivationHistory.java:235)
	at org.eclipse.e4.ui.internal.workbench.PartServiceImpl.hidePart(PartServiceImpl.java:897)
	at org.eclipse.ui.internal.WorkbenchPage.hidePart(WorkbenchPage.java:991)
	at org.eclipse.ui.internal.WorkbenchPage.closeEditors(WorkbenchPage.java:891)
	at org.eclipse.ui.internal.WorkbenchPage.closeEditor(WorkbenchPage.java:1047)
	at org.eclipse.ui.internal.CloseEditorHandler.execute(CloseEditorHandler.java:47)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293)
Comment 1 Remy Suen CLA 2010-10-15 16:10:13 EDT
Created attachment 181012 [details]
EPartService patch v1

Changes the code in PartActivationHistory to consider the fact that getParent() returns null for detached windows.
Comment 2 Remy Suen CLA 2010-10-15 16:11:10 EDT
(In reply to comment #1)
> Created an attachment (id=181012) [details]
> EPartService patch v1

Fix delivered to HEAD. Will need some additional changes and tests to consider MAreas that are contained within detached windows.
Comment 3 Remy Suen CLA 2010-10-15 16:24:40 EDT
Created attachment 181013 [details]
EPartService patch v2

Fix and tests for areas within detached windows. Technically speaking, this wasn't actually a problem but I've taken the time to write some tests and also clean up some of the code in PartActivationHistory.
Comment 4 Remy Suen CLA 2010-10-15 16:25:13 EDT
(In reply to comment #3)
> Created an attachment (id=181013) [details]
> EPartService patch v2

Fix delivered to CVS HEAD.
Comment 5 Remy Suen CLA 2010-10-26 09:55:40 EDT
Verified on Windows XP with I20101025-1602.