Bug 26611 Code completion assumes multiple args of same type will take same value
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.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/ParameterGuessingProposal.java
} else {
				LinkedPositionManager manager= new LinkedPositionManager(document);
				for (int i= 0; i != positionOffsets.length; i++)
					manager.addPosition(replacementOffset + positionOffsets[i], positionLengths[i]);
				
				LinkedPositionUI editor= new LinkedPositionUI(fViewer, manager);
				editor.setFinalCaretOffset(replacementOffset + replacementString.length());
				editor.enter();
	
				fSelectedRegion= editor.getSelectedRegion();	
			}
		} catch (BadLocationException e) {
			JavaPlugin.log(e);	
			openErrorDialog(e);
		} catch (JavaModelException e) {
			JavaPlugin.log(e);	
			openErrorDialog(e);			
		}
	}
	
	private String[] guessParameters() throws JavaModelException {