Program: 157288
Project: 157288
Buggy source:
private void setDictionariesForCurrentKeyboard(){
  mSuggest.resetNextWordSentence();
  if (mPredictionOn) {
    mLastDictionaryRefresh=SystemClock.elapsedRealtime();
    final AnyKeyboard currentAlphabetKeyboard=getCurrentAlphabetKeyboard();
    if ((currentAlphabetKeyboard != null) && isInAlphabetKeyboardMode()) {
      fillSeparatorsSparseArray(mSentenceSeparators,currentAlphabetKeyboard.getSentenceSeparators());
      String mappingSettingsKey=getDictionaryOverrideKey(currentAlphabetKeyboard);
      String defaultDictionary=currentAlphabetKeyboard.getDefaultDictionaryLocale();
      String dictionaryValue=getSharedPrefs().getString(mappingSettingsKey,null);
      final DictionaryAddOnAndBuilder dictionaryBuilder;
      if (dictionaryValue == null) {
        dictionaryBuilder=ExternalDictionaryFactory.getDictionaryBuilderByLocale(currentAlphabetKeyboard.getDefaultDictionaryLocale(),getApplicationContext());
      }
 else {
        Logger.d(TAG,"String_Node_Str",defaultDictionary,currentAlphabetKeyboard.getKeyboardPrefId(),dictionaryValue);
        dictionaryBuilder=ExternalDictionaryFactory.getDictionaryBuilderById(dictionaryValue,getApplicationContext());
      }
      mSuggest.setMainDictionary(getApplicationContext(),dictionaryBuilder);
      String localeForSupportingDictionaries=dictionaryBuilder != null ? dictionaryBuilder.getLanguage() : defaultDictionary;
      Dictionary userDictionary=mSuggest.getDictionaryFactory().createUserDictionary(getApplicationContext(),localeForSupportingDictionaries);
      mSuggest.setUserDictionary(userDictionary);
      mAutoDictionary=mSuggest.getDictionaryFactory().createAutoDictionary(getApplicationContext(),localeForSupportingDictionaries);
      mSuggest.setAutoDictionary(mAutoDictionary);
      mSuggest.setContactsDictionary(getApplicationContext(),mAskPrefs.useContactsDictionary());
    }
  }
}

Fixed version (ground truth):
private void setDictionariesForCurrentKeyboard(){
  mSuggest.resetNextWordSentence();
  if (mPredictionOn) {
    final AnyKeyboard currentAlphabetKeyboard=getCurrentAlphabetKeyboard();
    if ((currentAlphabetKeyboard != null) && isInAlphabetKeyboardMode()) {
      fillSeparatorsSparseArray(mSentenceSeparators,currentAlphabetKeyboard.getSentenceSeparators());
      String mappingSettingsKey=getDictionaryOverrideKey(currentAlphabetKeyboard);
      String defaultDictionary=currentAlphabetKeyboard.getDefaultDictionaryLocale();
      String dictionaryValue=getSharedPrefs().getString(mappingSettingsKey,null);
      final DictionaryAddOnAndBuilder dictionaryBuilder;
      if (dictionaryValue == null) {
        dictionaryBuilder=ExternalDictionaryFactory.getDictionaryBuilderByLocale(currentAlphabetKeyboard.getDefaultDictionaryLocale(),getApplicationContext());
      }
 else {
        Logger.d(TAG,"String_Node_Str",defaultDictionary,currentAlphabetKeyboard.getKeyboardPrefId(),dictionaryValue);
        dictionaryBuilder=ExternalDictionaryFactory.getDictionaryBuilderById(dictionaryValue,getApplicationContext());
      }
      mSuggest.setMainDictionary(getApplicationContext(),dictionaryBuilder);
      String localeForSupportingDictionaries=dictionaryBuilder != null ? dictionaryBuilder.getLanguage() : defaultDictionary;
      Dictionary userDictionary=mSuggest.getDictionaryFactory().createUserDictionary(getApplicationContext(),localeForSupportingDictionaries);
      mSuggest.setUserDictionary(userDictionary);
      mAutoDictionary=mSuggest.getDictionaryFactory().createAutoDictionary(getApplicationContext(),localeForSupportingDictionaries);
      mSuggest.setAutoDictionary(mAutoDictionary);
      mSuggest.setContactsDictionary(getApplicationContext(),mAskPrefs.useContactsDictionary());
    }
  }
}