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

Bug 329918

Summary: NPE thrown when activating a part after resetting a perspective without an editor area and the last active part was in the area
Product: [Eclipse Project] e4 Reporter: Remy Suen <remy.suen>
Component: UIAssignee: Eric Moffatt <emoffatt>
Status: VERIFIED FIXED QA Contact: Eric Moffatt <emoffatt>
Severity: normal    
Priority: P3    
Version: 1.0   
Target Milestone: 4.1 M4   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
reset the 'curSharedRef' on a placeholder's dispose none

Description Remy Suen CLA 2010-11-10 11:02:07 EST
1. Open a perspective without an editor area.
2. Open a file.
3. The editor is now active.
4. Window > Reset Perspective... > OK
5. Try to activate a view. An NPE is thrown.

Caused by: java.lang.NullPointerException
	at org.eclipse.e4.ui.workbench.renderers.swt.SWTPartRenderer.setCSSInfo(SWTPartRenderer.java:68)
	at org.eclipse.e4.ui.workbench.renderers.swt.WBWRenderer.trackActivePart(WBWRenderer.java:131)
	at sun.reflect.GeneratedMethodAccessor13.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:618)
	at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:52)
	... 53 more
Comment 1 Remy Suen CLA 2010-11-10 11:20:29 EST
There are two problems here. One, the perspective does not have an active part by default despite the fact that there is another part in it. Two, the area does not appear to have had its shared reference reset to some other valid element given that the area no longer exists in the current perspective, its shared reference should have been set to something else (that is actually valid).
Comment 2 Eric Moffatt CLA 2010-11-10 12:30:50 EST
Created attachment 182836 [details]
reset the 'curSharedRef' on a placeholder's dispose
Comment 3 Eric Moffatt CLA 2010-11-10 12:33:26 EST
Committed in >20101110. Applied the patch.
Comment 4 Remy Suen CLA 2010-11-10 12:43:20 EST
(In reply to comment #3)
> Committed in >20101110. Applied the patch.

Marking this bug as fixed as the NPE will no longer be thrown.

Opened bug 329930 for the activation problem.
Comment 5 Eric Moffatt CLA 2010-12-07 15:43:38 EST
Verified in I20101207-0250.