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/src/org/eclipse/ui/internal/ide/misc/ResourceAndContainerGroup.java
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.internal.ide.IDEWorkbenchMessages;
/**
 * Workbench-level composite for resource and container specification by the user.
 * Services such as field validation are performed by the group.
 * The group can be configured to accept existing resources, or only
 * new resources.
 */
public class ResourceAndContainerGroup implements Listener {
    
    public static final int PROBLEM_NONE = 0;
    public static final int PROBLEM_RESOURCE_EMPTY = 1;
    public static final int PROBLEM_RESOURCE_EXIST = 2;
    public static final int PROBLEM_RESOURCE_CONTAINS_SEPARATOR = 3;
    public static final int PROBLEM_PATH_INVALID = 4;
    public static final int PROBLEM_CONTAINER_EMPTY = 5;
    public static final int PROBLEM_PROJECT_DOES_NOT_EXIST = 6;
    public static final int PROBLEM_NAME_INVALID = 7;
    
    private Listener client;
    
    private boolean allowExistingResources = false;
    
    private String resourceType = IDEWorkbenchMessages
            .getString("ResourceGroup.resource");