Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 327952 - NPE when trying to hide a part in a detached window
Summary: NPE when trying to hide a part in a detached window
Status: VERIFIED FIXED
Alias: None
Product: e4
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 1.0   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: 4.1 M3   Edit
Assignee: Remy Suen CLA
QA Contact: Remy Suen CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-15 15:46 EDT by Remy Suen CLA
Modified: 2010-10-26 09:55 EDT (History)
0 users

See Also:


Attachments
EPartService patch v1 (5.51 KB, patch)
2010-10-15 16:10 EDT, Remy Suen CLA
no flags Details | Diff
EPartService patch v2 (6.05 KB, patch)
2010-10-15 16:24 EDT, Remy Suen CLA
no flags Details | Diff

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