Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 329918 - NPE thrown when activating a part after resetting a perspective without an editor area and the last active part was in the area
Summary: NPE thrown when activating a part after resetting a perspective without an ed...
Status: VERIFIED FIXED
Alias: None
Product: e4
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 1.0   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.1 M4   Edit
Assignee: Eric Moffatt CLA
QA Contact: Eric Moffatt CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-10 11:02 EST by Remy Suen CLA
Modified: 2010-12-07 15:43 EST (History)
0 users

See Also:


Attachments
reset the 'curSharedRef' on a placeholder's dispose (893 bytes, patch)
2010-11-10 12:30 EST, Eric Moffatt 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-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.