Project: JDT
Bug 204667 [template] Default resolution for 'var' variable should be closest variable
Reported: 2007-09-26 07:34:03 | Status: resolved fixed

I20070921-0919 Given: package test.root; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; public class Main { private Composite fField; public void foo(Composite param) { Composite local1 = null; Composite local2 = null; Button| } } 1. Replace '|' with cursor 2. Ctrl-Space 3. Select the SWT Button template Is: The proposals for the parent of the button are sorted like: fField local2 local1 param Should: Be sorted like: local2 local1 param fField The "closest" variable should be the default resolution for the 'var' variable

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