Bug 31473 Search Engine should not search in working copies that aren't on the build path
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/SearchUtil.java
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()) {
				IJavaElement[] jElements= cu.findElements(je);
				if (jElements == null || jElements.length == 0)
					je= cu.getElementAt(marker.getAttribute(IMarker.CHAR_START, 0));
				else
					je= jElements[0];
			}
			return je;
		} catch (CoreException ex) {
			ExceptionHandler.handle(ex, SearchMessages.getString("Search.Error.createJavaElement.title"), SearchMessages.getString("Search.Error.createJavaElement.message")); 
			return null;
		}
	}
	public static IJavaElement getJavaElement(Object entry) {
		if (entry != null && isISearchResultViewEntry(entry))
			return getJavaElement((ISearchResultViewEntry)entry);
		return null;
	}
	public static IResource getResource(Object entry) {
		if (entry != null && isISearchResultViewEntry(entry))
			return ((ISearchResultViewEntry)entry).getResource();