Bug 76014 [search] Search for method declaration always use a string pattern [search]
org.eclipse.jdt.ui/ui/org/eclipse/jdt/ui/actions/FindDeclarationsInWorkingSetAction.java
/* (non-Javadoc)
	 * @see org.eclipse.jdt.ui.actions.FindDeclarationsAction#createJob(org.eclipse.jdt.core.IJavaElement, org.eclipse.jdt.internal.ui.search.JavaSearchResult)
	 */
	protected JavaSearchQuery createJob(IJavaElement element) throws JavaModelException {
		IWorkingSet[] workingSets= fWorkingSet;
		if (fWorkingSet == null) {
			workingSets= JavaSearchScopeFactory.getInstance().queryWorkingSets();
			if (workingSets == null)
				return null;
		}
		SearchUtil.updateLRUWorkingSets(workingSets);
		if (element.getElementType() == IJavaElement.METHOD) { 
			IMethod method= (IMethod)element;
			int searchFor= IJavaSearchConstants.METHOD;
			if (method.isConstructor())
				searchFor= IJavaSearchConstants.CONSTRUCTOR;
			String pattern= PatternStrings.getUnqualifiedMethodSignature(method);
			return new JavaSearchQuery(new PatternQuerySpecification(pattern, searchFor, true, getLimitTo(), getScope(workingSets), getScopeDescription(workingSets)));
		}
		else
			return new JavaSearchQuery(new ElementQuerySpecification(element, getLimitTo(), getScope(workingSets), getScopeDescription(workingSets)));
	}
	private IJavaSearchScope getScope(IWorkingSet[] workingSets) {
		return JavaSearchScopeFactory.getInstance().createJavaSearchScope(workingSets, true);
	}
	private String getScopeDescription(IWorkingSet[] workingSets) {
		return SearchMessages.getFormattedString("WorkingSetScope", new String[] {SearchUtil.toString(workingSets)}); 
	}
}