Bug 42159 Searching for references ignores selected working set [search]
In build I20030826 (M3 candidate), if I select a java method and perform a Search>References and select a working set, the search is still performed on the entire workspace.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchScopeFactory.java
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) {
		Set javaElements;
		if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
			Iterator iter= ((IStructuredSelection) selection).iterator();
			javaElements= new HashSet(((IStructuredSelection) selection).size());
			while (iter.hasNext()) {
				Object selectedElement= iter.next();
				
				if (selectedElement instanceof ISearchResultViewEntry)
					selectedElement= ((ISearchResultViewEntry) selectedElement).getGroupByKey();
				if (selectedElement instanceof IJavaElement)
					addJavaElements(javaElements, (IJavaElement) selectedElement);
				else if (selectedElement instanceof IResource)
					addJavaElements(javaElements, (IResource) selectedElement);
				else if (selectedElement instanceof LogicalPackage)
					addJavaElements(javaElements, (LogicalPackage) selectedElement);
				else if (selectedElement instanceof IAdaptable) {
					IResource resource= (IResource) ((IAdaptable) selectedElement).getAdapter(IResource.class);
					if (resource != null)
						addJavaElements(javaElements, resource);
				}
			}
		} else {