Project: JDT
Bug 101296 [templates] only one guess available for multi-variable templates
Reported: 2005-06-22 13:09:51 | Status: resolved fixed

3.1-RC2 - have the CU below - invoke code assist at the caret (|) - note the foreach template proposed - select (don't apply) the template - wait until the preview appears - apply the template Expected: when tabbing to the Iterable in the for loop, there should be a proposal popup offering 'strings' and 'ints'. Actual: there is no popup -------- MVGuess.java------- public class MVGuess { void iterate(String[] strings, int... ints) { foreach } } ---------------------------- Reason: JavaContextType$Array.resolve() only sets the context's MultiVariableGuess if there isn't one there already. Showing the preview already sets the MultiVariableGuess. Proposed Fix: Always set the MultiVariableGuess - since every template is resolved anew when it is applied, the MVGuess of the template being applied will win.

Files changed in fix:
org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/template/java/JavaContextType.java