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/internal/ui/wizards/buildpaths/SourceContainerWorkbookPage.java
Object elem= selElements.get(i);
			if (elem instanceof CPListElementAttribute) {
				CPListElementAttribute attrib= (CPListElementAttribute) elem;
				String key= attrib.getKey();
				if (CPListElement.INCLUSION.equals(key)) {
					if (((IPath[]) attrib.getValue()).length == 0) {
						return false;
					}
				} else if (CPListElement.EXCLUSION.equals(key)) {
					if (((IPath[]) attrib.getValue()).length == 0) {
						return false;
					}
				} else if (attrib.getValue() == null) {
					return false;
				}
			} else if (elem instanceof CPListElement) {
				CPListElement curr= (CPListElement) elem;
				if (curr.getParentContainer() != null) {
					return false;
				}
			}
		}
		return true;
	}		
	
	private boolean canEdit(List selElements) {
		if (selElements.size() != 1) {
			return false;
		}
		Object elem= selElements.get(0);