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

Collapse All | Expand All

(-)model/org/eclipse/jdt/internal/core/BinaryMethod.java (-2 / +2 lines)
Lines 302-309 Link Here
302
			return this.parameterNames = names;
302
			return this.parameterNames = names;
303
		}
303
		}
304
	}
304
	}
305
	// if still no parameter names, produce fake ones
305
	// If still no parameter names, produce fake ones, but don't cache them (https://bugs.eclipse.org/bugs/show_bug.cgi?id=329671)
306
	return this.parameterNames = getRawParameterNames(paramCount);
306
	return getRawParameterNames(paramCount);
307
}
307
}
308
private char[][] splitParameters(char[] parametersSource, int paramCount) {
308
private char[][] splitParameters(char[] parametersSource, int paramCount) {
309
	// we have generic types as one of the parameter types
309
	// we have generic types as one of the parameter types
(-)src/org/eclipse/jdt/core/tests/model/CompletionTests.java (+50 lines)
Lines 34-39 Link Here
34
import org.eclipse.jdt.core.eval.IEvaluationContext;
34
import org.eclipse.jdt.core.eval.IEvaluationContext;
35
import org.eclipse.jdt.internal.codeassist.CompletionEngine;
35
import org.eclipse.jdt.internal.codeassist.CompletionEngine;
36
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
36
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
37
import org.eclipse.jdt.internal.core.JavaModelManager;
38
import org.eclipse.jdt.internal.core.JavaModelManager.PerProjectInfo;
37
import org.eclipse.jdt.internal.core.eval.EvaluationContextWrapper;
39
import org.eclipse.jdt.internal.core.eval.EvaluationContextWrapper;
38
40
39
public class CompletionTests extends AbstractJavaModelCompletionTests {
41
public class CompletionTests extends AbstractJavaModelCompletionTests {
Lines 21856-21859 Link Here
21856
			"myString1[LOCAL_VARIABLE_REF]{myString1, null, Ljava.lang.String;, myString1, null, " + (R_NON_STATIC + R_UNQUALIFIED + R_CASE + R_NON_RESTRICTED + R_EXACT_EXPECTED_TYPE) + "}",
21858
			"myString1[LOCAL_VARIABLE_REF]{myString1, null, Ljava.lang.String;, myString1, null, " + (R_NON_STATIC + R_UNQUALIFIED + R_CASE + R_NON_RESTRICTED + R_EXACT_EXPECTED_TYPE) + "}",
21857
			requestor.getResults());
21859
			requestor.getResults());
21858
}
21860
}
21861
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=329671
21862
public void testBug329671() throws CoreException, IOException {
21863
	Map options = this.currentProject.getOptions(false);
21864
	Object timeout = options.get(JavaCore.TIMEOUT_FOR_PARAMETER_NAME_FROM_ATTACHED_JAVADOC);
21865
	options.put(JavaCore.TIMEOUT_FOR_PARAMETER_NAME_FROM_ATTACHED_JAVADOC, "1"); //$NON-NLS-1$
21866
	this.currentProject.setOptions(options);
21867
21868
	try {
21869
		this.workingCopies = new ICompilationUnit[1];
21870
		this.workingCopies[0] = getWorkingCopy(
21871
			"/Completion/src/p/Test.java",
21872
			"package p;"+
21873
			"public class Test {\n" +
21874
			"  void foo(bug.X x) {\n" +
21875
			"    x.fo\n" +
21876
			"  }\n" +
21877
			"}\n");
21878
21879
		addLibrary(
21880
				"Completion",
21881
				"bug329671.jar",
21882
				null,
21883
				"bug329671_doc.zip",
21884
				false);
21885
21886
		try {
21887
			CompletionTestsRequestor2 requestor = new CompletionTestsRequestor2(true);
21888
			String str = this.workingCopies[0].getSource();
21889
			String completeBehind = "x.fo";
21890
			int cursorLocation = str.lastIndexOf(completeBehind) + completeBehind.length();
21891
			this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
21892
			assertResults("foo[METHOD_REF]{foo(), Lbug.X;, (Ljava.lang.Object;)V, foo, (arg0), 35}", requestor.getResults());
21893
			PerProjectInfo projectInfo = JavaModelManager.getJavaModelManager().getPerProjectInfoCheckExistence(this.currentProject.getProject());
21894
			projectInfo.javadocCache.flush();
21895
			options.put(JavaCore.TIMEOUT_FOR_PARAMETER_NAME_FROM_ATTACHED_JAVADOC, "5000"); //$NON-NLS-1$
21896
			this.currentProject.setOptions(options);
21897
			requestor = new CompletionTestsRequestor2(true);
21898
			this.workingCopies[0].codeComplete(cursorLocation, requestor, this.wcOwner);
21899
			assertResults("foo[METHOD_REF]{foo(), Lbug.X;, (Ljava.lang.Object;)V, foo, (param), 35}", requestor.getResults());
21900
		} finally {
21901
			removeLibrary("Completion", "bug329671.jar");
21902
		}
21903
	} finally {
21904
		if (timeout != null)
21905
			options.put(JavaCore.TIMEOUT_FOR_PARAMETER_NAME_FROM_ATTACHED_JAVADOC, timeout);
21906
		this.currentProject.setOptions(options);
21907
	}
21908
}
21859
}
21909
}

Return to bug 329671