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
StringBuffer buffer= new StringBuffer(string.length());
		buffer.append("<pre>"); 
	
		for (int i= 0; i != string.length(); i++) {
			char ch= string.charAt(i);
			
			switch (ch) {
				case '&':
					buffer.append("&amp;"); 
					break;
					
				case '<':
					buffer.append("&lt;"); 
					break;
				case '>':
					buffer.append("&gt;"); 
					break;
				case '\t':
					buffer.append("    "); 
					break;
				case '\n':
					buffer.append("<br>"); 
					break;
				default:
					buffer.append(ch);
					break;
			}
		}
		buffer.append("</pre>"); 
		return buffer.toString();