Project: JDT
Bug 26611 Code completion assumes multiple args of same type will take same value
Reported: 2002-11-18 15:16:44 | Status: resolved fixed

Build 20021115 (M3) 1) Start with the following JCU: public abstract class A { private int fieldInt = 5; public void foo(int a, int b, int c) { } public void bar() { int integer = 5; fo<cursor-is-here> } } 2) Invoke code assist at the cursor position indicated above 3) From the list of completions, select the method foo -> It guesses the parameter values, and highlights and underlines the first value, "integer". So far so good. 4) Type "fieldInt" as the first parameter value. -> It replaces all three parameters with the value "fieldInt". Not expected, but fine. 5) Hit tab to accept the guess for the first parameter. -> The cursor goes to the end of the line. What I expect: The method "foo" has three distinct parameters. I would expect to have to hit tab three times, once for each parameter. This template assumes that there is only one variable to complete, and that all three parameters of type "int" will have the same value.

Files changed in fix:
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/ParameterGuesser.java org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/ParameterGuessingProposal.java