Bug 119923 [clean up][infrastructure] ConvertForLoop should use ContextSensitiveImportRewriteContext
Version: 3.2.0 Build id: I20051206-1200
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ConvertIterableLoopProposal.java
}
		for (final Iterator iterator= names.iterator(); iterator.hasNext();)
			getPositionGroup(fIdentifierName).addProposal((String) iterator.next(), null);
		
		final Statement body= fStatement.getBody();
		if (body != null) {
			if (body instanceof Block) {
				final ListRewrite list= astRewrite.getListRewrite(body, Block.STATEMENTS_PROPERTY);
				for (final Iterator iterator= fOccurrences.iterator(); iterator.hasNext();) {
					final Statement parent= (Statement) ASTNodes.getParent((ASTNode) iterator.next(), Statement.class);
					if (parent != null && list.getRewrittenList().contains(parent)) {
						list.remove(parent, null);
						remover.registerRemovedNode(parent);
					}
				}
				final String text= name;
				body.accept(new ASTVisitor() {
					private boolean replace(final Expression expression) {
						final SimpleName node= ast.newSimpleName(text);
						astRewrite.replace(expression, node, group);
						remover.registerRemovedNode(expression);
						getPositionGroup(fIdentifierName).addPosition(astRewrite.track(node));
						return false;
					}
					public final boolean visit(final MethodInvocation node) {
						final IMethodBinding binding= node.resolveMethodBinding();
						if (binding != null && (binding.getName().equals("next") || binding.getName().equals("nextElement"))) { 
							final Expression expression= node.getExpression();
							if (expression instanceof Name) {
								final IBinding result= ((Name) expression).resolveBinding();