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
private static String getUnqualifiedMethodSignature(IMethod method, boolean includeName) {
		StringBuffer buffer= new StringBuffer();
		if (includeName) {
			buffer.append(method.getElementName());
		}
		buffer.append('(');
		
		String[] types= method.getParameterTypes();
		for (int i= 0; i < types.length; i++) {
			if (i > 0)
				buffer.append(", "); 
			String typeSig= Signature.toString(types[0]);
			buffer.append(typeSig);
		}
		buffer.append(')');
		
		return buffer.toString();
	}
	public static String getUnqualifiedMethodSignature(IMethod method) {
		return getUnqualifiedMethodSignature(method, true);
	}
	public static String getTypeSignature(IType field) {
		return JavaElementLabels.getElementLabel(field, JavaElementLabels.T_FULLY_QUALIFIED | JavaElementLabels.T_TYPE_PARAMETERS);
	}	
	
	public static String getFieldSignature(IField field) {
		return JavaElementLabels.getElementLabel(field, JavaElementLabels.F_FULLY_QUALIFIED);
	}	
}