Bug 52742 Sort source folders alphabetically on project creation
If I add an existing directory as a project to eclipse, it correctly determines what all the source folders in that directory are, and adds them as source folders to my java build path. However, it adds them in some strange ordering (filesystem ordering perhaps?) and so if you have a lot of them, it is hard to visually scan them for what you want. It would be nice if instead when it created the project, it arranged all the source folders in alphabetical order. I can do this manually by sorting the .classpath file, but it seems like something that should be done to improve the user experience for people that are trying to use eclipse with existing filesystem layouts.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/ClassPathDetector.java
IClasspathEntry[] entries= (IClasspathEntry[]) cpEntries.toArray(new IClasspathEntry[cpEntries.size()]);
		if (!JavaConventions.validateClasspath(JavaCore.create(fProject), entries, outputLocation).isOK()) {
			return;
		}
			
		fResultClasspath= entries;
		fResultOutputFolder= outputLocation;
	}
	
	private IPath findInSourceFolders(IPath path) {
		Iterator iter= fSourceFolders.keySet().iterator();
		while (iter.hasNext()) {
			Object key= iter.next();
			List cus= (List) fSourceFolders.get(key);
			if (cus.contains(path)) {
				return (IPath) key;
			}
		}
		return null;
	}
	
	private IPath detectOutputFolder(List entries) {
		HashSet classFolders= new HashSet();
		
		for (Iterator iter= fClassFiles.iterator(); iter.hasNext();) {
			IFile file= (IFile) iter.next();
			IPath location= file.getLocation();
			if (location == null) {
				continue;
			}