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/ui/wizards/JavaCapabilityConfigurationPage.java
* <p>
	 * The default classpath entries must correspond the the given project.
	 * </p>
	 * <p>
	 * The caller of this method is responsible for creating the underlying project. The page will create the output,
	 * source and library folders if required.
	 * </p>
	 * <p>
	 * The project does not have to exist at the time of initialization, but must exist when executing the runnable
	 * obtained by <code>getRunnable()</code>.
	 * </p>
	 * @param jproject The Java project.
	 * @param defaultOutputLocation The default classpath entries or <code>null</code> to let the page choose the default
	 * @param defaultEntries The folder to be taken as the default output path or <code>null</code> to let the page choose the default
	 * @param defaultsOverrideExistingClasspath If set to <code>true</code>, an existing '.classpath' file is ignored. If set to <code>false</code>
	 * the given default classpath and output location is only used if no '.classpath' exists.
	 */
	public void init(IJavaProject jproject, IPath defaultOutputLocation, IClasspathEntry[] defaultEntries, boolean defaultsOverrideExistingClasspath) {
		if (!defaultsOverrideExistingClasspath && jproject.exists() && jproject.getProject().getFile(".classpath").exists()) { 
			defaultOutputLocation= null;
			defaultEntries= null;
		}
		getBuildPathsBlock().init(jproject, defaultOutputLocation, defaultEntries);
		fJavaProject= jproject;
	}	
	/* (non-Javadoc)
	 * @see WizardPage#createControl
	 */	
	public void createControl(Composite parent) {
		Composite composite= new Composite(parent, SWT.NONE);