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
for (int i= 0; i < resources.length; i++)
			addJavaElements(javaElements, resources[i]);
	}
	private void addJavaElements(Set javaElements, IAdaptable resource) {
		IJavaElement javaElement= (IJavaElement)resource.getAdapter(IJavaElement.class);
		if (javaElement == null)
			
			return;
		
		if (javaElement.getElementType() == IJavaElement.PACKAGE_FRAGMENT) {
			
			try {
				addJavaElements(javaElements, ((IFolder)resource).members());
			} catch (CoreException ex) {
				
			}
		}
			
		addJavaElements(javaElements, javaElement);
	}
	private void addJavaElements(Set javaElements, IJavaElement javaElement) {
		switch (javaElement.getElementType()) {
			case IJavaElement.JAVA_PROJECT:
				addJavaElements(javaElements, (IJavaProject)javaElement);
				break;
			default:
				javaElements.add(javaElement);
		}
		
	}