Project: Eclipse_Platform_UI
Bug 84325 [Import/Export] ClassCastException in WizardResourceImportPage
Reported: 2005-02-03 08:15:05 | Status: verified fixed

if the user tries to set an existent file as destinationFolder, the method getSpecifiedContainer() doesn't check if it's a Folder or not and then throws an ClassCastException. No message is showed to explain that specified path is not valid (and why). The result of "Import ..."/"file system" into an existent file is: (stored inside the log) java.lang.ClassCastException at org.eclipse.ui.dialogs.WizardResourceImportPage.getSpecifiedContainer(WizardResourceImportPage.java:302) at org.eclipse.ui.wizards.datatransfer.WizardFileSystemResourceImportPage1.sourceConflictsWithDestination(WizardFileSystemResourceImportPage1.java:906) at org.eclipse.ui.wizards.datatransfer.WizardFileSystemResourceImportPage1.validateSourceGroup(WizardFileSystemResourceImportPage1.java:886) at org.eclipse.ui.dialogs.WizardDataTransferPage.determinePageCompletion(WizardDataTransferPage.java:165) at org.eclipse.ui.dialogs.WizardResourceImportPage.determinePageCompletion(WizardResourceImportPage.java:509) at org.eclipse.ui.dialogs.WizardResourceImportPage.updateWidgetEnablements(WizardResourceImportPage.java:420) at org.eclipse.ui.wizards.datatransfer.WizardFileSystemResourceImportPage1.updateWidgetEnablements(WizardFileSystemResourceImportPage1.java:872) at org.eclipse.ui.dialogs.WizardResourceImportPage$1.checkStateChanged(WizardResourceImportPage.java:196) at org.eclipse.ui.internal.ide.dialogs.ResourceTreeAndListGroup$4.run(ResourceTreeAndListGroup.java:634) at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:616) at org.eclipse.core.runtime.Platform.run(Platform.java:747) at org.eclipse.ui.internal.ide.dialogs.ResourceTreeAndListGroup.notifyCheckStateChangeListeners(ResourceTreeAndListGroup.java:632) at org.eclipse.ui.internal.ide.dialogs.ResourceTreeAndListGroup$1.run(ResourceTreeAndListGroup.java:167) at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69) at org.eclipse.ui.internal.ide.dialogs.ResourceTreeAndListGroup.checkStateChanged(ResourceTreeAndListGroup.java:160) at org.eclipse.jface.viewers.CheckboxTableViewer$1.run(CheckboxTableViewer.java:175) at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:616) at org.eclipse.core.runtime.Platform.run(Platform.java:747) at org.eclipse.jface.viewers.CheckboxTableViewer.fireCheckStateChanged(CheckboxTableViewer.java:173) at org.eclipse.jface.viewers.CheckboxTableViewer.handleSelect(CheckboxTableViewer.java:256) at org.eclipse.jface.viewers.StructuredViewer$4.widgetSelected(StructuredViewer.java:718) at org.eclipse.jface.util.OpenStrategy.fireSelectionEvent(OpenStrategy.java:180) at org.eclipse.jface.util.OpenStrategy.access$3(OpenStrategy.java:175) at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:324) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:954) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2595) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2298) at org.eclipse.jface.window.Window.runEventLoop(Window.java:668) at org.eclipse.jface.window.Window.open(Window.java:648) at org.eclipse.ui.actions.ImportResourcesAction.run(ImportResourcesAction.java:145) at org.eclipse.ui.actions.BaseSelectionListenerAction.runWithEvent(BaseSelectionListenerAction.java:166) at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:915) at org.eclipse.jface.action.ActionContributionItem.access$2 (ActionContributionItem.java:866) at org.eclipse.jface.action.ActionContributionItem$7.handleEvent(ActionContributionItem.java:785) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:82) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:954) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2595) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2298) at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1377) at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1348) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:254) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:141) at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:96) at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:335) 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: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:185) at org.eclipse.core.launcher.Main.run(Main.java:704) at org.eclipse.core.launcher.Main.main(Main.java:688)

Files changed in fix:
bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/dialogs/WizardResourceImportPage.java