Bug 89551 [content assist] Order of completion proposals does not seem correct
build I20050329-2000 1) create p/ZZZ.java package p; public class ZZZ {} 2) create q/X.java package q; public class X { void zzz() { zz<<cursor>> } } 3) do ctrl+space at <<curosr>> location ZZZ is the first proposal and zzz() the second. But in this case zzz() should be the best proposal.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/GenericJavaTypeProposal.java
import org.eclipse.jdt.core.CompletionContext;
import org.eclipse.jdt.core.CompletionProposal;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.ITypeParameter;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.Signature;
import org.eclipse.jdt.internal.corext.template.java.SignatureUtil;
import org.eclipse.jdt.internal.ui.JavaPlugin;
import org.eclipse.jdt.internal.ui.javaeditor.EditorHighlightingSynchronizer;
import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
/**
 * An experimental proposal.
 */
public final class GenericJavaTypeProposal extends JavaTypeCompletionProposal {
	private IRegion fSelectedRegion; 
	private final CompletionProposal fProposal;
	public GenericJavaTypeProposal(CompletionProposal typeProposal, CompletionContext context, int offset, int length, ICompilationUnit cu, Image image, String displayString) {
		super(String.valueOf(typeProposal.getCompletion()), cu, offset, length, image, displayString, typeProposal.getRelevance(), String.valueOf(Signature.getSignatureSimpleName(typeProposal.getSignature())), String.valueOf(Signature.getSignatureQualifier(typeProposal.getSignature())));
		fProposal= typeProposal;
	}
	/*
	 * @see ICompletionProposalExtension#apply(IDocument, char)
	 */
	public void apply(IDocument document, char trigger, int offset) {
		
		CharSequence[] typeArgumentNames= computeTypeArgumentNames();
		
		if (typeArgumentNames.length == 0 || !shouldAppendArguments(document, offset)) {