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/JavaSearchScopeFactory.java
if (javaElement != null) {
			javaProject= javaElement.getJavaProject();
			if (javaProject != null)
				return javaProject;
		}
		IResource resource= (IResource) selectedElement.getAdapter(IResource.class);
		if (resource != null) {
			IProject project= resource.getProject();
			try {
				if (project != null && project.isAccessible() && project.hasNature(JavaCore.NATURE_ID)) {
					return JavaCore.create(project);
				}
			} catch (CoreException e) {
				
			}
		}
		return null;
	}
	
	public IProject[] getProjects(IJavaSearchScope scope) {
		IPath[] paths= scope.enclosingProjectsAndJars();
		HashSet temp= new HashSet();
		for (int i= 0; i < paths.length; i++) {
			IResource resource= ResourcesPlugin.getWorkspace().getRoot().findMember(paths[i]);
			if (resource != null && resource.getType() == IResource.PROJECT)
				temp.add(resource);
		}
		return (IProject[]) temp.toArray(new IProject[temp.size()]);
	}
	private Set getJavaElements(ISelection selection) {