Bug 4978 Completion list not ordered as expected
Type "fo" and press ctrl-space The best matches are the "for" templates but they are at the end of the list
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/template/TemplateEngine.java
while (tokenizer.hasMoreTokens()) {
				String token= tokenizer.nextToken().trim();
				list.add(token);
			}			
			arguments= (String[]) list.toArray(new String[list.size()]);			
		}
		Template[] templates= TemplateSet.getInstance().getMatchingTemplates(key, fPartitionType);
		TemplateContext context= new TemplateContext(sourceUnit, start, end, fViewer);
		for (int i= 0; i != templates.length; i++) {
			TemplateProposal proposal= new TemplateProposal(templates[i], arguments, context);
			if (templates[i].getName().equals(key)) {
				fExactProposals.add(proposal);
			} else {
				fNotExactProposals.add(proposal);
			}
		}
	}
	private static final int guessStart(String source, int end, String partitionType) {
		int start= end;
		if (partitionType.equals(JAVA)) {
			
			
			if ((start != 0) && (source.charAt(start - 1) == ARGUMENTS_END)) {
				start--;
				
				while ((start != 0) && (source.charAt(start - 1) != ARGUMENTS_BEGIN))
					start--;
				start--;
					
				if ((start != 0) && Character.isWhitespace(source.charAt(start - 1)))