Bug 16822 Search results should be removed when cu is moved
Build 20020521 1. Create project P with 2 source folders 'src1 and 'src2' 2. Create cu X.java under 'P/src1'. public class X { } 3. Search for declaration of X 4. Move X.java to 'P/src2' Observe: The search result in still in the search view. Attempting to double-click on the search result opens a 'Search Error' dialog saying: An error occured while creating a Java element. Reason: X.java does not exist
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/SearchUtil.java
return find(cu.getImports(), element.getElementName());
			
			case IJavaElement.COMPILATION_UNIT:
				return cu;
		}
		
		return null;
	}
	
	/*
	 * XXX: Unchanged copy from JavaModelUtil
	 */
	private static IJavaElement find(IJavaElement[] elements, String name) {
		if (elements == null || name == null)
			return null;
			
		for (int i= 0; i < elements.length; i++) {
			if (name.equals(elements[i].getElementName()))
				return elements[i];
		}
		
		return null;
	}
	public static String toString(IWorkingSet[] workingSets) {
		Arrays.sort(workingSets, new WorkingSetComparator());
		String result= ""; 
		if (workingSets != null && workingSets.length > 0) {
			boolean firstFound= false;
			for (int i= 0; i < workingSets.length; i++) {
				String workingSetName= workingSets[i].getName();