Bug 85243 Invalid string pattern while searching on working set
Using 3.1 M4 build. Open editor on org.eclipse.jdt.internal.compiler.ast.Expression class and select computeConversion method. 1) Search for declarations in project => you get 5 instances in Search View: OK 2) Create a working set "jdt-core" with org.eclipse.jdt.core project 3) Search for declarations in working set "jdt-core" => you get 0 instances: KO (I expect same result than search in project as scope is identical) Looking at what happens, in step 1) SearchPattern is created using a IJavaElement, so there's no problem. But step 3) creates a SearchPattern using following string: "computeConversion(Scope, Scope, Scope)" which does not match the selected method! Debugging jdt-ui code, problems is in for loop of PatternStrings#getUnqualifiedMethodSignature(IMethod, boolean) method: String typeSig= Signature.toString(types[0]); should be String typeSig= Signature.toString(types[i]); instead...
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/search/PatternStrings.java
public static String getSignature(IJavaElement element) {
		if (element == null)
			return null;
		else
			switch (element.getElementType()) {
				case IJavaElement.METHOD:
					return getMethodSignature((IMethod)element);
				case IJavaElement.TYPE:
					return getTypeSignature((IType) element);
				case IJavaElement.FIELD:
					return getFieldSignature((IField) element);
				default:
					return element.getElementName();
			}
	}
	
	public static String getMethodSignature(IMethod method) {
		StringBuffer buffer= new StringBuffer();
		buffer.append(JavaElementLabels.getElementLabel(method.getDeclaringType(), JavaElementLabels.T_FULLY_QUALIFIED));
		boolean isConstructor= method.getElementName().equals(method.getDeclaringType().getElementName());
		if (!isConstructor) {
			buffer.append('.');
		}
		buffer.append(getUnqualifiedMethodSignature(method, !isConstructor));
		
		return buffer.toString();
	}