Project: JDT
Bug 194639 [clean up] Iterable loop converter removes used import
Reported: 2007-06-27 12:45:28 | Status: resolved fixed

N20070625-0010 Given: package test; import java.util.Collections; import java.util.Iterator; public class E01 { public void foo() { for|(Iterator iterator = Collections.singleton(Integer.valueOf(1)).iterator(); iterator.hasNext();) { Integer inter = (Integer) iterator.next(); System.out.println(inter); } } } 1. Replace | with caret 2. Ctrl-1 3. Convert to enhanced for loop Is: import for Collections is removed Should: not be removed

Files changed in fix:
org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/ConvertIterableLoopQuickFixTest.java org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/fix/ConvertIterableLoopOperation.java