Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 320158 - [Compatibility] NPEs when closing and reopening perspective
Summary: [Compatibility] NPEs when closing and reopening perspective
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: 1.0 RC3   Edit
Assignee: Remy Suen CLA
QA Contact: Remy Suen CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-17 06:20 EDT by Stefan Mücke CLA
Modified: 2010-07-21 07:16 EDT (History)
3 users (show)

See Also:
pwebster: review+
bokowski: review+


Attachments
Perspective handling patch v1 (4.14 KB, patch)
2010-07-17 13:10 EDT, Remy Suen CLA
no flags Details | Diff
Perspective handling patch v2 (4.13 KB, patch)
2010-07-20 17:14 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 Stefan Mücke CLA 2010-07-17 06:20:17 EDT
1. Open a fresh e4 workbench
2. Close the Java perspective via the menu (Window > ...)
3. Open the Java perspective again via the perspective switcher

Result: Several ERRORs and stack traces on the console (in the host Eclipse):

Note: The NPEs do not occur when the perspective is closed via the context menu of the perspective switcher.
Comment 1 Stefan Mücke CLA 2010-07-17 06:30:57 EDT
Here is one of the stack traces (shortened; the others are similar):

ERROR: Unable to create class 'org.eclipse.ui.internal.e4.compatibility.CompatibilityView' from bundle '501'
org.eclipse.e4.core.di.InjectionException: java.lang.NullPointerException
  at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:54)
  at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:795)
  at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:775)
  ...
  at org.eclipse.e4.ui.workbench.renderers.swt.PerspectiveStackRenderer.showTab(PerspectiveStackRenderer.java:103)
  ...
Caused by: java.lang.NullPointerException
  at org.eclipse.ui.internal.ViewSite.<init>(ViewSite.java:26)
  at org.eclipse.ui.internal.ViewReference.initialize(ViewReference.java:97)
  at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:165)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  ...
Comment 2 Remy Suen CLA 2010-07-17 08:02:31 EDT
Cannot reproduce with I20100716-1834 on Windows 7.

1. Point Eclipse at a new workspace.
2. Window > Close Perspective
3. Click the 'Open Perspective' icon in the top right hand corner.
4. Double-click on 'Java (default)'.
5. Perspective is resurrected as expected. Nothing suspicious in the logs.
Comment 3 Stefan Mücke CLA 2010-07-17 08:08:37 EDT
I have just tried that again with the -consoleLog option (started from the command line). I can reproduce this with I20100716-1834 on Windows 7.
Comment 4 Remy Suen CLA 2010-07-17 08:12:49 EDT
(In reply to comment #3)
> I have just tried that again with the -consoleLog option (started from the
> command line). I can reproduce this with I20100716-1834 on Windows 7.

Confirmed. It seems to only appear in the console but not the .log file.

Also confirmed in my inner.
Comment 5 Remy Suen CLA 2010-07-17 08:21:44 EDT
Have a fix in mind, will attach a patch later today.
Comment 6 Remy Suen CLA 2010-07-17 13:10:56 EDT
Created attachment 174561 [details]
Perspective handling patch v1
Comment 7 Remy Suen CLA 2010-07-17 13:11:51 EDT
This isn't worth respinning RC2. Will consider for RC3.
Comment 8 Remy Suen CLA 2010-07-20 17:14:35 EDT
Created attachment 174793 [details]
Perspective handling patch v2

The patch went stale with recent changes.
Comment 9 Remy Suen CLA 2010-07-20 17:15:14 EDT
Paul, please review and assess.
Comment 10 Remy Suen CLA 2010-07-20 17:16:49 EDT
Boris, please +1 to confirm the bug as an RC3 candidate.
Comment 11 Boris Bokowski CLA 2010-07-20 17:44:10 EDT
Looks good to me.

I noticed that we still have a "Legacy Perspective"- Paul, is this because the 4.0 SDK contains the e4 SDK branding plugin?
Comment 12 Boris Bokowski CLA 2010-07-20 18:31:13 EDT
(In reply to comment #11)
> I noticed that we still have a "Legacy Perspective"- Paul, is this because the
> 4.0 SDK contains the e4 SDK branding plugin?

Scratch that. I got confused between inner and outer.
Comment 13 Remy Suen CLA 2010-07-20 19:21:28 EDT
Released to HEAD.
Comment 14 Remy Suen CLA 2010-07-21 07:16:05 EDT
Verified on Windows XP with I20100720-2028.