Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 294636 - NPE using Plug-in Spy on Toolbar action
Summary: NPE using Plug-in Spy on Toolbar action
Status: RESOLVED FIXED
Alias: None
Product: PDE
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.6   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.6 M6   Edit
Assignee: Chris Aniszczyk CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 300224
  Show dependency tree
 
Reported: 2009-11-09 12:34 EST by Markus Keller CLA
Modified: 2010-03-03 12:35 EST (History)
3 users (show)

See Also:


Attachments
possible fix (1.54 KB, patch)
2009-11-09 12:34 EST, Markus Keller CLA
no flags Details | Diff
getSuperclass() could return null (and that wasn't checked) (1.05 KB, patch)
2010-01-13 18:18 EST, Fabio Zadrozny CLA
caniszczyk: iplog+
Details | Diff
mylyn/context/zip (1.33 KB, application/octet-stream)
2010-03-03 12:34 EST, Chris Aniszczyk CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2009-11-09 12:34:09 EST
Created attachment 151716 [details]
possible fix

I20091103-0941

- press Alt+Shift+F2
- click a main toolbar button (e.g. 'Open Type' or 'Debug').
=> Boom!

Attaching a possible patch (though I have to admit that I don't have much
experience writing code that catches Exception ;-).

Error
Mon Nov 09 18:11:41 CET 2009
Unhandled event loop exception

java.lang.NullPointerException
at
org.eclipse.pde.internal.runtime.spy.sections.ActiveMenuSection.createActionContributionItemText(ActiveMenuSection.java:169)
at
org.eclipse.pde.internal.runtime.spy.sections.ActiveMenuSection.createActionContributionItemText(ActiveMenuSection.java:169)
at
org.eclipse.pde.internal.runtime.spy.sections.ActiveMenuSection.createActionContributionItemText(ActiveMenuSection.java:169)
at
org.eclipse.pde.internal.runtime.spy.sections.ActiveMenuSection.createActionContributionItemText(ActiveMenuSection.java:169)
at
org.eclipse.pde.internal.runtime.spy.sections.ActiveMenuSection.createActionContributionItemText(ActiveMenuSection.java:169)
at
org.eclipse.pde.internal.runtime.spy.sections.ActiveMenuSection.createActionContributionItemText(ActiveMenuSection.java:169)
at
org.eclipse.pde.internal.runtime.spy.sections.ActiveMenuSection.createActionContributionItemText(ActiveMenuSection.java:169)
at
org.eclipse.pde.internal.runtime.spy.sections.ActiveMenuSection.createActionContributionItemText(ActiveMenuSection.java:128)
at
org.eclipse.pde.internal.runtime.spy.sections.ActiveMenuSection.scan(ActiveMenuSection.java:104)
at
org.eclipse.pde.internal.runtime.spy.sections.ActiveMenuSection.build(ActiveMenuSection.java:62)
at
org.eclipse.pde.internal.runtime.spy.dialogs.MenuSpyDialog.createDialogArea(MenuSpyDialog.java:96)
at
org.eclipse.pde.internal.runtime.spy.dialogs.MenuSpyDialog.createContents(MenuSpyDialog.java:69)
at org.eclipse.jface.window.Window.create(Window.java:431)
at
org.eclipse.pde.internal.runtime.spy.handlers.MenuSpyHandler.handleEvent(MenuSpyHandler.java:91)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.filterEvent(Display.java:1227)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1001)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3917)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3510)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2404)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2368)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2220)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at
org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
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:367)
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:611)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:566)
at org.eclipse.equinox.launcher.Main.run(Main.java:1363)
at org.eclipse.equinox.launcher.Main.main(Main.java:1339)
Comment 1 Fabio Zadrozny CLA 2010-01-13 18:18:17 EST
Created attachment 156061 [details]
getSuperclass() could return null (and that wasn't checked)
Comment 2 Fabio Zadrozny CLA 2010-01-13 18:19:31 EST
I've created a new patch for this bug as it appears that the real reason was that getSuperclass() could return null (and this situation was never checked -- thus resulting in the NPE).
Comment 3 Chris Aniszczyk CLA 2010-03-03 12:34:45 EST
done.

> 20100303

Thanks for the patch.
Comment 4 Chris Aniszczyk CLA 2010-03-03 12:34:51 EST
Created attachment 160813 [details]
mylyn/context/zip