Project: JDT
Bug 47971 java formatter preferences: IllegalArgumentException when opening new formatter page
Reported: 2003-12-03 08:28:03 | Status: resolved fixed

I20031202 0. Have old formatter preferences specifying to use spaces instead of tabs 1. Create a new formatting style based on "Java Conventions" 2. Set Indentation -> Use Tab character 3. Format some code so its indentation gets changed -> Note that spaces get inserted instead of tabs 4. Go to the Preferences, Java->Code Formatter -> IllegalArgumentException, stack trace below !ENTRY org.eclipse.jface 4 2 Dec 03, 2003 11:53:48.224 !MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jface". !STACK 0 java.lang.IllegalArgumentException at org.eclipse.jdt.internal.ui.preferences.OptionsConfigurationBlock$ControlData.getSelection(OptionsConfigurationBlock.java:83) at org.eclipse.jdt.internal.ui.preferences.OptionsConfigurationBlock.addCheckBox(OptionsConfigurationBlock.java:172) at org.eclipse.jdt.internal.ui.preferences.CodeFormatterConfigurationBlock.createContents(CodeFormatterConfigurationBlock.java:210) at org.eclipse.jdt.internal.ui.preferences.CodeFormatterPreferencePage.createContents(CodeFormatterPreferencePage.java:96) at org.eclipse.jface.preference.PreferencePage.createControl(PreferencePage.java:217) at org.eclipse.jdt.internal.ui.preferences.CodeFormatterPreferencePage.createControl(CodeFormatterPreferencePage.java:84) at org.eclipse.jface.preference.PreferenceDialog$12.run(PreferenceDialog.java:986) at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:824) at org.eclipse.core.runtime.Platform.run(Platform.java:479) at org.eclipse.jface.preference.PreferenceDialog.showPage(PreferenceDialog.java:984) at org.eclipse.jface.preference.PreferenceDialog.selectSavedItem(PreferenceDialog.java:670) at org.eclipse.jface.preference.PreferenceDialog$3.run(PreferenceDialog.java:297) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:84) at org.eclipse.jface.preference.PreferenceDialog.createContents(PreferenceDialog.java:292) at org.eclipse.jface.window.Window.create(Window.java:305) at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:883) at org.eclipse.ui.internal.OpenPreferencesAction.run(OpenPreferencesAction.java:70) at org.eclipse.jface.action.Action.runWithEvent(Action.java:842) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:535) at org.eclipse.jface.action.ActionContributionItem.access$4(ActionContributionItem.java:487) at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:459) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:967) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:1839) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1619) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1486) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1462) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:242) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:139) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:47) at org.eclipse.core.internal.applicationrunner.ApplicationRunnerActivator$1.run(ApplicationRunnerActivator.java:85) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:87) 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:324) at org.eclipse.core.internal.boot.OSGiBootLoader.basicRun(OSGiBootLoader.java:239) at org.eclipse.core.internal.boot.OSGiBootLoader.run(OSGiBootLoader.java:665) at org.eclipse.core.internal.boot.OSGiBootLoader.run(OSGiBootLoader.java:652) 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:324) at org.eclipse.core.launcher.Main.basicRun(Main.java:299) at org.eclipse.core.launcher.Main.run(Main.java:767) at org.eclipse.core.launcher.Main.main(Main.java:601)

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