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
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.formatter.DefaultCodeFormatterConstants;
import org.eclipse.jdt.ui.PreferenceConstants;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.text.correction.AssistContext;
import org.eclipse.jdt.internal.ui.text.correction.CUCorrectionProposal;
import org.eclipse.jdt.internal.ui.text.correction.ConvertIterableLoopProposal;
import org.eclipse.jdt.testplugin.JavaProjectHelper;
import org.eclipse.jdt.testplugin.TestOptions;
import org.eclipse.jdt.ui.tests.core.ProjectTestSetup;
public final class ConvertIterableLoopQuickFixTest extends QuickFixTest {
	private static final Class THIS= ConvertIterableLoopQuickFixTest.class;
	public static Test allTests() {
		return new ProjectTestSetup(new TestSuite(THIS));
	}
	public static Test setUpTest(Test test) {
		return new ProjectTestSetup(test);
	}
	public static Test suite() {
		return allTests();
	}
	private ConvertIterableLoopProposal fConvertLoopProposal;
	private IJavaProject fProject;
	private IPackageFragmentRoot fSourceFolder;
	public ConvertIterableLoopQuickFixTest(String name) {
		super(name);
	}
	private List fetchConvertingProposal(StringBuffer buf, ICompilationUnit cu) throws Exception {