Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 370107 - [Presentations] NPE in PartStack#smartUnzoom()
Summary: [Presentations] NPE in PartStack#smartUnzoom()
Status: CLOSED WONTFIX
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.7.2   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-30 05:30 EST by Daniel Stein CLA
Modified: 2019-12-09 19:38 EST (History)
3 users (show)

See Also:


Attachments
Trace of the NPE (3.90 KB, text/plain)
2012-01-31 03:01 EST, Daniel Stein CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Stein CLA 2012-01-30 05:30:02 EST
Build Identifier: Version: Indigo Service Release 1 Build id: 20110916-0149

The Method PartStack#smartUnzoom uses the return-value of the Methode LayoutPartStack#getContainer without a null check. The javadoc of this method says that the return-value can be null... 
This leads sometimes to an NPE.



Reproducible: Sometimes
Comment 1 Paul Webster CLA 2012-01-30 08:39:26 EST
Could you please attach your logfile with the NPE?

PW
Comment 2 Daniel Stein CLA 2012-01-31 03:01:42 EST
Created attachment 210298 [details]
Trace of the NPE

(In reply to comment #1)
> Could you please attach your logfile with the NPE?
> 
> PW

Added the trace.
Comment 3 Daniel Stein CLA 2012-06-13 05:44:00 EDT
Meanwhile I could reprodruce the problem: 

preconditions:
We have an RCP that don't restore editors on startup. We have good reasons to do this.

Steps: 
1. Start an RCP that meets the preconditions. 
2. Open Views so that you have one or more partstacks. 
3. Open an editor an maximize it. 
4. shutdown the RCP (without closing the editor!)
5. Restart the RCP (the partstacks are minimized and no editors are open).
6. Open an editor. 
7. Close the editor. 
8. The workbench calls the Method PartStack#smartUnzoom() and throws the mentioned NPE.
Comment 4 Daniel Stein CLA 2012-06-14 01:52:48 EDT
Additional Info 
The #dispose Method of the mentioned editor don't get called, so we have an resource-leak in the case the error occurs.
Comment 5 Justin Dolezy CLA 2015-01-26 01:45:11 EST
Have also had this reported with o.e.ui.workbench_3.7.0.I20110519-0100 :

!ENTRY x.x.x 4 0 2015-01-25 16:33:08.667
!MESSAGE 
!STACK 0
java.lang.NullPointerException
	at org.eclipse.ui.internal.PartStack.smartUnzoom(PartStack.java:1398)
	at org.eclipse.ui.internal.PartStack$3.runWithException(PartStack.java:1469)
	at org.eclipse.ui.internal.StartupThreading$StartupRunnable.run(StartupThreading.java:31)
	at org.eclipse.swt.widgets.Synchronizer.syncExec(Synchronizer.java:180)
	at org.eclipse.ui.internal.UISynchronizer.syncExec(UISynchronizer.java:150)
	at org.eclipse.swt.widgets.Display.syncExec(Display.java:4607)
	at org.eclipse.ui.internal.StartupThreading.runWithoutExceptions(StartupThreading.java:94)
	at org.eclipse.ui.internal.PartStack.setState(PartStack.java:1462)
	at org.eclipse.ui.internal.EditorSashContainer.removeEditor(EditorSashContainer.java:292)
	at org.eclipse.ui.internal.EditorAreaHelper.closeEditor(EditorAreaHelper.java:84)
	at org.eclipse.ui.internal.EditorAreaHelper.closeEditor(EditorAreaHelper.java:62)
	at org.eclipse.ui.internal.WorkbenchPage.closeEditors(WorkbenchPage.java:1455)
	at org.eclipse.ui.internal.WorkbenchPage.closeEditor(WorkbenchPage.java:1515)
	at org.eclipse.ui.internal.EditorPane.doHide(EditorPane.java:61)
	at org.eclipse.ui.internal.PartStack.close(PartStack.java:537)
	at org.eclipse.ui.internal.EditorStack.close(EditorStack.java:206)
	at org.eclipse.ui.internal.PartStack$1.close(PartStack.java:120)
	at org.eclipse.ui.internal.presentations.util.TabbedStackPresentation$1.handleEvent(TabbedStackPresentation.java:83)
	at org.eclipse.ui.internal.presentations.util.AbstractTabFolder.fireEvent(AbstractTabFolder.java:269)
	at org.eclipse.ui.internal.presentations.util.AbstractTabFolder.fireEvent(AbstractTabFolder.java:278)
	at org.eclipse.ui.internal.presentations.defaultpresentation.DefaultTabFolder.access$1(DefaultTabFolder.java:1)
	at org.eclipse.ui.internal.presentations.defaultpresentation.DefaultTabFolder$1.closeButtonPressed(DefaultTabFolder.java:71)
	at org.eclipse.ui.internal.presentations.PaneFolder.notifyCloseListeners(PaneFolder.java:631)
	at org.eclipse.ui.internal.presentations.PaneFolder$3.close(PaneFolder.java:206)
	at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:1599)
	at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:261)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4136)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1458)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1481)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1466)
	at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1271)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3982)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3621)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at a.c.p.c.start(c.java:125)
	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:344)
	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:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
Comment 6 Eclipse Genie CLA 2019-12-09 19:38:38 EST
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.