Bug 34754 Array out of bounds in code assist
Build: 2.1 RC2 I got into a state when invoking code assist where the popup window was empty. I can't reproduce it, but I was typing while the popup was open. When I entered a character that narrowed down the possible search values to zero, I was left with an empty popup window. In my case I had entered resource.getK (and there are no methods starting with "getk" on IResource). This resulted in an ArrayIndexOutOfBoundsException in the log. I will attach the log.
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/java/JavaCompletionProposal.java
public void setRelevance(int relevance) {
		fRelevance= relevance;
	}
	/**
	 * Returns <code>true</code> if a words starts with the code completion prefix in the document,
	 * <code>false</code> otherwise.
	 */	
	protected boolean startsWith(IDocument document, int offset, String word) {
		int wordLength= word == null ? 0 : word.length();
		if (offset >  fReplacementOffset + wordLength)
			return false;
		
		try {
			int length= offset - fReplacementOffset;
			String start= document.get(fReplacementOffset, length);
			return word.substring(0, length).equalsIgnoreCase(start);
		} catch (BadLocationException x) {
		}
		
		return false;	
	}	
	private static boolean insertCompletion() {
		IPreferenceStore preference= JavaPlugin.getDefault().getPreferenceStore();
		return preference.getBoolean(PreferenceConstants.CODEASSIST_INSERT_COMPLETION);
	}
	/*
	 * @see org.eclipse.jface.text.contentassist.ICompletionProposalExtension1#apply(org.eclipse.jface.text.ITextViewer, char, int, int)
	 */
	public void apply(ITextViewer viewer, char trigger, int stateMask, int offset) {
		IDocument document= viewer.getDocument();