Project: Eclipse_Platform_UI
Bug 9322 NPE from SelectionEnabler on text selection with no "selection" tag
Reported: 2002-02-08 13:21:55 | Status: closed fixed

20020205++ I have the following XML <viewerContribution id="org.eclipse.jdt.debug.ui.CUPopupActions" targetID="#CompilationUnitEditorContext"> <action id="org.eclipse.jdt.debug.ui.Display" label="%Display.label" menubarPath="additions" icon="icons/full/etool16/disp_sbook.gif" enablesFor="+" class="org.eclipse.jdt.internal.debug.ui.actions.DisplayAction"> </action> </viewerContribution> I get an NPE selecting in the target editor. java.lang.NullPointerException at org.eclipse.ui.internal.SelectionEnabler.verifyElement (SelectionEnabler.java:250) at org.eclipse.ui.internal.SelectionEnabler.isEnabledFor (SelectionEnabler.java:126) at org.eclipse.ui.internal.SelectionEnabler.isEnabledForSelection (SelectionEnabler.java:69) at org.eclipse.ui.internal.PluginAction.refreshEnablement (PluginAction.java:167) at org.eclipse.ui.internal.PluginAction.selectionChanged (PluginAction.java:226) at org.eclipse.ui.internal.PluginAction.selectionChanged (PluginAction.java:237) at org.eclipse.jface.viewers.Viewer.fireSelectionChanged (Viewer.java:147) at org.eclipse.jface.text.TextViewer.selectionChanged (TextViewer.java:999) at org.eclipse.jface.text.TextViewer$4.widgetSelected (TextViewer.java:572) at org.eclipse.swt.widgets.TypedListener.handleEvent (TypedListener.java:85) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:74) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:637) at org.eclipse.swt.custom.StyledText.sendSelectionEvent (StyledText.java:6204) at org.eclipse.swt.custom.StyledText.doSelection(StyledText.java:2536) at org.eclipse.swt.custom.StyledText.doMouseSelection (StyledText.java:2366) at org.eclipse.swt.custom.StyledText.doMouseLocationChange (StyledText.java:2347) at org.eclipse.swt.custom.StyledText.handleMouseMove (StyledText.java:5010) at org.eclipse.swt.custom.StyledText$12.handleEvent (StyledText.java:4825) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:74) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:637) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1413) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1205) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:827) at org.eclipse.ui.internal.Workbench.run(Workbench.java:810) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:895) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:321) at SlimLauncher.main(SlimLauncher.java:14)

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