Bug 41523 Keep Order of libs when editing library [build path]
When I edit a library in the Properties dialog of my project using "Properties"->"Java Build Path"->"Libraries"->"Edit", e.g. changing the JRE from 1.4 to 1.3, or changing from an old version of a JAR to a newer one, the changed library is at the last position in the classpath. It should kept at the position it was.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/LibrariesWorkbookPage.java
libentries= openClassFolderDialog(null);
			break;			
		case IDX_EDIT: 
			editEntry();
			return;
		case IDX_REMOVE: 
			removeEntry();
			return;			
		}
		if (libentries != null) {
			int nElementsChosen= libentries.length;					
			
			List cplist= fLibrariesList.getElements();
			List elementsToAdd= new ArrayList(nElementsChosen);
			
			for (int i= 0; i < nElementsChosen; i++) {
				CPListElement curr= libentries[i];
				if (!cplist.contains(curr) && !elementsToAdd.contains(curr)) {
					elementsToAdd.add(curr);
					curr.setAttribute(CPListElement.SOURCEATTACHMENT, guessAttachment(curr));
					curr.setAttribute(CPListElement.JAVADOC, JavaUI.getLibraryJavadocLocation(curr.getPath()));
				}
			}
			fLibrariesList.addElements(elementsToAdd);
			fLibrariesList.postSetSelection(new StructuredSelection(libentries));
		}
	}
	
	protected void libaryPageDoubleClicked(TreeListDialogField field) {
		List selection= fLibrariesList.getSelectedElements();