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
if (cu == null)
				return null;
			
			IWorkingCopy[] workingCopies= JavaUI.getSharedWorkingCopies();
			int i= 0;
			while (i < workingCopies.length) {
				if (workingCopies[i].getOriginalElement().equals(cu)) {
					je= findInWorkingCopy(workingCopies[i], je, true);
					break;
				}
				i++;
			}
			if (je != null && !je.exists())
				je= cu.getElementAt(marker.getAttribute(IMarker.CHAR_START, 0));
			return je;
		} catch (CoreException ex) {
			ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.createJavaElement.title"), SearchMessages.getString("Search.Error.createJavaElement.message")); 
			return null;
		}
	}
	private static IJavaElement fixCUName(IMarker marker, String handle) {
			
			if (handle != null) {
				String resourceName= ""; 
				if (marker.getResource() != null)
					resourceName= marker.getResource().getName();
				if (!handleContainsWrongCU(handle, resourceName)) {
				 	handle= computeFixedHandle(handle, resourceName);
					IJavaElement je= JavaCore.create(handle);
				 	if (je != null && je.exists()) {