### Eclipse Workspace Patch 1.0 #P org.eclipse.jdt.core Index: codeassist/org/eclipse/jdt/internal/codeassist/InternalCompletionProposal.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/InternalCompletionProposal.java,v retrieving revision 1.14 diff -u -r1.14 InternalCompletionProposal.java --- codeassist/org/eclipse/jdt/internal/codeassist/InternalCompletionProposal.java 22 Jan 2009 09:46:59 -0000 1.14 +++ codeassist/org/eclipse/jdt/internal/codeassist/InternalCompletionProposal.java 25 Jun 2010 09:45:11 -0000 @@ -311,7 +311,25 @@ for(int i = 0; i< length ; i++){ args[i] = new String(paramTypeNames[i]); } - IMethod method = type.getMethod(new String(selector),args); + // https://bugs.eclipse.org/bugs/show_bug.cgi?id=316937 + // BinaryType#getMethod() creates a new instance of BinaryMethod, which is a dummy. + // Instead use IType#findMethods() to get a handle to the method. + IMethod method = null; + { + IType enclosingType = type.getDeclaringType(); + if (enclosingType != null && CharOperation.equals(type.getElementName().toCharArray(), selector)) { + String[] newArgs = new String[length + 1]; + newArgs[0] = Signature.createTypeSignature(enclosingType.getFullyQualifiedName(), true); + System.arraycopy(args, 0, newArgs, 1, length); + method = type.getMethod(new String(selector), newArgs); + } else { + method = type.getMethod(new String(selector), args); + } + IMethod[] methods = type.findMethods(method); + if (methods != null && methods.length > 0) { + method = methods[0]; + } + } try{ parameters = new char[length][]; String[] params = method.getParameterNames(); Index: model/org/eclipse/jdt/internal/core/BinaryMethod.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/BinaryMethod.java,v retrieving revision 1.105 diff -u -r1.105 BinaryMethod.java --- model/org/eclipse/jdt/internal/core/BinaryMethod.java 7 Mar 2009 00:58:57 -0000 1.105 +++ model/org/eclipse/jdt/internal/core/BinaryMethod.java 25 Jun 2010 09:45:12 -0000 @@ -181,7 +181,10 @@ // try to see if we can retrieve the names from the attached javadoc IBinaryMethod info = (IBinaryMethod) getElementInfo(); - final int paramCount = Signature.getParameterCount(new String(info.getMethodDescriptor())); + // https://bugs.eclipse.org/bugs/show_bug.cgi?id=316937 + // Use Signature#getParameterCount() only if the argument names are not already available. + final int paramCount = info.getArgumentNames() == null ? info.getArgumentNames().length : + Signature.getParameterCount(new String(info.getMethodDescriptor())); if (paramCount != 0) { // don't try to look for javadoc for synthetic methods int modifiers = getFlags();