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
return visit(left);
								}
							}
						} else if (right instanceof NullLiteral)
							return visit(left);
						return true;
					}
					public final boolean visit(final VariableDeclarationFragment node) {
						return visit(node.getName(), node.getInitializer());
					}
				});
			}
			final ASTNode root= fStatement.getRoot();
			if (root != null) {
				root.accept(new ASTVisitor() {
					public final boolean visit(final ForStatement node) {
						return false;
					}
					public final boolean visit(final SimpleName node) {
						final IBinding binding= node.resolveBinding();
						if (binding != null && binding.equals(fElement))
							fAssigned= true;
						return false;
					}
				});
			}
		}
		return fExpression != null && fIterable != null && fIterator != null && !fAssigned;
	}
}