Bug 122176 Invalid project description when creating new project in default location when using NewJavaProjectWizardPage
When installing Parasoft Jtest 7.5 into Eclipse 3.2 M4, File > New > Jtest Example Project doesn't work when using the default location. I will attach a stack trace. This feature works in Eclipse 3.1.1, and I believe it also worked in Eclispe 3.2 M3. I've only tested it so far on Windows XP SP2. I've identified the problem in BuildPathsBlock.createProject(...): public static void createProject(IProject project, URI locationURI, IProgressMonitor monitor) throws CoreException { ... IProjectDescription desc= project.getWorkspace().newProjectDescription(project.getName()); if (locationURI != null && ResourcesPlugin.getWorkspace().getRoot().getLocationURI().equals(locationURI)) { locationURI= null; } desc.setLocationURI(locationURI); The locationURI is derived in NewJavaProjectWizardPage.java line 303 using IPath.toFile().toURI(), and can be for example: file:/C:/temp/workspace/ But ResourcesPlugin.getWorkspace().getRoot().getLocationURI() is: file:/C:/temp/workspace Hence, since they are not "equal", locationURI is not set to null, as is the expected behavior. Later in LocationValidator.validateProjectLocationURI(...) line 326 is when the failure status is created: if (FileUtil.isOverlapping(location, defaultDefaultLocation.toFile().toURI())) This problem does not appear in Eclipse 3.1.1, because only IPath's are being compared, not URI's: public static void createProject(IProject project, IPath locationPath, IProgressMonitor monitor) throws CoreException { ... if (Platform.getLocation().equals(locationPath)) { You might be able to fix this bug by just removing any slash at the end of the URI before calling equals. But maybe a more clever equals is required here.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/jarimport/JarImportWizard.java
* @throws CoreException
	 *             if an error occurs while setting up the class path
	 */
	private static void setupClassPath(final IJavaProject project, final IPackageFragmentRoot root, final IFolder folder, final IProgressMonitor monitor) throws IllegalStateException, CoreException {
		try {
			monitor.beginTask(JarImportMessages.JarImportWizard_prepare_import, 200);
			final IClasspathEntry entry= root.getRawClasspathEntry();
			final IClasspathEntry[] entries= project.getRawClasspath();
			final List list= new ArrayList();
			list.addAll(Arrays.asList(entries));
			final IFileStore store= EFS.getLocalFileSystem().getStore(JavaPlugin.getDefault().getStateLocation().append(STUB_FOLDER).append(project.getElementName()));
			if (store.fetchInfo(EFS.NONE, new SubProgressMonitor(monitor, 25, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL)).exists())
				store.delete(EFS.NONE, new SubProgressMonitor(monitor, 25, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL));
			store.mkdir(EFS.NONE, new SubProgressMonitor(monitor, 25, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL));
			folder.createLink(store.toURI(), IResource.NONE, new SubProgressMonitor(monitor, 25, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL));
			addExclusionPatterns(list, folder.getFullPath());
			for (int index= 0; index < entries.length; index++) {
				if (entries[index].equals(entry))
					list.add(index, JavaCore.newSourceEntry(folder.getFullPath()));
			}
			project.setRawClasspath((IClasspathEntry[]) list.toArray(new IClasspathEntry[list.size()]), false, new SubProgressMonitor(monitor, 100, SubProgressMonitor.SUPPRESS_SUBTASK_LABEL));
		} finally {
			monitor.done();
		}
	}
	
	private boolean fAutoBuild= true;
	
	private boolean fCancelled= false;