Program: 13684
Project: 13684
Buggy source:
private void updateEditorSettings(){
  if (!AppPrefs.isVisualEditorAvailable()) {
    PreferenceScreen preferenceScreen=(PreferenceScreen)findPreference(getActivity().getString(R.string.pref_key_account_settings_root));
    PreferenceCategory editor=(PreferenceCategory)findPreference(getActivity().getString(R.string.pref_key_editor));
    if (preferenceScreen != null && editor != null) {
      preferenceScreen.removePreference(editor);
    }
  }
 else {
    final ListPreference editorTypePreference=(ListPreference)findPreference(getActivity().getString(R.string.pref_key_editor_type));
    editorTypePreference.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener(){
      @Override public boolean onPreferenceChange(      final Preference preference,      final Object value){
        if (value != null) {
          int index=Integer.parseInt(value.toString());
          CharSequence[] entries=editorTypePreference.getEntries();
          editorTypePreference.setSummary(entries[index]);
switch (index) {
case IDX_VISUAL_EDITOR:
            AppPrefs.setAztecEditorEnabled(false);
          AppPrefs.setVisualEditorEnabled(true);
        break;
case IDX_AZTEC_EDITOR:
      AppPrefs.setAztecEditorEnabled(true);
    AppPrefs.setVisualEditorEnabled(false);
  AppPrefs.setNewEditorPromoRequired(false);
break;
default :
AppPrefs.setAztecEditorEnabled(false);
AppPrefs.setVisualEditorEnabled(false);
break;
}
toggleEditorFooterPreference();
return true;
}
 else {
return false;
}
}
}
);
String editorTypeKey=getString(R.string.pref_key_editor_type);
String editorTypeSetting=mSettings.getString(editorTypeKey,"String_Node_Str");
if (!editorTypeSetting.equalsIgnoreCase("String_Node_Str")) {
CharSequence[] entries=editorTypePreference.getEntries();
editorTypePreference.setSummary(entries[Integer.parseInt(editorTypeSetting)]);
}
toggleEditorFooterPreference();
}
}

Fixed version (ground truth):
private void updateEditorSettings(){
  if (!AppPrefs.isVisualEditorAvailable()) {
    PreferenceScreen preferenceScreen=(PreferenceScreen)findPreference(getActivity().getString(R.string.pref_key_account_settings_root));
    PreferenceCategory editor=(PreferenceCategory)findPreference(getActivity().getString(R.string.pref_key_editor));
    if (preferenceScreen != null && editor != null) {
      preferenceScreen.removePreference(editor);
    }
  }
 else {
    final ListPreference editorTypePreference=(ListPreference)findPreference(getActivity().getString(R.string.pref_key_editor_type));
    editorTypePreference.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener(){
      @Override public boolean onPreferenceChange(      final Preference preference,      final Object value){
        if (value != null) {
          int index=Integer.parseInt(value.toString());
          CharSequence[] entries=editorTypePreference.getEntries();
          editorTypePreference.setSummary(entries[index]);
switch (index) {
case IDX_VISUAL_EDITOR:
            AppPrefs.setAztecEditorEnabled(false);
          AppPrefs.setVisualEditorEnabled(true);
        break;
case IDX_AZTEC_EDITOR:
      AppPrefs.setAztecEditorEnabled(true);
    AppPrefs.setVisualEditorEnabled(false);
  AppPrefs.setNewEditorPromoRequired(false);
break;
default :
AppPrefs.setAztecEditorEnabled(false);
AppPrefs.setVisualEditorEnabled(false);
break;
}
toggleEditorFooterPreference();
return true;
}
 else {
return false;
}
}
}
);
final int editorTypeSetting;
if (AppPrefs.isAztecEditorEnabled()) {
editorTypeSetting=IDX_AZTEC_EDITOR;
}
 else if (AppPrefs.isVisualEditorEnabled()) {
editorTypeSetting=IDX_VISUAL_EDITOR;
}
 else {
editorTypeSetting=IDX_LEGACY_EDITOR;
}
CharSequence[] entries=editorTypePreference.getEntries();
editorTypePreference.setSummary(entries[editorTypeSetting]);
editorTypePreference.setValueIndex(editorTypeSetting);
toggleEditorFooterPreference();
}
}