Bug 5232 Java Search page not initialized correctly from Navigator
1. Open the Navigator 2. Select a .java file (that's on the classpath) 3. Open the Search dialog (Ctrl+H) 4. Press Search ==> Nothing found. It should give the same result(s) as if the .java file would be selected in the Packages view.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/JavaSearchPage.java
/**
	 * Returns the current active editor part.
	 */
	private IEditorPart getEditorPart() {
		IWorkbenchWindow window= JavaPlugin.getActiveWorkbenchWindow();
		if (window != null) {
			IWorkbenchPage page= window.getActivePage();
			if (page != null)
				return page.getActiveEditor();
		}
		return null;
	}
	private IJavaSearchScope getSelectedResourcesScope() {
		ArrayList resources= new ArrayList(10);
		if (!getSelection().isEmpty() && getSelection() instanceof IStructuredSelection) {
			Iterator iter= ((IStructuredSelection)getSelection()).iterator();
			while (iter.hasNext()) {
				Object selection= iter.next();
				if (selection instanceof IResource)
					resources.add(selection);
				else if (selection instanceof IAdaptable) {
					IResource resource= (IResource)((IAdaptable)selection).getAdapter(IResource.class);
					if (resource != null)
						resources.add(resource);
				}
			}
		}
		return SearchEngine.createJavaSearchScope((IResource[])resources.toArray(new IResource[resources.size()]));
	}
}