Bug 102846 [quick fix] Convert to enhanced for loop does not remove obsolete import
I20050627-1435 (3.1) The 'Convert to enhanced for loop' quick fix does not remove the obsolete import java.util.Iterator in this example: import java.util.Iterator; import java.util.List; public class Try { public static void print(List<String> names) { for (Iterator iter= names.iterator(); iter.hasNext();) { String name= (String) iter.next(); System.out.println(name); } } }
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/ConvertIterableLoopQuickFixTest.java
int offset= buf.toString().indexOf("for");
		AssistContext context= getCorrectionContext(cu, offset, 0);
		List proposals= collectAssists(context, false);
		for (Iterator it= proposals.iterator(); it.hasNext();) {
			CUCorrectionProposal proposal= (CUCorrectionProposal) it.next();
			if (proposal instanceof ConvertIterableLoopProposal) {
				fConvertLoopProposal= (ConvertIterableLoopProposal) proposal;
			}
		}
		return proposals;
	}
	protected void setUp() throws Exception {
		Hashtable options= TestOptions.getDefaultOptions();
		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_CHAR, JavaCore.SPACE);
		options.put(DefaultCodeFormatterConstants.FORMATTER_TAB_SIZE, "4");
		JavaCore.setOptions(options);
		IPreferenceStore store= JavaPlugin.getDefault().getPreferenceStore();
		store.setValue(PreferenceConstants.CODEGEN_ADD_COMMENTS, false);
		fProject= ProjectTestSetup.getProject();
		fSourceFolder= JavaProjectHelper.addSourceContainer(fProject, "src");
		fConvertLoopProposal= null;
	}
	protected void tearDown() throws Exception {
		JavaProjectHelper.clear(fProject, ProjectTestSetup.getDefaultClasspath());
	}
	public void testSimplestSmokeCase() throws Exception {
		IPackageFragment pack= fSourceFolder.createPackageFragment("test", false, null);
		StringBuffer buf= new StringBuffer();
		buf.append("package test;\r\n" + 
				"import java.util.Collection;\r\n" +