Project: Eclipse_Platform_UI
Bug 29012 [Error Handling] NullPointerException when a view extension does not specify icon
Reported: 2003-01-06 01:31:55 | Status: resolved fixed

In 2.1 M4, I got the workbench resetting to its default state (Resource perspective) when it tried to restore the workbench last saved state. This happens when a view that I created was opened in the last saved state and if the view does not specify the icon for its plugin extension. !SESSION Jan 04, 2003 12:42:45.437 --------------------------------------------- java.version=1.4.1_01 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US Command-line arguments: -os win32 -ws win32 -arch x86 -install file:D:/eclipse/ !ENTRY org.eclipse.ui.workbench 4 2 Jan 04, 2003 12:42:45.437 !MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.ui.workbench". !STACK 0 java.lang.NullPointerException at org.eclipse.ui.internal.WorkbenchPartReference.getTitleImage(WorkbenchPartReference.java:102) at org.eclipse.ui.internal.ViewPane.updateTitles(ViewPane.java:659) at org.eclipse.ui.internal.ViewPane.createTitleBar(ViewPane.java:290) at org.eclipse.ui.internal.PartPane.createControl(PartPane.java:174) at org.eclipse.ui.internal.ViewPane.createControl(ViewPane.java:181) at org.eclipse.ui.internal.PartTabFolder.createPartTab(PartTabFolder.java:251) at org.eclipse.ui.internal.PartTabFolder.createControl(PartTabFolder.java:223) at org.eclipse.ui.internal.PartSashContainer.createControl(PartSashContainer.java:181) at org.eclipse.ui.internal.PerspectivePresentation.activate(PerspectivePresentation.java:94) at org.eclipse.ui.internal.Perspective.onActivate(Perspective.java:665) at org.eclipse.ui.internal.WorkbenchPage.onActivate(WorkbenchPage.java:1633) at org.eclipse.ui.internal.WorkbenchWindow$7.run(WorkbenchWindow.java:1283) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:65) at org.eclipse.ui.internal.WorkbenchWindow.setActivePage(WorkbenchWindow.java:1270) at org.eclipse.ui.internal.WorkbenchWindow.restoreState(WorkbenchWindow.java:1153) at org.eclipse.ui.internal.Workbench.restoreState(Workbench.java:1300) at org.eclipse.ui.internal.Workbench.access$9(Workbench.java:1269) at org.eclipse.ui.internal.Workbench$10.run(Workbench.java:923) at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:852) at org.eclipse.core.runtime.Platform.run(Platform.java:413) at org.eclipse.ui.internal.Workbench.openPreviousWorkbenchState(Workbench.java:875) at org.eclipse.ui.internal.Workbench.init(Workbench.java:675) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1422) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:845) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:462) 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:324) at org.eclipse.core.launcher.Main.basicRun(Main.java:247) at org.eclipse.core.launcher.Main.run(Main.java:703) at org.eclipse.core.launcher.Main.main(Main.java:539) . The view does not specify an icon in its plugin extension. The log file is below. !SESSION Jan 04, 2003 12:42:45.437 --------------------------------------------- java.version=1.4.1_01 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US Command-line arguments: -os win32 -ws win32 -arch x86 -install file:D:/eclipse/ !ENTRY org.eclipse.ui.workbench 4 2 Jan 04, 2003 12:42:45.437 !MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.ui.workbench". !STACK 0 java.lang.NullPointerException at org.eclipse.ui.internal.WorkbenchPartReference.getTitleImage(WorkbenchPartReference.java:102) at org.eclipse.ui.internal.ViewPane.updateTitles(ViewPane.java:659) at org.eclipse.ui.internal.ViewPane.createTitleBar(ViewPane.java:290) at org.eclipse.ui.internal.PartPane.createControl(PartPane.java:174) at org.eclipse.ui.internal.ViewPane.createControl(ViewPane.java:181) at org.eclipse.ui.internal.PartTabFolder.createPartTab(PartTabFolder.java:251) at org.eclipse.ui.internal.PartTabFolder.createControl(PartTabFolder.java:223) at org.eclipse.ui.internal.PartSashContainer.createControl(PartSashContainer.java:181) at org.eclipse.ui.internal.PerspectivePresentation.activate(PerspectivePresentation.java:94) at org.eclipse.ui.internal.Perspective.onActivate(Perspective.java:665) at org.eclipse.ui.internal.WorkbenchPage.onActivate(WorkbenchPage.java:1633) at org.eclipse.ui.internal.WorkbenchWindow$7.run(WorkbenchWindow.java:1283) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:65) at org.eclipse.ui.internal.WorkbenchWindow.setActivePage(WorkbenchWindow.java:1270) at org.eclipse.ui.internal.WorkbenchWindow.restoreState(WorkbenchWindow.java:1153) at org.eclipse.ui.internal.Workbench.restoreState(Workbench.java:1300) at org.eclipse.ui.internal.Workbench.access$9(Workbench.java:1269) at org.eclipse.ui.internal.Workbench$10.run(Workbench.java:923) at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:852) at org.eclipse.core.runtime.Platform.run(Platform.java:413) at org.eclipse.ui.internal.Workbench.openPreviousWorkbenchState(Workbench.java:875) at org.eclipse.ui.internal.Workbench.init(Workbench.java:675) at org.eclipse.ui.internal.Workbench.run(Workbench.java:1422) at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:845) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:462) 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:324) at org.eclipse.core.launcher.Main.basicRun(Main.java:247) at org.eclipse.core.launcher.Main.run(Main.java:703) at org.eclipse.core.launcher.Main.main(Main.java:539)

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/WorkbenchPartReference.java