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

Bug 317462

Summary: Window -> Close Perspective misbehaves
Product: [Eclipse Project] e4 Reporter: Oleg Besedin <ob1.eclipse>
Component: UIAssignee: Project Inbox <e4.ui-inbox>
Status: RESOLVED WORKSFORME QA Contact:
Severity: normal    
Priority: P3 CC: emoffatt, ob1.eclipse, pwebster, remy.suen
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Stack trace
none
Trace for the exception none

Description Oleg Besedin CLA 2010-06-21 10:30:14 EDT
The Window -> Close Perspective works (suprise :-)) but leaves perspective's tab in the perspective switcher and causes NPE when I try to open another perspective later.
Comment 1 Eric Moffatt CLA 2010-06-22 14:51:25 EDT
Oleg, I'm pretty sure that this is fixed, see bug 317203. Close this or DUP it to that one if you agree...
Comment 2 Oleg Besedin CLA 2010-06-23 09:43:43 EDT
It work for closing the perspective, but when I try to open a new perspective from "+" after that, I get the following exception:

statusReporter.report(new Status(IStatus.ERROR,
	WorkbenchSWTActivator.PI_RENDERERS,
	"Internal error, please post the trace to bug 315270",
	new Exception()), StatusReporter.LOG);

in E4Application.
Comment 3 Remy Suen CLA 2010-06-23 09:46:33 EDT
(In reply to comment #2)
> It work for closing the perspective, but when I try to open a new perspective
> from "+" after that, I get the following exception:
> 
> statusReporter.report(new Status(IStatus.ERROR,
>     WorkbenchSWTActivator.PI_RENDERERS,
>     "Internal error, please post the trace to bug 315270",
>     new Exception()), StatusReporter.LOG);
> 
> in E4Application.

Uh oh, did nothing get logged to the workspace's log? :(
Comment 4 Oleg Besedin CLA 2010-06-23 10:05:51 EDT
Created attachment 172507 [details]
Stack trace

(In reply to comment #3)
> Uh oh, did nothing get logged to the workspace's log? :(

To reproduce:
- I have one default perspective open (Java)
- Window -> Close Perspective, good so far
- R-click on "+" on the Perspective Swticher, select "Debug", press OK -> NPE
Comment 5 Eric Moffatt CLA 2010-06-23 14:12:47 EDT
This is the result of the WorkbenchPage's 'perspective' field not being kept in synch with reality. The reason it works from the perspective switcher is because that code path determines the perspective to close from the ToolItem and finds its descriptor while the ClosePerspectiveHandler calls WorkbenchPage.getPerspective() (which returns the bogus field).

patch coming...
Comment 6 Eric Moffatt CLA 2010-06-23 15:46:45 EDT
Hmm, not quite. I fixed getPerspective to use the PerspectiveStack's currently selected element but still get an error...
Comment 7 Eric Moffatt CLA 2010-06-23 15:49:51 EDT
Created attachment 172547 [details]
Trace for the exception


I get this with the following scenario:

Fresh start of inner
open Debug perspective using PS '+'
select the Java Perspective using the PS
preform Window -> Close Perspective

What's truly odd is that if I close the perspective using the context menu on the PS I *do not* get this error even though (as far as I can see) both end up calling 'closePerspective' with a descriptor for the Java perspective...
Comment 8 Eric Moffatt CLA 2010-06-23 15:50:25 EDT
Adding Paul for a look...
Comment 9 Remy Suen CLA 2011-06-20 14:18:06 EDT
Cannot reproduce with I20110617-1015 on Windows XP.