Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 320271 - [Compatibility] NPE thrown opening a workbench window and closing the original one
Summary: [Compatibility] NPE thrown opening a workbench window and closing the origina...
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-19 10:26 EDT by Remy Suen CLA
Modified: 2010-07-27 12:34 EDT (History)
1 user (show)

See Also:


Attachments
Patch that surgically detects a 'bogus' case and skips it (996 bytes, patch)
2010-07-26 14:53 EDT, Eric Moffatt CLA
no flags Details | Diff
WorkbenchWindow patch v1 (1.18 KB, patch)
2010-07-26 15:47 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-07-19 10:26:10 EDT
1. Window > New Window
2. Go back to the first one.
3. Close it.
4. Activate the new one.
5. An error occurs. It seems usable after dismissing the initial error dialog though.

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.inject(InjectorImpl.java:104)
at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:74)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.inject(ContextInjectionFactory.java:72)
at org.eclipse.ui.internal.Workbench.createWorkbenchWindow(Workbench.java:1149)
at org.eclipse.ui.internal.Workbench.getActiveWorkbenchWindow(Workbench.java:1123)
at org.eclipse.ui.internal.services.WorkbenchSourceProvider.updateActiveShell(WorkbenchSourceProvider.java:932)
at org.eclipse.ui.internal.services.WorkbenchSourceProvider.getCurrentState(WorkbenchSourceProvider.java:133)
at org.eclipse.ui.internal.services.WorkbenchSourceProvider$6.handleEvent(WorkbenchSourceProvider.java:692)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1253)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1052)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1058)
at org.eclipse.swt.widgets.Decorations.WM_ACTIVATE(Decorations.java:1635)
at org.eclipse.swt.widgets.Shell.WM_ACTIVATE(Shell.java:2114)
at org.eclipse.swt.widgets.Control.windowProc(Control.java:4157)
at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341)
at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1598)
at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2038)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4873)
at org.eclipse.swt.internal.win32.OS.PeekMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.PeekMessage(OS.java:3024)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3652)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$4.run(PartRenderingEngine.java:712)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:632)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:106)
at org.eclipse.ui.internal.Workbench$3.run(Workbench.java:541)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:525)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:618)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
at org.eclipse.equinox.launcher.Main.main(Main.java:1383)
Caused by: java.lang.NullPointerException
at org.eclipse.ui.internal.ide.WorkbenchActionBuilder.fillStatusLine(WorkbenchActionBuilder.java:907)
at org.eclipse.ui.application.ActionBarAdvisor.fillActionBars(ActionBarAdvisor.java:157)
at org.eclipse.ui.internal.ide.WorkbenchActionBuilder.fillActionBars(WorkbenchActionBuilder.java:335)
at org.eclipse.ui.internal.WorkbenchWindow.fillActionBars(WorkbenchWindow.java:1939)
at org.eclipse.ui.internal.WorkbenchWindow.setup(WorkbenchWindow.java:474)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
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:47)
... 46 more
Comment 1 Paul Webster CLA 2010-07-23 15:51:57 EDT
Still in I20100723-1415
PW
Comment 2 Remy Suen CLA 2010-07-26 14:31:53 EDT
This is because after the first window has been closed, the application still has that window set as the selected element. Thus, when we query for the active workbench window, we try to return that invalid window.
Comment 3 Eric Moffatt CLA 2010-07-26 14:53:38 EDT
Created attachment 175260 [details]
Patch that surgically detects a 'bogus' case and skips it


Not a true fix but fixes at least this scenario and is, I think, safe...
Comment 4 Remy Suen CLA 2010-07-26 15:47:27 EDT
Created attachment 175269 [details]
WorkbenchWindow patch v1
Comment 5 Eric Moffatt CLA 2010-07-26 15:57:29 EDT
This is +1 for me, it's certainly better than what's there...
Comment 6 Boris Bokowski CLA 2010-07-26 16:05:45 EDT
+1 from me too.
Comment 7 Remy Suen CLA 2010-07-26 16:09:11 EDT
(In reply to comment #4)
> Created an attachment (id=175269) [details]
> WorkbenchWindow patch v1

Fix released to CVS HEAD.
Comment 8 Remy Suen CLA 2010-07-27 12:34:46 EDT
Verified with I20100726-2152 on Windows XP.