Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 355041

Summary: [Help][Context] NPE when pressing F1 in wizard without title
Product: [Eclipse Project] Platform Reporter: Dani Megert <daniel_megert>
Component: User AssistanceAssignee: Chris Goldthorpe <cgold>
Status: VERIFIED FIXED QA Contact:
Severity: major    
Priority: P3 CC: cgold, ChrisAustin
Version: 3.6.1Flags: ChrisAustin: review+
Target Milestone: 3.7.1   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Patch none

Description Dani Megert CLA 2011-08-18 04:45:15 EDT
3.6.1.

The fix for bug 314256 broke this in 3.6.1 (worked in 3.6). Workaround is to change the client code and call
org.eclipse.jface.wizard.Wizard.setWindowTitle("some title");

1. open a wizard that has no title set
2. press 'F1'

==>

java.lang.NullPointerException
	at org.eclipse.help.ui.internal.views.ContextHelpPart$SearchTerms.add(ContextHelpPart.java:430)
	at org.eclipse.help.ui.internal.views.ContextHelpPart.computeSearchTerms(ContextHelpPart.java:456)
	at org.eclipse.help.ui.internal.views.ContextHelpPart.updateSearchExpression(ContextHelpPart.java:394)
	at org.eclipse.help.ui.internal.views.ContextHelpPart.updateSearchExpression(ContextHelpPart.java:293)
	at org.eclipse.help.ui.internal.views.ContextHelpPart.handleActivation(ContextHelpPart.java:318)
	at org.eclipse.help.ui.internal.views.ContextHelpPart.setFormInput(ContextHelpPart.java:707)
	at org.eclipse.ui.forms.ManagedForm.setInput(ManagedForm.java:238)
	at org.eclipse.help.ui.internal.views.RelatedTopicsPart.setFormInput(RelatedTopicsPart.java:187)
	at org.eclipse.ui.forms.ManagedForm.setInput(ManagedForm.java:238)
	at org.eclipse.help.ui.internal.views.ReusableHelpPart.update(ReusableHelpPart.java:1152)
	at org.eclipse.help.ui.internal.DefaultHelpUI.displayContextAsHelpTray(DefaultHelpUI.java:437)
	at org.eclipse.help.ui.internal.DefaultHelpUI.displayContext(DefaultHelpUI.java:350)
	at org.eclipse.help.ui.internal.DefaultHelpUI.displayContext(DefaultHelpUI.java:289)
	at org.eclipse.ui.internal.help.WorkbenchHelpSystem.displayContext(WorkbenchHelpSystem.java:908)
	at org.eclipse.ui.internal.help.WorkbenchHelpSystem$WorkbenchHelpListener.helpRequested(WorkbenchHelpSystem.java:142)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:153)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
	at org.eclipse.jface.window.Window.runEventLoop(Window.java:825)
	at org.eclipse.jface.window.Window.open(Window.java:801)
	at org.eclipse.jdt.ui.actions.AbstractOpenWizardAction.run(AbstractOpenWizardAction.java:85)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:586)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:503)
	at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:413)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2702)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2666)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2500)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:680)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
	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:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	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)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
Comment 1 Chris Goldthorpe CLA 2011-08-18 13:10:57 EDT
Targeting 3.7.1
Comment 2 Chris Goldthorpe CLA 2011-08-18 13:20:33 EDT
Created attachment 201730 [details]
Patch
Comment 3 Chris Goldthorpe CLA 2011-08-18 13:24:10 EDT
The problem can easily be reproduced as follows:

Creating a new plug-in project
On the templates page select "Custom plug-in wizard"
On the Template selection page check File Import Wizard
In the generated file ImportWizard comment out the line setWindowTitle("File Import Wizard"); //NON-NLS-1
Comment 4 Chris Goldthorpe CLA 2011-08-19 15:13:10 EDT
Patch committed to 3.7 maintenance stream.
Comment 5 Chris Goldthorpe CLA 2011-08-19 15:15:56 EDT
Patch committed to HEAD, Fixed.
Comment 6 Chris Goldthorpe CLA 2011-08-24 17:06:21 EDT
Verified in M20110824-0800