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
"	}\r\n" + 
				"}");
		ICompilationUnit unit= pack.createCompilationUnit("A.java", buf.toString(), false, null);
		List proposals= fetchConvertingProposal(buf, unit);
		assertNotNull(fConvertLoopProposal);
		assertCorrectLabels(proposals);
		String preview= getPreviewContent(fConvertLoopProposal);
		buf= new StringBuffer();
		buf.append("package test;\r\n" + 
				"import java.util.Collection;\r\n" + 
				"import java.util.Iterator;\r\n" + 
				"public class A {\r\n" + 
				"	public A() {\r\n" + 
				"		Collection<Collection<String>> cc= null;\r\n" + 
				"		for (Collection<String> c : cc) {\r\n" + 
				"			for (final Iterator<String> inner= c.iterator(); inner.hasNext();) {\r\n" + 
				"				System.out.println(inner.next());\r\n" + 
				"			}\r\n" + 
				"		}\r\n" + 
				"	}\r\n" + 
				"}");
		String expected= buf.toString();
		assertEqualString(preview, expected);
	}
	public void testMethodCall3() 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" + 
				"import java.util.Iterator;\r\n" +