Bug 82326 [Dialogs] ClassCastException creating folder
Build: I20050104 1) Create a simple project called "a" 2) Create a simple file in the project called "b" 3) Open the "New Folder" wizard 4) For the parent name, enter "a/b" 5) For the folder name, enter "c" 6) Click finish. ClassCastException: java.lang.ClassCastException: org/eclipse/core/internal/resources/File incompatible with org/eclipse/core/resources/IContainer at org.eclipse.ui.dialogs.ContainerGenerator$1.run(ContainerGenerator.java:169) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1688) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1708) at org.eclipse.ui.dialogs.ContainerGenerator.generateContainer(ContainerGenerator.java:158) at org.eclipse.ui.dialogs.WizardNewFolderMainPage$3.execute(WizardNewFolderMainPage.java:292) at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:98) at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1688) at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:110) at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:111)
bundles/org.eclipse.ui.ide/extensions/org/eclipse/ui/dialogs/ContainerGenerator.java
* <p>
     * Note: This method should be called within a workspace modify operation since
     * it may create resources.
     * </p>
     *
     * @param monitor a progress monitor
     * @return the container resource
     * @exception CoreException if the operation fails
     * @exception OperationCanceledException if the operation is canceled
     */
    public IContainer generateContainer(IProgressMonitor monitor)
            throws CoreException {
        IDEWorkbenchPlugin.getPluginWorkspace().run(new IWorkspaceRunnable() {
            public void run(IProgressMonitor monitor) throws CoreException {
                monitor
                        .beginTask(
                                IDEWorkbenchMessages
                                        .getString("ContainerGenerator.progressMessage"), 1000 * containerFullPath.segmentCount()); 
                if (container != null)
                    return;
                
                IWorkspaceRoot root = getWorkspaceRoot();
                container = (IContainer) root.findMember(containerFullPath);
                if (container != null)
                    return;
                
                container = root;
                for (int i = 0; i < containerFullPath.segmentCount(); i++) {
                    String currentSegment = containerFullPath.segment(i);
                    IResource resource = container.findMember(currentSegment);