Bug 20424 Autocompletion "Iterate through Collection" should add "import java.util.Iterator"
I use autocompletion to generate an iteration through a collection. So this is the kind of code I'm getting: for (Iterator iter = myCollection.iterator(); iter.hasNext();) { type element = (type) iter.next(); However, autocompletion leaves my .java file without the neccessary import java.util.Iterator; required for all of this to make sense. I feel it's not as "auto" and not as "complete" as it could be (if you pardon the pun).
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/template/TemplateProposal.java
* A template proposal.
 */
public class TemplateProposal implements IJavaCompletionProposal {
	private final Template fTemplate;
	private final TemplateContext fContext;
	private final ITextViewer fViewer;
	private final Image fImage;
	private final IRegion fRegion;
	private TemplateBuffer fTemplateBuffer;
	private String fOldText;
	private IRegion fSelectedRegion; 
		
	/**
	 * Creates a template proposal with a template and its context.
	 * @param template  the template
	 * @param context   the context in which the template was requested.
	 * @param image     the icon of the proposal.
	 */	
	public TemplateProposal(Template template, TemplateContext context, IRegion region, ITextViewer viewer, Image image) {
		Assert.isNotNull(template);
		Assert.isNotNull(context);
		Assert.isNotNull(region);
		Assert.isNotNull(viewer);
		
		fTemplate= template;
		fContext= context;
		fViewer= viewer;
		fImage= image;
		fRegion= region;
	}