This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 419021 - [EditorMgmt] EditorPart.setPartName leads to NPE
Summary: [EditorMgmt] EditorPart.setPartName leads to NPE
Status: VERIFIED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: IDE (show other bugs)
Version: 4.3.1   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: 4.4 M3   Edit
Assignee: Dani Megert CLA
QA Contact: Eric Moffatt CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-09 08:27 EDT by Martin Schröder CLA
Modified: 2014-05-30 13:38 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Schröder CLA 2013-10-09 08:27:58 EDT
I have an EditorPart. In the overridden setBusy I do a setPartName. This works, but logs an NPE:

!ENTRY org.eclipse.ui.workbench 4 0 2013-10-09 14:17:51.558
!MESSAGE An unexpected exception was thrown.
!STACK 0
java.lang.NullPointerException
	at org.eclipse.ui.internal.ide.application.IDEWorkbenchWindowAdvisor$1.propertyChanged(IDEWorkbenchWindowAdvisor.java:107)
	at org.eclipse.ui.part.WorkbenchPart.firePropertyChange(WorkbenchPart.java:129)
	at org.eclipse.ui.part.WorkbenchPart.setTitle(WorkbenchPart.java:311)
	at org.eclipse.ui.part.EditorPart.setDefaultTitle(EditorPart.java:294)
	at org.eclipse.ui.part.WorkbenchPart.setPartName(WorkbenchPart.java:390)
	at org.eclipse.ui.part.EditorPart.setPartName(EditorPart.java:268)
	at com.priint.gui.editors.report.ReportEditor.showBusy(ReportEditor.java:142)
	at com.priint.gui.editors.report.ReportEditor$2.completed(ReportEditor.java:81)
	at org.eclipse.swt.browser.IE$7.handleEvent(IE.java:620)
	at org.eclipse.swt.ole.win32.OleEventTable.sendEvent(OleEventTable.java:55)
	at org.eclipse.swt.ole.win32.OleEventSink.notifyListener(OleEventSink.java:152)
	at org.eclipse.swt.ole.win32.OleEventSink.Invoke(OleEventSink.java:120)
	at org.eclipse.swt.ole.win32.OleEventSink.access$1(OleEventSink.java:97)
	at org.eclipse.swt.ole.win32.OleEventSink$1.method6(OleEventSink.java:71)
	at org.eclipse.swt.internal.ole.win32.COMObject.callback6(COMObject.java:119)
	at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2549)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3757)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1113)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:997)
	at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:138)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:610)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:567)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
	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:354)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1450)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1426)
Comment 1 Paul Webster CLA 2013-10-29 15:11:18 EDT
Probably org.eclipse.ui.part.WorkbenchPart.toolTip needs to default to "" like in 3.8
PW
Comment 2 Peter Kullmann CLA 2013-10-29 17:04:49 EDT
I pushed a simple guard in https://git.eclipse.org/r/17861 
It guards against IWorkbenchPart.getTitleToolTip() not to return null. This method should actually never return null but apparently sometimes does. It is not so clear what causes this. Could be related to bug 407511.
Comment 3 Paul Webster CLA 2013-10-29 17:09:46 EDT
(In reply to Peter Kullmann from comment #2)
> I pushed a simple guard in https://git.eclipse.org/r/17861 

Thanks.  I've commented on the review.

> is not so clear what causes this. Could be related to bug 407511.

I think you're right, I've re-opened that bug for a second look.

PW
Comment 4 Dani Megert CLA 2013-10-30 05:36:59 EDT
(In reply to Peter Kullmann from comment #2)
> It is not so clear what causes this. Could be related to bug 407511.

Correct. I've reverted that change.
Comment 5 Eric Moffatt CLA 2014-05-30 13:38:24 EDT
Verified in 4.4.0.I20140528-2000 (that the change has been removed)