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
public static int LRU_WORKINGSET_LIST_SIZE= 3;
	private static LRUWorkingSetsList fgLRUWorkingSets;
	
	private static final String DIALOG_SETTINGS_KEY= "JavaElementSearchActions"; 
	private static final String STORE_LRU_WORKING_SET_NAMES= "lastUsedWorkingSetNames"; 
	private static IDialogSettings fgSettingsStore;
	public static IJavaElement getJavaElement(IMarker marker) {
		if (marker == null || !marker.exists())
			return null;
		try {
			String handleId= (String)marker.getAttribute(IJavaSearchUIConstants.ATT_JE_HANDLE_ID);
			IJavaElement je= JavaCore.create(handleId);
			if (!marker.getAttribute(IJavaSearchUIConstants.ATT_IS_WORKING_COPY, false)) {
				if (je != null&& je.exists())
					return je;
				else {
					IJavaElement fixedJe= fixCUName(marker, handleId);
					if (fixedJe != null)
						return fixedJe;
					else
						return je;
				}
			}
			ICompilationUnit cu= findCompilationUnit(je);