Program: 54257
Project: 54257
Buggy source:
private void onMsfEnabled(){
  if (mReceiver != null)   return;
  onMsfPathChanged();
  OnPreferenceClickListener directoryPickerWithDefaultPath=new OnPreferenceClickListener(){
    @Override public boolean onPreferenceClick(    Preference preference){
      final String currentValue;
      final String defaultValue;
      final String key=preference.getKey();
      if (key.equals("String_Node_Str")) {
        currentValue=System.getRubyPath();
        defaultValue=System.getDefaultRubyPath();
      }
 else       if (key.equals("String_Node_Str")) {
        currentValue=System.getMsfPath();
        defaultValue=System.getDefaultMsfPath();
      }
 else       return true;
      if (!currentValue.equals(defaultValue)) {
        final Preference fPref=preference;
        (new ChoiceDialog(SettingsActivity.this,getString(R.string.choose_an_option),new String[]{getString(R.string.restore_default_path),getString(R.string.choose_a_custom_path)},new ChoiceDialog.ChoiceDialogListener(){
          @Override public void onChoice(          int choice){
            if (choice == 0) {
              File f=new File(defaultValue);
              if (!f.exists())               f.mkdirs();
              Intent i=new Intent();
              i.putExtra(DirectoryPicker.AFFECTED_PREF,key);
              i.putExtra(DirectoryPicker.CHOSEN_DIRECTORY,defaultValue);
              onActivityResult(DirectoryPicker.PICK_DIRECTORY,RESULT_OK,i);
            }
 else {
              startDirectoryPicker(fPref);
            }
          }
        }
)).show();
      }
 else {
        startDirectoryPicker(preference);
      }
      return true;
    }
  }
;
  mRubyDir.setDefaultValue(System.getDefaultRubyPath());
  mRubyDir.setOnPreferenceClickListener(directoryPickerWithDefaultPath);
  mMsfDir.setDefaultValue(System.getDefaultMsfPath());
  mMsfDir.setOnPreferenceClickListener(directoryPickerWithDefaultPath);
  mWipeMSF.setOnPreferenceClickListener(new OnPreferenceClickListener(){
    @Override public boolean onPreferenceClick(    Preference preference){
      wipe_prompt();
      return true;
    }
  }
);
  getMsfBranches();
  mReceiver=new BroadcastReceiver(){
    @Override public void onReceive(    Context context,    Intent intent){
      if (intent.getAction().equals(SETTINGS_WIPE_DONE)) {
        System.updateLocalRubyVersion();
        System.updateLocalMsfVersion();
        mWipeMSF.setEnabled(new File(System.getRubyPath()).isDirectory());
      }
    }
  }
;
  registerReceiver(mReceiver,new IntentFilter(SETTINGS_WIPE_DONE));
}

Fixed version (ground truth):
private void onMsfEnabled(){
  if (mReceiver != null)   return;
  onMsfPathChanged();
  OnPreferenceClickListener directoryPickerWithDefaultPath=new OnPreferenceClickListener(){
    @Override public boolean onPreferenceClick(    Preference preference){
      final String currentValue;
      final String defaultValue;
      final String key=preference.getKey();
      if (key.equals("String_Node_Str")) {
        currentValue=System.getRubyPath();
        defaultValue=System.getDefaultRubyPath();
      }
 else       if (key.equals("String_Node_Str")) {
        currentValue=System.getMsfPath();
        defaultValue=System.getDefaultMsfPath();
      }
 else       return true;
      if (!currentValue.equals(defaultValue)) {
        final Preference fPref=preference;
        (new ChoiceDialog(SettingsActivity.this,getString(R.string.choose_an_option),new String[]{getString(R.string.restore_default_path),getString(R.string.choose_a_custom_path)},new ChoiceDialog.ChoiceDialogListener(){
          @Override public void onChoice(          int choice){
            if (choice == 0) {
              File f=new File(defaultValue);
              if (!f.exists())               f.mkdirs();
              Intent i=new Intent();
              i.putExtra(DirectoryPicker.AFFECTED_PREF,key);
              i.putExtra(DirectoryPicker.CHOSEN_DIRECTORY,defaultValue);
              onActivityResult(DirectoryPicker.PICK_DIRECTORY,RESULT_OK,i);
            }
 else {
              startDirectoryPicker(fPref);
            }
          }
        }
)).show();
      }
 else {
        startDirectoryPicker(preference);
      }
      return true;
    }
  }
;
  mRubyDir.setDefaultValue(System.getDefaultRubyPath());
  mRubyDir.setOnPreferenceClickListener(directoryPickerWithDefaultPath);
  mMsfDir.setDefaultValue(System.getDefaultMsfPath());
  mMsfDir.setOnPreferenceClickListener(directoryPickerWithDefaultPath);
  mWipeMSF.setOnPreferenceClickListener(new OnPreferenceClickListener(){
    @Override public boolean onPreferenceClick(    Preference preference){
      wipe_prompt();
      return true;
    }
  }
);
  getMsfBranches();
  mReceiver=new BroadcastReceiver(){
    @Override public void onReceive(    Context context,    Intent intent){
      if (intent.getAction().equals(SETTINGS_WIPE_DONE)) {
        onMsfPathChanged();
      }
 else       if (intent.getAction().equals(SETTINGS_MSF_BRANCHES_AVAILABLE)) {
        onMsfBranchesAvailable();
      }
    }
  }
;
  registerReceiver(mReceiver,new IntentFilter(SETTINGS_WIPE_DONE));
}