Program: 157508
Project: 157508
Buggy source:
private void setDictionariesForCurrentKeyboard(){
  if (mSuggest != null) {
    if (!mPredictionOn) {
      if (DEBUG)       Log.d(TAG,"String_Node_Str");
      mSuggest.setMainDictionary(null);
      mSuggest.setUserDictionary(null);
      mSuggest.setAutoDictionary(null);
      mLastDictionaryRefresh=-1;
    }
 else {
      mLastDictionaryRefresh=SystemClock.elapsedRealtime();
      if ((mKeyboardSwitcher != null) && mKeyboardSwitcher.isAlphabetMode()) {
        AnyKeyboard currentKeyobard=mKeyboardSwitcher.getCurrentKeyboard();
        String mappingSettingsKey=getDictionaryOverrideKey(currentKeyobard);
        String defaultDictionary=currentKeyobard.getDefaultDictionaryLocale();
        String dictionaryValue=getSharedPreferences().getString(mappingSettingsKey,null);
        DictionaryAddOnAndBuilder dictionaryBuilder=null;
        if (dictionaryValue == null) {
          dictionaryBuilder=ExternalDictionaryFactory.getDictionaryBuilderByLocale(currentKeyobard.getDefaultDictionaryLocale(),this);
        }
 else {
          if (DEBUG) {
            Log.d(TAG,"String_Node_Str" + (defaultDictionary == null ? "String_Node_Str" : defaultDictionary) + "String_Node_Str"+ currentKeyobard.getKeyboardPrefId()+ "String_Node_Str"+ dictionaryValue+ "String_Node_Str");
          }
          dictionaryBuilder=ExternalDictionaryFactory.getDictionaryBuilderById(dictionaryValue,this);
        }
        mSuggest.setMainDictionary(dictionaryBuilder);
        String localeForSupportingDictionaries=dictionaryBuilder != null ? dictionaryBuilder.getLanguage() : defaultDictionary;
        mUserDictionary=DictionaryFactory.getInstance().createUserDictionary(this,localeForSupportingDictionaries);
        mSuggest.setUserDictionary(mUserDictionary);
        mAutoDictionary=DictionaryFactory.getInstance().createAutoDictionary(this,this,localeForSupportingDictionaries);
        mSuggest.setAutoDictionary(mAutoDictionary);
        mSuggest.setContactsDictionary(getApplicationContext(),mConfig.useContactsDictionary());
      }
    }
  }
}

Fixed version (ground truth):
private void setDictionariesForCurrentKeyboard(){
  if (mSuggest != null) {
    if (!mPredictionOn) {
      if (DEBUG)       Log.d(TAG,"String_Node_Str");
      mSuggest.setMainDictionary(null);
      mSuggest.setUserDictionary(null);
      mSuggest.setAutoDictionary(null);
      mLastDictionaryRefresh=-1;
    }
 else {
      mLastDictionaryRefresh=SystemClock.elapsedRealtime();
      if ((mKeyboardSwitcher != null) && mKeyboardSwitcher.isAlphabetMode()) {
        AnyKeyboard currentKeyobard=mKeyboardSwitcher.getCurrentKeyboard();
        String mappingSettingsKey=getDictionaryOverrideKey(currentKeyobard);
        String defaultDictionary=currentKeyobard.getDefaultDictionaryLocale();
        String dictionaryValue=getSharedPreferences().getString(mappingSettingsKey,null);
        DictionaryAddOnAndBuilder dictionaryBuilder=null;
        if (dictionaryValue == null) {
          dictionaryBuilder=ExternalDictionaryFactory.getDictionaryBuilderByLocale(currentKeyobard.getDefaultDictionaryLocale(),this);
        }
 else {
          if (DEBUG) {
            Log.d(TAG,"String_Node_Str" + (defaultDictionary == null ? "String_Node_Str" : defaultDictionary) + "String_Node_Str"+ currentKeyobard.getKeyboardPrefId()+ "String_Node_Str"+ dictionaryValue+ "String_Node_Str");
          }
          dictionaryBuilder=ExternalDictionaryFactory.getDictionaryBuilderById(dictionaryValue,this);
        }
        mSuggest.setMainDictionary(dictionaryBuilder);
        String localeForSupportingDictionaries=dictionaryBuilder != null ? dictionaryBuilder.getLanguage() : defaultDictionary;
        mUserDictionary=DictionaryFactory.getInstance().createUserDictionary(this,localeForSupportingDictionaries);
        mUserDictionary.loadDictionary();
        mSuggest.setUserDictionary(mUserDictionary);
        mAutoDictionary=DictionaryFactory.getInstance().createAutoDictionary(this,this,localeForSupportingDictionaries);
        mSuggest.setAutoDictionary(mAutoDictionary);
        mSuggest.setContactsDictionary(getApplicationContext(),mConfig.useContactsDictionary());
      }
    }
  }
}