### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java,v retrieving revision 1.261 diff -u -r1.261 MatchLocator.java --- search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java 7 Dec 2005 11:27:15 -0000 1.261 +++ search/org/eclipse/jdt/internal/core/search/matching/MatchLocator.java 7 Dec 2005 17:33:03 -0000 @@ -519,7 +519,36 @@ return createMethodHandle(type, new String(method.selector), parameterTypeSignatures); } - +/* + * Create binary method handle + */ +IMethod createBinaryMethodHandle(IType type, char[] methodSelector, char[][] argumentTypeNames, MatchLocator locator) { + ClassFileReader reader = MatchLocator.classFileReader(type); + if (reader != null) { + IBinaryMethod[] methods = reader.getMethods(); + if (methods != null) { + int argCount = argumentTypeNames == null ? 0 : argumentTypeNames.length; + nextMethod : for (int i = 0, methodsLength = methods.length; i < methodsLength; i++) { + IBinaryMethod binaryMethod = methods[i]; + char[] selector = binaryMethod.getSelector(); + if (CharOperation.equals(selector, methodSelector)) { + char[] signature = binaryMethod.getGenericSignature(); + if (signature == null) signature = binaryMethod.getMethodDescriptor(); + char[][] parameterTypes = Signature.getParameterTypes(signature); + if (argCount != parameterTypes.length) continue nextMethod; + for (int j = 0; j < argCount; j++) { + char[] parameterTypeName = ClassFileMatchLocator.convertClassFileFormat(parameterTypes[j]); + if (!CharOperation.endsWith(Signature.toCharArray(Signature.getTypeErasure(parameterTypeName)), argumentTypeNames[j])) + continue nextMethod; + parameterTypes[j] = parameterTypeName; + } + return (IMethod) locator.createMethodHandle(type, new String(selector), CharOperation.toStrings(parameterTypes)); + } + } + } + } + return null; +} /* * Create method handle. * Store occurences for create handle to retrieve possible duplicate ones. Index: search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java,v retrieving revision 1.61 diff -u -r1.61 MethodLocator.java --- search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java 5 Dec 2005 20:38:39 -0000 1.61 +++ search/org/eclipse/jdt/internal/core/search/matching/MethodLocator.java 7 Dec 2005 17:33:04 -0000 @@ -483,22 +483,35 @@ if (type == null) return; // case of a secondary type char[] bindingSelector = methodBinding.selector; + boolean isBinary = type.isBinary(); + IMethod method = null; TypeBinding[] parameters = methodBinding.original().parameters; int parameterLength = parameters.length; - String[] parameterTypes = new String[parameterLength]; - for (int i = 0; i < parameterLength; i++) { - char[] typeName = parameters[i].shortReadableName(); - if (parameters[i].isMemberType()) { - typeName = CharOperation.subarray(typeName, CharOperation.indexOf('.', typeName)+1, typeName.length); + if (isBinary) { + char[][] parameterTypes = new char[parameterLength][]; + for (int i = 0; i