Bug 143757 [Import/Export] Cannot Import existing project into workspace if <name> different from actual folder name
Hi, I am not sure where this belongs Core/ UI or Debug; however discovered this today, In eclipse I can "Import exiting projects into Workspace", *IF and only IF* the <name></name> in the .project file matches the name of the folder in which it exists. To confirm; I created a Java project in my workspace, by name HelloWorld. Subsquently deleted it from workspace, WITHOUT deleting contents from the file system. Next in the file system, edited ONLY the ".project" file of this project. I changed <name>HellWorld</name> into <name>Not-HelloWorld</name> Returning back to eclipse, tried the command File -> Import -> Import exiting projects into Workspace Specified the folder for the HelloWorld. The Projects list box in the dialog listed Not-HelloWorld. (read the .project file). I selected it and clicked finnish. An error dialog popped up, saying Invalid project description. Detail showed D:\Users\Jeevan\workspace\HelloWorld overlaps the workspace location: D:\Users\Jeevan\workspace. I reedited the .project file manually and restored the <name></name> following which I was able to import it into my workspace. This happens with: Eclipse SDK Version: 3.1.2 Build id: M20060118-1600 But does NOT with a older version. Eclipse SDK Version: 3.1.0 Build id: I20050627-1435
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/wizards/datatransfer/WizardProjectsImportPage.java
}
	/**
	 * Get the array of valid project records that can be imported 
	 * from the source workspace or archive, selected by the user.
	 * If a project with the same name exists in both the source workspace and the 
	 * current workspace, it will not appear in the list of projects to import and 
	 * thus cannot be selected for import.
	 * 
	 * Method declared public for test suite.
	 * 
	 * @return ProjectRecord[] array of projects that can be imported into the workspace
	 */
	public ProjectRecord[] getValidProjects(){
		List validProjects = new ArrayList();
		for (int i = 0; i < selectedProjects.length; i++){
			if (!isProjectInWorkspace(selectedProjects[i].getProjectName())) {
				validProjects.add(selectedProjects[i]);
			}
		}
		return (ProjectRecord[]) validProjects.toArray(new ProjectRecord[validProjects.size()]);
	}
	
	/**
	 * Determine if the project with the given name is in the current workspace.
	 * 
	 * @param projectName String the project name to check
	 * @return boolean true if the project with the given name is in this workspace
	 */
	private boolean isProjectInWorkspace(String projectName){
		if (projectName == null) {