Bug 61198 References in Project: Title shows wrong project
I200405060200 1. in the Java editor select a type from project A which comes not from the same project as the opened file (project B). 2. search for refs in project ==> title says project A, matches are from B
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/SearchUtil.java
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 (je == null)
				return null;
			if (!marker.getAttribute(IJavaSearchUIConstants.ATT_IS_WORKING_COPY, false)) {
				if (je.exists())
					return je;
			}
			
			ICompilationUnit cu= (ICompilationUnit) je.getAncestor(IJavaElement.COMPILATION_UNIT);
			if (cu == null) {
				return je;
			}
			if (!cu.exists()) {
				IResource res= marker.getResource();
				if (res instanceof IFile) {
					cu= JavaCore.createCompilationUnitFrom((IFile) res);
					if (cu == null) {
						return je;
					}
					
				}
			}
			
			if (!je.exists()) {
				IJavaElement[] jElements= cu.findElements(je);