Bug 41584 Search references not hitting build path for working set [search]
This happens in 3.0M2 If I'm searching for references of a method, I usually right click, Search->References->Workspace. However, with large workspaces, this can take pretty long, so I've gotten in the habit of searching for references within a working set. I usually define a workingset for each project and all its contents. The problem is, when I search for references of a method in the workingset, it does not find references to that symbol from the thirdparty jars I have attached to the project's build path (verified the jar is selected as part of the working set). However, if I search the workspace, it does find the references in that thirdparty jar. This is usually for a method defined in the thirdparty jar that I use, and want to see how it is used by the thirdparty.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchScopeFactory.java
*******************************************************************************/
package org.eclipse.jdt.internal.ui.search;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.window.Window;
import org.eclipse.ui.IWorkingSet;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.IWorkingSetSelectionDialog;
import org.eclipse.search.ui.ISearchResultViewEntry;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.search.IJavaSearchScope;
import org.eclipse.jdt.core.search.SearchEngine;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.browsing.LogicalPackage;
public class JavaSearchScopeFactory {
	private static JavaSearchScopeFactory fgInstance;
	private static final IJavaSearchScope EMPTY_SCOPE= SearchEngine.createJavaSearchScope(new IJavaElement[] {});
	private static final Set EMPTY_SET= new HashSet(0);