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
fUserReplacementLength= -1;
		
		fLastProblem= null;
		
		for (int i= 0; i < fResults.length; i++)
			fResults[i].clear();
		
		fSuggestedMethodNames.clear();
	}
	/**
	 * Specifies the context of the code assist operation.
	 * @param codeAssistOffset The Offset on which the code assist will be called.
	 * Used to modify the offsets of the created proposals. ('Non Eating')
	 * @param jproject The Java project to which the underlying source belongs.
	 * Needed to find types referred.
	 * @param cu The compilation unit that is edited. Used to add import statements.
	 * Can be <code>null</code> if no import statements should be added.
	 */
	public void reset(int codeAssistOffset, IJavaProject jproject, ICompilationUnit cu) {
		reset(codeAssistOffset, -1, jproject, cu);
	}
	
	/**
	 * Sets the text viewer.
	 */
	public void setViewer(ITextViewer viewer) {
		fTextViewer= viewer;
	}