Program: 87370
Project: 87370
Buggy source:
private void getSuggestedWordsForBatchInput(final WordComposer wordComposer,final PrevWordsInfo prevWordsInfo,final ProximityInfo proximityInfo,final SettingsValuesForSuggestion settingsValuesForSuggestion,final int inputStyle,final int sequenceNumber,final OnGetSuggestedWordsCallback callback){
  final SuggestionResults suggestionResults=mDictionaryFacilitator.getSuggestionResults(wordComposer,prevWordsInfo,proximityInfo,settingsValuesForSuggestion,SESSION_ID_GESTURE);
  final ArrayList<SuggestedWordInfo> suggestionsContainer=new ArrayList<>(suggestionResults);
  final int suggestionsCount=suggestionsContainer.size();
  final boolean isFirstCharCapitalized=wordComposer.wasShiftedNoLock();
  final boolean isAllUpperCase=wordComposer.isAllUpperCase();
  if (isFirstCharCapitalized || isAllUpperCase) {
    for (int i=0; i < suggestionsCount; ++i) {
      final SuggestedWordInfo wordInfo=suggestionsContainer.get(i);
      final SuggestedWordInfo transformedWordInfo=getTransformedSuggestedWordInfo(wordInfo,suggestionResults.mLocale,isAllUpperCase,isFirstCharCapitalized,0);
      suggestionsContainer.set(i,transformedWordInfo);
    }
  }
  if (suggestionsContainer.size() > 1 && TextUtils.equals(suggestionsContainer.get(0).mWord,wordComposer.getRejectedBatchModeSuggestion())) {
    final SuggestedWordInfo rejected=suggestionsContainer.remove(0);
    suggestionsContainer.add(1,rejected);
  }
  SuggestedWordInfo.removeDups(null,suggestionsContainer);
  for (int i=suggestionsContainer.size() - 1; i >= 0; --i) {
    if (suggestionsContainer.get(i).mScore < SUPPRESS_SUGGEST_THRESHOLD) {
      suggestionsContainer.remove(i);
    }
  }
  callback.onGetSuggestedWords(new SuggestedWords(suggestionsContainer,suggestionResults.mRawSuggestions,true,false,false,false,inputStyle,sequenceNumber));
}

Fixed version (ground truth):
private void getSuggestedWordsForBatchInput(final WordComposer wordComposer,final PrevWordsInfo prevWordsInfo,final ProximityInfo proximityInfo,final SettingsValuesForSuggestion settingsValuesForSuggestion,final int inputStyle,final int sequenceNumber,final OnGetSuggestedWordsCallback callback){
  final SuggestionResults suggestionResults=mDictionaryFacilitator.getSuggestionResults(wordComposer,prevWordsInfo,proximityInfo,settingsValuesForSuggestion,SESSION_ID_GESTURE);
  final ArrayList<SuggestedWordInfo> suggestionsContainer=new ArrayList<>(suggestionResults);
  final int suggestionsCount=suggestionsContainer.size();
  final boolean isFirstCharCapitalized=wordComposer.wasShiftedNoLock();
  final boolean isAllUpperCase=wordComposer.isAllUpperCase();
  if (isFirstCharCapitalized || isAllUpperCase) {
    for (int i=0; i < suggestionsCount; ++i) {
      final SuggestedWordInfo wordInfo=suggestionsContainer.get(i);
      final SuggestedWordInfo transformedWordInfo=getTransformedSuggestedWordInfo(wordInfo,suggestionResults.mLocale,isAllUpperCase,isFirstCharCapitalized,0);
      suggestionsContainer.set(i,transformedWordInfo);
    }
  }
  if (suggestionsContainer.size() > 1 && TextUtils.equals(suggestionsContainer.get(0).mWord,wordComposer.getRejectedBatchModeSuggestion())) {
    final SuggestedWordInfo rejected=suggestionsContainer.remove(0);
    suggestionsContainer.add(1,rejected);
  }
  SuggestedWordInfo.removeDups(null,suggestionsContainer);
  for (int i=suggestionsContainer.size() - 1; i >= 0; --i) {
    if (suggestionsContainer.get(i).mScore < SUPPRESS_SUGGEST_THRESHOLD) {
      suggestionsContainer.remove(i);
    }
  }
  callback.onGetSuggestedWords(new SuggestedWords(suggestionsContainer,suggestionResults.mRawSuggestions,true,false,false,inputStyle,sequenceNumber));
}