Program: 87636
Project: 87636
Buggy source:
/** 
 * Check if the cursor is touching a word. If so, restart suggestions on this word, else do nothing.
 */
private void restartSuggestionsOnWordTouchedByCursor(){
  if (mAppWorkAroundsUtils.isBrokenByRecorrection())   return;
  if (mLastSelectionStart != mLastSelectionEnd)   return;
  if (mLastSelectionStart < 0)   return;
  if (!mConnection.isCursorTouchingWord(mSettings.getCurrent()))   return;
  final Range range=mConnection.getWordRangeAtCursor(mSettings.getWordSeparators(),0);
  if (null == range)   return;
  final int numberOfCharsInWordBeforeCursor=range.getNumberOfCharsInWordBeforeCursor();
  if (numberOfCharsInWordBeforeCursor > mLastSelectionStart)   return;
  final ArrayList<SuggestedWordInfo> suggestions=CollectionUtils.newArrayList();
  final CharSequence word=range.mWord;
  final String typedWord=word.toString();
  if (word instanceof SpannableString) {
    final SpannableString spannableString=(SpannableString)word;
    int i=0;
    for (    Object object : spannableString.getSpans(0,spannableString.length(),SuggestionSpan.class)) {
      SuggestionSpan span=(SuggestionSpan)object;
      for (      String s : span.getSuggestions()) {
        ++i;
        if (!TextUtils.equals(s,typedWord)) {
          suggestions.add(new SuggestedWordInfo(s,SuggestionStripView.MAX_SUGGESTIONS - i,SuggestedWordInfo.KIND_RESUMED,Dictionary.TYPE_RESUMED));
        }
      }
    }
  }
  mWordComposer.setComposingWord(typedWord,mKeyboardSwitcher.getKeyboard());
  mWordComposer.setCursorPositionWithinWord(numberOfCharsInWordBeforeCursor);
  mConnection.setComposingRegion(mLastSelectionStart - numberOfCharsInWordBeforeCursor,mLastSelectionEnd + range.getNumberOfCharsInWordAfterCursor());
  final SuggestedWords suggestedWords;
  if (suggestions.isEmpty()) {
    final SuggestedWords suggestedWordsIncludingTypedWord=getSuggestedWords(Suggest.SESSION_TYPING);
    if (suggestedWordsIncludingTypedWord.size() > 1) {
      suggestedWords=suggestedWordsIncludingTypedWord.getSuggestedWordsExcludingTypedWord();
    }
 else {
      suggestedWords=suggestedWordsIncludingTypedWord;
    }
  }
 else {
    suggestedWords=new SuggestedWords(suggestions,true,false,false,false,false);
  }
  mIsAutoCorrectionIndicatorOn=false;
  showSuggestionStrip(suggestedWords,typedWord);
}

Fixed version (ground truth):
/** 
 * Check if the cursor is touching a word. If so, restart suggestions on this word, else do nothing.
 */
private void restartSuggestionsOnWordTouchedByCursor(){
  if (mAppWorkAroundsUtils.isBrokenByRecorrection())   return;
  if (mLastSelectionStart != mLastSelectionEnd)   return;
  if (mLastSelectionStart < 0)   return;
  if (!mConnection.isCursorTouchingWord(mSettings.getCurrent()))   return;
  final Range range=mConnection.getWordRangeAtCursor(mSettings.getWordSeparators(),0);
  if (null == range)   return;
  final int numberOfCharsInWordBeforeCursor=range.getNumberOfCharsInWordBeforeCursor();
  if (numberOfCharsInWordBeforeCursor > mLastSelectionStart)   return;
  final ArrayList<SuggestedWordInfo> suggestions=CollectionUtils.newArrayList();
  final CharSequence word=range.mWord;
  final String typedWord=word.toString();
  if (word instanceof Spanned) {
    final Spanned spanned=(Spanned)word;
    int i=0;
    for (    Object object : spanned.getSpans(0,spanned.length(),SuggestionSpan.class)) {
      SuggestionSpan span=(SuggestionSpan)object;
      for (      String s : span.getSuggestions()) {
        ++i;
        if (!TextUtils.equals(s,typedWord)) {
          suggestions.add(new SuggestedWordInfo(s,SuggestionStripView.MAX_SUGGESTIONS - i,SuggestedWordInfo.KIND_RESUMED,Dictionary.TYPE_RESUMED));
        }
      }
    }
  }
  mWordComposer.setComposingWord(typedWord,mKeyboardSwitcher.getKeyboard());
  mWordComposer.setCursorPositionWithinWord(numberOfCharsInWordBeforeCursor);
  mConnection.setComposingRegion(mLastSelectionStart - numberOfCharsInWordBeforeCursor,mLastSelectionEnd + range.getNumberOfCharsInWordAfterCursor());
  final SuggestedWords suggestedWords;
  if (suggestions.isEmpty()) {
    final SuggestedWords suggestedWordsIncludingTypedWord=getSuggestedWords(Suggest.SESSION_TYPING);
    if (suggestedWordsIncludingTypedWord.size() > 1) {
      suggestedWords=suggestedWordsIncludingTypedWord.getSuggestedWordsExcludingTypedWord();
    }
 else {
      suggestedWords=suggestedWordsIncludingTypedWord;
    }
  }
 else {
    suggestedWords=new SuggestedWords(suggestions,true,false,false,false,false);
  }
  mIsAutoCorrectionIndicatorOn=false;
  showSuggestionStrip(suggestedWords,typedWord);
}