Bug 86465 ResultCollector made non-extendable in 3.1M5a
I know ResultCollector is part of the internal API, but AFAIK it is the only entrypoint to provide Java completions in non-java files (such as JSPs, HBM.xml, etc.) without reimplementing the logic found in it. Until now it has been quite easy to adapt it for many purposes by extending it, but between 3.1M4 and M5 the internalAcceptMethod has been made private instead of protected. I would suggest to make this method protected again or even better provide an API that could reuse the JDT completion logic.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/ResultCollector.java
return new AnonymousTypeCompletionProposal(fJavaProject, fCompilationUnit, start, length, new String(completionName), nameBuffer.toString(), declTypeBuf.toString(), relevance);
	}
	protected JavaCompletionProposal createTypeCompletion(CompletionProposal typeProposal) {
		char[] signature= typeProposal.getSignature();
		char[] packageName= Signature.getSignatureQualifier(signature); 
		char[] typeName= Signature.getSignatureSimpleName(signature);
		
		String completion= String.valueOf(typeProposal.getCompletion());
		int modifiers= typeProposal.getFlags();
		int start= typeProposal.getReplaceStart();
		int end= typeProposal.getReplaceEnd();
		int relevance= typeProposal.getRelevance();
		
		ImageDescriptor descriptor= JavaElementImageProvider.getTypeImageDescriptor(false, false, modifiers, false);
		if (Flags.isDeprecated(modifiers))
			descriptor= getDeprecatedDescriptor(descriptor);
		ProposalInfo info= new ProposalInfo(fJavaProject, packageName, typeName);
		
		StringBuffer buf= new StringBuffer();
		buf.append(typeName);
		if (packageName.length > 0) {
			buf.append(" - "); 
			buf.append(packageName);
		}
		String name= buf.toString();
		JavaCompletionProposal proposal= new JavaTypeCompletionProposal(completion, fCompilationUnit, start, getLength(start, end), getImage(descriptor), name, relevance, String.valueOf(typeName), String.valueOf(packageName));
		proposal.setProposalInfo(info);
		proposal.setTriggerCharacters(TYPE_TRIGGERS);
		return proposal;
	}