Program: 88304
Project: 88304
Buggy source:
@Override public void onCreate(){
  LatinImeLogger.init(this);
  super.onCreate();
  mResources=getResources();
  final Configuration conf=mResources.getConfiguration();
  final SharedPreferences prefs=PreferenceManager.getDefaultSharedPreferences(this);
  mLanguageSwitcher=new LanguageSwitcher(this);
  mLanguageSwitcher.loadLocales(prefs);
  mKeyboardSwitcher=new KeyboardSwitcher(this,this);
  mKeyboardSwitcher.setLanguageSwitcher(mLanguageSwitcher);
  mSystemLocale=conf.locale.toString();
  mLanguageSwitcher.setSystemLocale(conf.locale);
  String inputLanguage=mLanguageSwitcher.getInputLanguage();
  if (inputLanguage == null) {
    inputLanguage=conf.locale.toString();
  }
  LatinIMEUtil.GCUtils.getInstance().reset();
  boolean tryGC=true;
  for (int i=0; i < LatinIMEUtil.GCUtils.GC_TRY_LOOP_MAX && tryGC; ++i) {
    try {
      initSuggest(inputLanguage);
      tryGC=false;
    }
 catch (    OutOfMemoryError e) {
      tryGC=LatinIMEUtil.GCUtils.getInstance().tryGCOrWait(inputLanguage,e);
    }
  }
  mOrientation=conf.orientation;
  initSuggestPuncList();
  IntentFilter filter=new IntentFilter(AudioManager.RINGER_MODE_CHANGED_ACTION);
  registerReceiver(mReceiver,filter);
  if (VOICE_INSTALLED) {
    mVoiceInput=new VoiceInput(this,this);
    mHints=new Hints(this,new Hints.Display(){
      public void showHint(      int viewResource){
        LayoutInflater inflater=(LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        View view=inflater.inflate(viewResource,null);
        setCandidatesView(view);
        setCandidatesViewShown(true);
        mIsShowingHint=true;
      }
    }
);
  }
  prefs.registerOnSharedPreferenceChangeListener(this);
}

Fixed version (ground truth):
@Override public void onCreate(){
  LatinImeLogger.init(this);
  super.onCreate();
  mResources=getResources();
  final Configuration conf=mResources.getConfiguration();
  PreferenceManager.setDefaultValues(this,R.xml.prefs,false);
  final SharedPreferences prefs=PreferenceManager.getDefaultSharedPreferences(this);
  mLanguageSwitcher=new LanguageSwitcher(this);
  mLanguageSwitcher.loadLocales(prefs);
  mKeyboardSwitcher=new KeyboardSwitcher(this,this);
  mKeyboardSwitcher.setLanguageSwitcher(mLanguageSwitcher);
  mSystemLocale=conf.locale.toString();
  mLanguageSwitcher.setSystemLocale(conf.locale);
  String inputLanguage=mLanguageSwitcher.getInputLanguage();
  if (inputLanguage == null) {
    inputLanguage=conf.locale.toString();
  }
  LatinIMEUtil.GCUtils.getInstance().reset();
  boolean tryGC=true;
  for (int i=0; i < LatinIMEUtil.GCUtils.GC_TRY_LOOP_MAX && tryGC; ++i) {
    try {
      initSuggest(inputLanguage);
      tryGC=false;
    }
 catch (    OutOfMemoryError e) {
      tryGC=LatinIMEUtil.GCUtils.getInstance().tryGCOrWait(inputLanguage,e);
    }
  }
  mOrientation=conf.orientation;
  initSuggestPuncList();
  IntentFilter filter=new IntentFilter(AudioManager.RINGER_MODE_CHANGED_ACTION);
  registerReceiver(mReceiver,filter);
  if (VOICE_INSTALLED) {
    mVoiceInput=new VoiceInput(this,this);
    mHints=new Hints(this,new Hints.Display(){
      public void showHint(      int viewResource){
        LayoutInflater inflater=(LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        View view=inflater.inflate(viewResource,null);
        setCandidatesView(view);
        setCandidatesViewShown(true);
        mIsShowingHint=true;
      }
    }
);
  }
  prefs.registerOnSharedPreferenceChangeListener(this);
}