View | Details | Raw Unified | Return to bug 316937 | Differences between
and this patch

Collapse All | Expand All

(-)codeassist/org/eclipse/jdt/internal/codeassist/InternalCompletionProposal.java (-1 / +19 lines)
Lines 311-317 Link Here
311
			for(int i = 0;	i< length ; i++){
311
			for(int i = 0;	i< length ; i++){
312
				args[i] = new String(paramTypeNames[i]);
312
				args[i] = new String(paramTypeNames[i]);
313
			}
313
			}
314
			IMethod method = type.getMethod(new String(selector),args);
314
			// https://bugs.eclipse.org/bugs/show_bug.cgi?id=316937
315
			// BinaryType#getMethod() creates a new instance of BinaryMethod, which is a dummy.
316
			// Instead use IType#findMethods() to get a handle to the method.
317
			IMethod method = null;
318
			{
319
				IType enclosingType = type.getDeclaringType();
320
				if (enclosingType != null && CharOperation.equals(type.getElementName().toCharArray(), selector)) {
321
					String[] newArgs = new String[length + 1];
322
					newArgs[0] = Signature.createTypeSignature(enclosingType.getFullyQualifiedName(), true);
323
					System.arraycopy(args, 0, newArgs, 1, length);
324
					method = type.getMethod(new String(selector), newArgs);
325
				} else {
326
					method = type.getMethod(new String(selector), args);
327
				}
328
				IMethod[] methods = type.findMethods(method);
329
				if (methods != null && methods.length > 0) {
330
					method = methods[0];
331
				}
332
			}
315
			try{
333
			try{
316
				parameters = new char[length][];
334
				parameters = new char[length][];
317
				String[] params = method.getParameterNames();
335
				String[] params = method.getParameterNames();
(-)model/org/eclipse/jdt/internal/core/BinaryMethod.java (-1 / +4 lines)
Lines 181-187 Link Here
181
181
182
	// try to see if we can retrieve the names from the attached javadoc
182
	// try to see if we can retrieve the names from the attached javadoc
183
	IBinaryMethod info = (IBinaryMethod) getElementInfo();
183
	IBinaryMethod info = (IBinaryMethod) getElementInfo();
184
	final int paramCount = Signature.getParameterCount(new String(info.getMethodDescriptor()));
184
	// https://bugs.eclipse.org/bugs/show_bug.cgi?id=316937
185
	// Use Signature#getParameterCount() only if the argument names are not already available.
186
	final int paramCount = info.getArgumentNames() == null ? info.getArgumentNames().length : 
187
										Signature.getParameterCount(new String(info.getMethodDescriptor()));
185
	if (paramCount != 0) {
188
	if (paramCount != 0) {
186
		// don't try to look for javadoc for synthetic methods
189
		// don't try to look for javadoc for synthetic methods
187
		int modifiers = getFlags();
190
		int modifiers = getFlags();

Return to bug 316937