Project: JDT
Bug 82394 [preferences][templates] NPE trying to edit code templates
Reported: 2005-01-07 13:39:14 | Status: verified fixed

build i0104-1600 I went into my preferences and tried to change my code template for a new Java file (change the copyright to be 2005 now) but clicking on the Edit button did nothing. When I checked my log file, I found the following exception: !ENTRY org.eclipse.ui 4 0 2005-01-07 13:36:38.677 !MESSAGE java.lang.NullPointerException !STACK 0 java.lang.NullPointerException at org.eclipse.jdt.internal.ui.preferences.EditTemplateDialog.getPrefix(Unknown Source) at org.eclipse.jdt.internal.ui.preferences.EditTemplateDialog.createEditor(Unknown Source) at org.eclipse.jdt.internal.ui.preferences.EditTemplateDialog.createDialogArea(Unknown Source) at org.eclipse.jface.dialogs.Dialog.createContents(Unknown Source) at org.eclipse.jface.window.Window.create(Unknown Source) at org.eclipse.jface.dialogs.Dialog.create(Unknown Source) at org.eclipse.jdt.internal.ui.dialogs.StatusDialog.create(Unknown Source) at org.eclipse.jdt.internal.ui.preferences.EditTemplateDialog.create(Unknown Source) at org.eclipse.jface.window.Window.open(Unknown Source) at org.eclipse.jdt.internal.ui.preferences.CodeTemplateBlock.edit(Unknown Source) at org.eclipse.jdt.internal.ui.preferences.CodeTemplateBlock.doButtonPressed(Unknown Source) at org.eclipse.jdt.internal.ui.preferences.CodeTemplateBlock$CodeTemplateAdapter.customButtonPressed(Unknown Source) at org.eclipse.jdt.internal.ui.wizards.dialogfields.TreeListDialogField.buttonPressed(Unknown Source) at org.eclipse.jdt.internal.ui.wizards.dialogfields.TreeListDialogField.doButtonSelected(Unknown Source) at org.eclipse.jdt.internal.ui.wizards.dialogfields.TreeListDialogField.access$2(Unknown Source) at org.eclipse.jdt.internal.ui.wizards.dialogfields.TreeListDialogField$2.widgetSelected(Unknown Source) at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source) at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source) at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source) at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source) at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source) at org.eclipse.jface.window.Window.runEventLoop(Unknown Source) at org.eclipse.jface.window.Window.open(Unknown Source) at org.eclipse.ui.internal.OpenPreferencesAction.run(Unknown Source) at org.eclipse.jface.action.Action.runWithEvent(Unknown Source) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(Unknown Source) at org.eclipse.jface.action.ActionContributionItem.access$2(Unknown Source) at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(Unknown Source) at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source) at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source) at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source) at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source) at org.eclipse.ui.internal.Workbench.runEventLoop(Unknown Source) at org.eclipse.ui.internal.Workbench.runUI(Unknown Source) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Unknown Source) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(Unknown Source) at org.eclipse.ui.internal.ide.IDEApplication.run(Unknown Source) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(Unknown Source) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:273) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:129) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:85) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:58) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:60) at java.lang.reflect.Method.invoke(Method.java:391) at org.eclipse.core.launcher.Main.basicRun(Main.java:185) at org.eclipse.core.launcher.Main.run(Main.java:684)

Files changed in fix:
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/preferences/EditTemplateDialog.java