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
}
		return true;
	}
	/**
	 * Create the project described in record. If it is successful return true.
	 * 
	 * @param record
	 * @return boolean <code>true</code> if successful
	 * @throws InterruptedException 
	 */
	private boolean createExistingProject(final ProjectRecord record, IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
		String projectName = record.getProjectName();
		final IWorkspace workspace = ResourcesPlugin.getWorkspace();
		final IProject project = workspace.getRoot().getProject(projectName);
		if (record.description == null) {
			
			record.description = workspace.newProjectDescription(projectName);
			IPath locationPath = new Path(record.projectSystemFile
					.getAbsolutePath());
			
			
			
			if (Platform.getLocation().isPrefixOf(locationPath)) {
				record.description.setLocation(null);
			} else {
				record.description.setLocation(locationPath);
			}
		} else {
			record.description.setName(projectName);
		}