Bug 28547 Automatic detection of source folders doesn't work
Build 20021216 1. Create folder d:\temp\test\src\p 2. Create file X.java in d:\temp\test\src\p: package p; public class X { } 3. In a fresh workspace, create new Java project 4. Uncheck use default project contents, and point to d:\temp\test 5. Press Finish Observe: You get an error dialog saying that src/P [in Test] does not exist. The problem is that the NewProjectWizard is visiting the tree before it adds the Java nature to the project. It then asks the compilation unit /Test/src/p/X.java for its package declaration. This throws a JavaModeException since the project is not a Java project.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/NewProjectCreationWizardPage.java
/*
 * (c) Copyright IBM Corp. 2000, 2001.
 * All Rights Reserved.
 */
package org.eclipse.jdt.internal.ui.wizards;
import java.lang.reflect.InvocationTargetException;
import java.util.HashSet;
import java.util.Iterator;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IResourceVisitor;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.ui.dialogs.WizardNewProjectCreationPage;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IPackageDeclaration;
import org.eclipse.jdt.core.JavaConventions;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;