Bug 126567 [wizards] org.eclipse.ui.newWizards class is incorrectly cast to Wizard
reproductible on Eclipse 3.1 and on Version: 3.2.0, Build id: I20051102-1600 The documentation of org.eclipse.ui.newWizards extension point states: "The class identified in this extension [...] must implement the INewWizard interface. Most wizards do so by extending the platform Wizard class although this is an implementation mechanism and not required by the extension point." We have registered a class (that implements INewWizard but doesn't extend Wizard) so it appears as an item on a list of wizards available by clicking on the "New Java Class" button (green 'C' icon with a plus sign). After selecting this wizard we get an exception: !ENTRY org.eclipse.ui 4 0 2006-02-06 16:10:44.267 !MESSAGE java.lang.ClassCastException !STACK 0 java.lang.ClassCastException at org.eclipse.jdt.internal.ui.wizards.OpenTypeWizardAction.createWizard(OpenTypeWizardAction.java:66) at org.eclipse.jdt.internal.ui.wizards.AbstractOpenWizardAction.run(AbstractOpenWizardAction.java:149) at org.eclipse.jface.action.Action.runWithEvent(Action.java:996) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:544) at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:494) at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:406) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:896) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3236) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2856) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1774) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1738) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:376) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:106) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:165) 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.invokeFramework(Main.java:338) at org.eclipse.core.launcher.Main.basicRun(Main.java:282) at org.eclipse.core.launcher.Main.run(Main.java:977) at org.eclipse.core.launcher.Main.main(Main.java:952) Now
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/AbstractOpenWizardAction.java
/**
	 * Configures the selection to be used as initial selection of the wizard. 
	 * @param selection the selection to be set or <code>null</code> to use the selection of the active workbench window
	 */
	public void setSelection(IStructuredSelection selection) {
		fSelection= selection;
	}
	
	/**
	 * Returns the configured shell. If no shell has been configured using {@link #setShell(Shell)},
	 * 	the shell of the currently active workbench is returned.
	 * @return the configured shell
	 */
	protected Shell getShell() {
		if (fShell == null) {
			return JavaPlugin.getActiveWorkbenchShell();
		}
		return fShell;
	}
	
	/**
	 * Configures the shell to be used as parent shell by the wizard.
	 * @param shell the shell to be set or <code>null</code> to use the shell of the active workbench window
	 */
	public void setShell(Shell shell) {
		fShell= shell;
	}
	
	/**