Bug 13034 Cannot create a Source Folder in a new Java Project
build 20020404 If you try and create a Source Folder in a Java Project you have just created you get an error preventing you from hitting finish. STEPS 1) Create Java Project Foo 2) Open New->Source Folder 3) Enter Bar as the name - you will get "Cannot nest entry Bar inside entry Foo/Bar" 4) Create a folder Bar. 5) Add it as a source folder in the Properties Dialog for Foo. No problem.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/BuildPathsBlock.java
/**
	 * Returns the current class path (raw). Note that the entries returned must not be valid.
	 */	
	public IClasspathEntry[] getRawClassPath() {
		List elements=  fClassPathList.getElements();
		int nElements= elements.size();
		IClasspathEntry[] entries= new IClasspathEntry[elements.size()];
		for (int i= 0; i < nElements; i++) {
			CPListElement currElement= (CPListElement) elements.get(i);
			entries[i]= currElement.getClasspathEntry();
		}
		return entries;
	}	
	
	
	
	
	private List getDefaultClassPath(IJavaProject jproj) {
		List list= new ArrayList();
		IResource srcFolder;
		if (JavaBasePreferencePage.useSrcAndBinFolders()) {
			String sourceFolderName= JavaBasePreferencePage.getSourceFolderName();
			srcFolder= jproj.getProject().getFolder(sourceFolderName);
		} else {
			srcFolder= jproj.getProject();
		}
		list.add(new CPListElement(IClasspathEntry.CPE_SOURCE, srcFolder.getFullPath(), srcFolder));
		IPath libPath= new Path(JavaRuntime.JRELIB_VARIABLE);
		IPath attachPath= new Path(JavaRuntime.JRESRC_VARIABLE);
		IPath attachRoot= new Path(JavaRuntime.JRESRCROOT_VARIABLE);