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
String title= NewWizardMessages.getString("NewProjectCreationWizardPage.EarlyCreationDialog.title"); 
			String description= NewWizardMessages.getString("NewProjectCreationWizardPage.EarlyCreationDialog.description"); 
			if (MessageDialog.openQuestion(getShell(), title, description)) {
				createAndDetect();
			}
		}
					
		fCurrProjectLocation= projLocation;
				
		IJavaProject prevProject= getJavaProject();
		IProject currProject= fMainPage.getProjectHandle();
		if ((prevProject == null) || !currProject.equals(prevProject.getProject())) {
			init(JavaCore.create(currProject), null, null, false);
		}		
	}
	private void createAndDetect() {
		IRunnableWithProgress op= new IRunnableWithProgress() {
			public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
				if (monitor == null)
					monitor= new NullProgressMonitor();		
		
				monitor.beginTask(NewWizardMessages.getString("NewProjectCreationWizardPage.EarlyCreationOperation.desc"), 3);				 
				try {
					BuildPathsBlock.createProject(fMainPage.getProjectHandle(), fMainPage.getLocationPath(), new SubProgressMonitor(monitor, 1));
					fProjectCreated= true;					
					initFromExistingStructures(new SubProgressMonitor(monitor, 2));						
				} catch (CoreException e) {
					throw new InvocationTargetException(e);
				}
			}