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
IProgressMonitor monitor) throws CoreException {
        try {
            monitor.beginTask("", 2000);
            projectHandle.create(new SubProgressMonitor(monitor, 1000));
            if (monitor.isCanceled())
                throw new OperationCanceledException();
            projectHandle.open(new SubProgressMonitor(monitor, 1000));
            if (monitor.isCanceled())
                throw new OperationCanceledException();
        } finally {
            monitor.done();
        }
        return projectHandle;
    }
    /**
     * Creates a project resource handle for the project with the given name.
     * This method does not create the project resource; this is the responsibility
     * of <code>createProject</code>.
     *
     * @param root the workspace root resource
     * @param projectName the name of the project
     * @return the new project resource handle
     */
    private IProject createProjectHandle(IWorkspaceRoot root, String projectName) {
        return root.getProject(projectName);
    }
    /**
     * Ensures that this generator's container resource exists. Creates any missing
     * resource containers along the path; does nothing if the container resource
     * already exists.