Community
Participate
Working Groups
BUILD: 20020409 STEPS: 1 Open workbench preferences. 2 Select "Close editors automaticly" 3 Press OK 4 Open workbench preferences again 5 Deselect "Close editors automaticly" 6 Press OK again. *** The following ClassCastException will happen. The Property was set as a Boolean to the PropertyChangeEvent's newValue and oldValue should be booleans. See the method: setValue(String name, boolean value), it fires an event with Booleans when setting a new value but if fires an event with String when setting to default. java.lang.ClassCastException: java.lang.String at org.eclipse.ui.internal.WorkbenchActionBuilder.propertyChange (WorkbenchActionBuilder.java:930) at org.eclipse.ui.plugin.AbstractUIPlugin$CompatibilityPreferenceStore.fireProperty ChangeEvent(AbstractUIPlugin.java:228) at org.eclipse.ui.plugin.AbstractUIPlugin$1.propertyChange (AbstractUIPlugin.java:173) at org.eclipse.core.runtime.Preferences.firePropertyChangeEvent (Preferences.java:505) at org.eclipse.core.runtime.Preferences.internalSetToDefault (Preferences.java:1184) at org.eclipse.core.runtime.Preferences.setValue(Preferences.java:550) at org.eclipse.ui.plugin.AbstractUIPlugin$CompatibilityPreferenceStore.setValue (AbstractUIPlugin.java:438) at org.eclipse.ui.internal.dialogs.WorkbenchPreferencePage.performOk (WorkbenchPreferencePage.java:441) at org.eclipse.jface.preference.PreferenceDialog.okPressed (PreferenceDialog.java:553) at org.eclipse.jface.preference.PreferenceDialog.buttonPressed (PreferenceDialog.java:174) at org.eclipse.jface.dialogs.Dialog$1.widgetSelected(Dialog.java:356) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java (Compiled Code)) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.jface.window.Window.runEventLoop(Window.java(Compiled Code)) at org.eclipse.jface.window.Window.open(Window.java:525) at org.eclipse.ui.internal.OpenPreferencesAction.run (OpenPreferencesAction.java:47) at org.eclipse.jface.action.Action.runWithEvent(Action.java:590) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection (ActionContributionItem.java:407) at org.eclipse.jface.action.ActionContributionItem.handleWidgetEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.jface.action.ActionContributionItem$ActionListener.handleEvent (ActionContributionItem.java(Compiled Code)) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java (Compiled Code)) at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java(Compiled Code)) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java (Compiled Code)) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java (Compiled Code)) at org.eclipse.ui.internal.Workbench.run(Workbench.java:819) at org.eclipse.core.internal.boot.InternalBootLoader.run (InternalBootLoader.java:777) at org.eclipse.core.boot.BootLoader.run(BootLoader.java:319) at java.lang.reflect.Method.invoke(Native Method) at org.eclipse.core.launcher.Main.basicRun(Main.java:190) at org.eclipse.core.launcher.Main.run(Main.java:549) at org.eclipse.core.launcher.Main.main(Main.java:390)
*** Bug 13443 has been marked as a duplicate of this bug. ***
Should fix for M5 to be consistent with the old JFace behaviour. The type of object in the event should match the type of the set method used. In this case, both oldValue and newValue should be Booleans.
Fixed and released to head. Available in builds >20020410.