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/ui/org/eclipse/jdt/internal/ui/text/correction/ConvertIterableLoopProposal.java
final Name name= (Name) qualifier;
														fIterable= name.resolveBinding();
													} else if (qualifier instanceof MethodInvocation) {
														final MethodInvocation invocation= (MethodInvocation) qualifier;
														fIterable= invocation.resolveMethodBinding();
													} else if (qualifier instanceof FieldAccess) {
														final FieldAccess access= (FieldAccess) qualifier;
														fIterable= access.resolveFieldBinding();
													}
												}
											}
										}
									}
									}
								}
								return true;
							}
							public final boolean visit(final VariableDeclarationFragment node) {
								final IVariableBinding binding= node.resolveBinding();
								if (binding != null) {
									final ITypeBinding type= binding.getType();
									if (type != null) {
										ITypeBinding iterator= getSuperType(type, "java.util.Iterator"); 
										if (iterator != null)
											fIterator= binding;
										else {
											iterator= getSuperType(type, "java.util.Enumeration"); 
											if (iterator != null)
												fIterator= binding;
										}