Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 329826 - [FastView] NPE in FastViewPane#hideView
Summary: [FastView] NPE in FastViewPane#hideView
Status: RESOLVED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 3.6.1   Edit
Hardware: PC Windows All
: P3 normal (vote)
Target Milestone: 3.7 M4   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-09 11:32 EST by Stephan Wahlbrink CLA
Modified: 2010-11-11 13:45 EST (History)
5 users (show)

See Also:


Attachments
Screenshot (before keyboard shortcut) (262.12 KB, image/png)
2010-11-10 07:38 EST, Stephan Wahlbrink CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Wahlbrink CLA 2010-11-09 11:32:32 EST
Build Identifier: M20100909-0800

Stack Trace:

!ENTRY org.eclipse.ui 4 0 2010-11-09 12:40:09.886
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.NullPointerException
	at org.eclipse.ui.internal.FastViewPane.hideView(FastViewPane.java:582)
	at org.eclipse.ui.internal.Perspective.hideFastView(Perspective.java:571)
	at org.eclipse.ui.internal.Perspective.setActiveFastView(Perspective.java:1933)
	at org.eclipse.ui.internal.Perspective.setActiveFastView(Perspective.java:1952)
	at org.eclipse.ui.internal.Perspective.bringToTop(Perspective.java:225)
	at org.eclipse.ui.internal.WorkbenchPage.internalBringToTop(WorkbenchPage.java:799)
	at org.eclipse.ui.internal.WorkbenchPage.internalActivate(WorkbenchPage.java:616)
	at org.eclipse.ui.internal.WorkbenchPage.activate(WorkbenchPage.java:589)
	at org.eclipse.ui.internal.WorkbenchPage.busyShowView(WorkbenchPage.java:1096)
	at org.eclipse.ui.internal.WorkbenchPage.busyShowView(WorkbenchPage.java:1066)
	at org.eclipse.ui.internal.WorkbenchPage$20.run(WorkbenchPage.java:3822)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:3819)
	at org.eclipse.ui.internal.WorkbenchPage.showView(WorkbenchPage.java:3795)
	at org.eclipse.ui.handlers.ShowViewHandler.openView(ShowViewHandler.java:162)
	at org.eclipse.ui.handlers.ShowViewHandler.execute(ShowViewHandler.java:77)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
	at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(WorkbenchKeyboard.java:468)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(WorkbenchKeyboard.java:786)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(WorkbenchKeyboard.java:885)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(WorkbenchKeyboard.java:567)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(WorkbenchKeyboard.java:508)
	at org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(WorkbenchKeyboard.java:123)
	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:1062)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1103)
	at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1099)
	at org.eclipse.swt.widgets.Widget.wmChar(Widget.java:1508)
	at org.eclipse.swt.widgets.Control.WM_CHAR(Control.java:4268)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4160)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4886)
	at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2459)
	at org.eclipse.swt.ole.win32.OleFrame.getMsgProc(OleFrame.java:276)
	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.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
	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:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	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)

The problem is, that FastViewPane#hideView is called recursivly:

Thread [main] (Suspended (breakpoint at line 577 in org.eclipse.ui.internal.FastViewPane))	
	org.eclipse.ui.internal.FastViewPane.hideView() line: 577	
	org.eclipse.ui.internal.Perspective.hideFastView(org.eclipse.ui.IViewReference, int) line: 571	
	org.eclipse.ui.internal.Perspective.setActiveFastView(org.eclipse.ui.IViewReference, int) line: 1933	
	org.eclipse.ui.internal.Perspective.setActiveFastView(org.eclipse.ui.IViewReference) line: 1952	
	org.eclipse.ui.internal.Perspective.partActivated(org.eclipse.ui.IWorkbenchPart) line: 1150	
	org.eclipse.ui.internal.WorkbenchPage.setActivePart(org.eclipse.ui.IWorkbenchPart, boolean) line: 3517	
	org.eclipse.ui.internal.WorkbenchPage.requestActivation(org.eclipse.ui.IWorkbenchPart) line: 3077	
	org.eclipse.ui.internal.ViewPane(org.eclipse.ui.internal.PartPane).requestActivation() line: 279	
	org.eclipse.ui.internal.ViewPane(org.eclipse.ui.internal.PartPane).handleEvent(org.eclipse.swt.widgets.Event) line: 237	
	org.eclipse.swt.widgets.EventTable.sendEvent(org.eclipse.swt.widgets.Event) line: 84	
	org.eclipse.swt.widgets.ToolBar(org.eclipse.swt.widgets.Widget).sendEvent(org.eclipse.swt.widgets.Event) line: 1053	
	org.eclipse.swt.widgets.ToolBar(org.eclipse.swt.widgets.Widget).sendEvent(int, org.eclipse.swt.widgets.Event, boolean) line: 1077	
	org.eclipse.swt.widgets.ToolBar(org.eclipse.swt.widgets.Widget).sendEvent(int) line: 1058	
	org.eclipse.swt.widgets.Shell.setActiveControl(org.eclipse.swt.widgets.Control) line: 1424	
	org.eclipse.swt.widgets.ToolBar(org.eclipse.swt.widgets.Control).sendFocusEvent(int) line: 2632	
	org.eclipse.swt.widgets.ToolBar(org.eclipse.swt.widgets.Widget).wmSetFocus(long, long, long) line: 2402	
	org.eclipse.swt.widgets.ToolBar(org.eclipse.swt.widgets.Control).WM_SETFOCUS(long, long) line: 4792	
	org.eclipse.swt.widgets.ToolBar.WM_SETFOCUS(long, long) line: 1362	
	org.eclipse.swt.widgets.ToolBar(org.eclipse.swt.widgets.Control).windowProc(long, int, long, long) line: 4229	
	org.eclipse.swt.widgets.Display.windowProc(long, long, long, long) line: 4873	
	org.eclipse.swt.internal.win32.OS.SetFocus(long) line: not available [native method]	
	org.eclipse.swt.widgets.ToolBar(org.eclipse.swt.widgets.Control).forceFocus() line: 995	
	org.eclipse.swt.widgets.ToolBar(org.eclipse.swt.widgets.Control).setFixedFocus() line: 2980	
	org.eclipse.swt.widgets.ToolBar(org.eclipse.swt.widgets.Composite).setFixedFocus() line: 1039	
	org.eclipse.swt.widgets.Composite.setFixedFocus() line: 1037	
	org.eclipse.swt.custom.CTabFolder(org.eclipse.swt.widgets.Control).fixFocus(org.eclipse.swt.widgets.Control) line: 953	
	org.eclipse.swt.custom.CTabFolder(org.eclipse.swt.widgets.Control).setVisible(boolean) line: 3407	
	org.eclipse.ui.internal.presentations.defaultpresentation.DefaultTabFolder(org.eclipse.ui.internal.presentations.util.AbstractTabFolder).setVisible(boolean) line: 391	
	org.eclipse.ui.internal.presentations.defaultpresentation.DefaultTabFolder.setVisible(boolean) line: 534	
	org.eclipse.ui.internal.presentations.util.PresentablePartFolder.setVisible(boolean) line: 396	
	org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.setVisible(boolean) line: 384	
	org.eclipse.ui.internal.FastViewPane.hideView() line: 577	
	org.eclipse.ui.internal.Perspective.hideFastView(org.eclipse.ui.IViewReference, int) line: 571	
	org.eclipse.ui.internal.Perspective.setActiveFastView(org.eclipse.ui.IViewReference, int) line: 1933	
	org.eclipse.ui.internal.Perspective.setActiveFastView(org.eclipse.ui.IViewReference) line: 1952	
	org.eclipse.ui.internal.Perspective.bringToTop(org.eclipse.ui.IViewReference) line: 225	
	org.eclipse.ui.internal.WorkbenchPage.internalBringToTop(org.eclipse.ui.IWorkbenchPartReference) line: 799	
	org.eclipse.ui.internal.WorkbenchPage.internalActivate(org.eclipse.ui.IWorkbenchPart, boolean) line: 616	
	org.eclipse.ui.internal.WorkbenchPage.activate(org.eclipse.ui.IWorkbenchPart) line: 589	
	org.eclipse.ui.internal.WorkbenchPage.busyShowView(org.eclipse.ui.IViewPart, int) line: 1096	
	org.eclipse.ui.internal.WorkbenchPage.busyShowView(java.lang.String, java.lang.String, int) line: 1066	
	org.eclipse.ui.internal.WorkbenchPage$20.run() line: 3822	
	org.eclipse.swt.custom.BusyIndicator.showWhile(org.eclipse.swt.widgets.Display, java.lang.Runnable) line: 70	
	org.eclipse.ui.internal.WorkbenchPage.showView(java.lang.String, java.lang.String, int) line: 3819	
	org.eclipse.ui.internal.WorkbenchPage.showView(java.lang.String) line: 3795	
	org.eclipse.ui.handlers.ShowViewHandler.openView(java.lang.String, org.eclipse.ui.IWorkbenchWindow) line: 162	
	org.eclipse.ui.handlers.ShowViewHandler.execute(org.eclipse.core.commands.ExecutionEvent) line: 77	
	org.eclipse.ui.internal.handlers.HandlerProxy.execute(org.eclipse.core.commands.ExecutionEvent) line: 293	
	org.eclipse.core.commands.Command.executeWithChecks(org.eclipse.core.commands.ExecutionEvent) line: 476	
	org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(java.lang.Object, java.lang.Object) line: 508	
	org.eclipse.ui.internal.handlers.HandlerService.executeCommand(org.eclipse.core.commands.ParameterizedCommand, org.eclipse.swt.widgets.Event) line: 169	
	org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeCommand(org.eclipse.jface.bindings.Binding, org.eclipse.swt.widgets.Event) line: 468	
	org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(java.util.List, org.eclipse.swt.widgets.Event) line: 786	
	org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEvent(java.util.List, org.eclipse.swt.widgets.Event) line: 885	
	org.eclipse.ui.internal.keys.WorkbenchKeyboard.filterKeySequenceBindings(org.eclipse.swt.widgets.Event) line: 567	
	org.eclipse.ui.internal.keys.WorkbenchKeyboard.access$3(org.eclipse.ui.internal.keys.WorkbenchKeyboard, org.eclipse.swt.widgets.Event) line: 508	
	org.eclipse.ui.internal.keys.WorkbenchKeyboard$KeyDownFilter.handleEvent(org.eclipse.swt.widgets.Event) line: 123	
	org.eclipse.swt.widgets.EventTable.sendEvent(org.eclipse.swt.widgets.Event) line: 84	
	org.eclipse.swt.widgets.Display.filterEvent(org.eclipse.swt.widgets.Event) line: 1253	
	org.eclipse.swt.browser.WebSite(org.eclipse.swt.widgets.Widget).sendEvent(org.eclipse.swt.widgets.Event) line: 1052	
	org.eclipse.swt.browser.WebSite(org.eclipse.swt.widgets.Widget).sendEvent(int, org.eclipse.swt.widgets.Event, boolean) line: 1077	
	org.eclipse.swt.browser.WebSite(org.eclipse.swt.widgets.Widget).sendEvent(int, org.eclipse.swt.widgets.Event) line: 1062	
	org.eclipse.swt.browser.WebSite(org.eclipse.swt.widgets.Widget).sendKeyEvent(int, int, long, long, org.eclipse.swt.widgets.Event) line: 1103	
	org.eclipse.swt.browser.WebSite(org.eclipse.swt.widgets.Widget).sendKeyEvent(int, int, long, long) line: 1099	
	org.eclipse.swt.browser.WebSite(org.eclipse.swt.widgets.Widget).wmChar(long, long, long) line: 1508	
	org.eclipse.swt.browser.WebSite(org.eclipse.swt.widgets.Control).WM_CHAR(long, long) line: 4268	
	org.eclipse.swt.browser.WebSite(org.eclipse.swt.widgets.Control).windowProc(long, int, long, long) line: 4160	
	org.eclipse.swt.widgets.Display.windowProc(long, long, long, long) line: 4886	
	org.eclipse.swt.internal.win32.OS.DispatchMessageW(org.eclipse.swt.internal.win32.MSG) line: not available [native method]	
	org.eclipse.swt.internal.win32.OS.DispatchMessage(org.eclipse.swt.internal.win32.MSG) line: 2459	
	org.eclipse.swt.ole.win32.OleFrame.getMsgProc(long, long, long) line: 276	
	org.eclipse.swt.internal.win32.OS.PeekMessageW(org.eclipse.swt.internal.win32.MSG, long, int, int, int) line: not available [native method]	
	org.eclipse.swt.internal.win32.OS.PeekMessage(org.eclipse.swt.internal.win32.MSG, long, int, int, int) line: 3024	
	org.eclipse.swt.widgets.Display.readAndDispatch() line: 3652	
	org.eclipse.ui.internal.Workbench.runEventLoop(org.eclipse.jface.window.Window$IExceptionHandler, org.eclipse.swt.widgets.Display) line: 2640	
	org.eclipse.ui.internal.Workbench.runUI() line: 2604	
	org.eclipse.ui.internal.Workbench.access$4(org.eclipse.ui.internal.Workbench) line: 2438	
	org.eclipse.ui.internal.Workbench$7.run() line: 671	
	org.eclipse.core.databinding.observable.Realm.runWithDefault(org.eclipse.core.databinding.observable.Realm, java.lang.Runnable) line: 332	
	org.eclipse.ui.internal.Workbench.createAndRunWorkbench(org.eclipse.swt.widgets.Display, org.eclipse.ui.application.WorkbenchAdvisor) line: 664	
	org.eclipse.ui.PlatformUI.createAndRunWorkbench(org.eclipse.swt.widgets.Display, org.eclipse.ui.application.WorkbenchAdvisor) line: 149	
	org.eclipse.ui.internal.ide.application.IDEApplication.start(org.eclipse.equinox.app.IApplicationContext) line: 115	
	org.eclipse.equinox.internal.app.EclipseAppHandle.run(java.lang.Object) line: 196	
	org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(java.lang.Object) line: 110	
	org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(java.lang.Object) line: 79	
	org.eclipse.core.runtime.adaptor.EclipseStarter.run(java.lang.Object) line: 369	
	org.eclipse.core.runtime.adaptor.EclipseStarter.run(java.lang.String[], java.lang.Runnable) line: 179	
	sun.reflect.NativeMethodAccessorImpl.invoke0(java.lang.reflect.Method, java.lang.Object, java.lang.Object[]) line: not available [native method]	
	sun.reflect.NativeMethodAccessorImpl.invoke(java.lang.Object, java.lang.Object[]) line: 39	
	sun.reflect.DelegatingMethodAccessorImpl.invoke(java.lang.Object, java.lang.Object[]) line: 25	
	java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object...) line: 597	
	org.eclipse.equinox.launcher.Main.invokeFramework(java.lang.String[], java.net.URL[]) line: 619	
	org.eclipse.equinox.launcher.Main.basicRun(java.lang.String[]) line: 574	
	org.eclipse.equinox.launcher.Main.run(java.lang.String[]) line: 1407	
	org.eclipse.equinox.launcher.Main.main(java.lang.String[]) line: 1383	

The recursive call occurs only in special situations, e.g. when the #fixFocus is enabled.

Reproducible: Always

Steps to Reproduce:
I could reprodue it on Eclipse 3.6.1 Win64:
1. Open Internal Browser View and the Console View as FastView
2. Open a web page in the browser
3. Switch to the console view using keyboard shortcut (Shift+Alt+Q, C)
4. Go back to the browser view and repeat 3.
Comment 1 Stephan Wahlbrink CLA 2010-11-09 11:39:16 EST
Beside the special case, perhaps you want to make FastViewPane#hideView simply resistant to recusive calls.
Comment 2 Remy Suen CLA 2010-11-09 13:13:01 EST
This has happened before (see bug 301594) though the cause seems to be different this time.
Comment 3 Dani Megert CLA 2010-11-10 03:51:24 EST
>1. Open Internal Browser View
What's the "Internal Browser View"?
Comment 4 Stephan Wahlbrink CLA 2010-11-10 04:16:09 EST
Sorry, the correct name of the view is "Internal Web Browser"
Comment 5 Dani Megert CLA 2010-11-10 07:06:30 EST
(In reply to comment #4)
> Sorry, the correct name of the view is "Internal Web Browser"
There must be more steps than given in comment 0 as I'm unable to reproduce the problem. Can you attach a screenshot?

>4. Go back to the browser view and repeat 3.
How exactly do you do that?
Comment 6 Stephan Wahlbrink CLA 2010-11-10 07:30:07 EST
(In reply to comment #5)
> >4. Go back to the browser view and repeat 3.
> How exactly do you do that?

Left mouse click on the icon of the view.
Comment 7 Stephan Wahlbrink CLA 2010-11-10 07:38:57 EST
Created attachment 182802 [details]
Screenshot (before keyboard shortcut)
Comment 8 Stephan Wahlbrink CLA 2010-11-10 07:42:06 EST
Note that I could reproduce it only with the 64-bit version, not the 32-bit version.
Comment 9 Hitesh CLA 2010-11-10 11:56:11 EST
I cannot reproduce this either ... I'll leave this for Paul to close.
Comment 10 Dani Megert CLA 2010-11-10 11:58:11 EST
Markus, can you try the steps on your 64bit machine?
Comment 11 Markus Keller CLA 2010-11-10 12:57:35 EST
Wow, nasty bug! I can consistently reproduce with eclipse-SDK-3.6.1-win32-x86_64 and jdk6_22_x64.

I cannot reproduce with the same steps and same machine with the 32-bit build.
Comment 12 Markus Keller CLA 2010-11-10 14:02:42 EST
I've debugged this a bit:

The difference is that in 64-bit, the call to "display.getFocusControl ()" in
    CTabFolder(Control).setVisible(boolean) line: 3393	
returns a ViewForm, while in 32-bit (HEAD), the control is the Shell.

=> Consequence is that the CTabFolder sets the focus to itself again, etc.


The reason for the difference can be seen in
    ViewPane(LayoutPart).setVisible(boolean) line: 276
, where the effects of "ctrl.getShell().forceFocus();" are not the same on both platforms.

In 32-bit, the Shell really takes focus, which can be seen by calling
"ctrl.getDisplay().getFocusControl()" right after the forceFocus().
In 64-bit, the same expression still returns the WebSite control from the browser.


Moving to SWT. Looks like a bug in the Browser widget implementation.
Comment 13 Markus Keller CLA 2010-11-11 13:45:35 EST
I had a strange gut feeling about this, so also downloaded the 64-bit version of I20101109-0800 and tried it there => no NPE any more.

Closing for now. Please reopen if you can still reproduce in a recent 3.7 build.