Program: 54977
Project: 54977
Buggy source:
/** 
 * Will go through each preference element and initialize/update the summary according to its value.
 * @note this will also correct invalid user inputs on EdittextPreferences!
 */
public void updateSummaries(){
  ListPreference listPref=(ListPreference)findPreference(getString(R.string.pref_sourceType));
  listPref.setSummary(getString(R.string.pref_sourceType_summ,listPref.getEntry()));
  EditTextPreference editTextPref=(EditTextPreference)findPreference(getString(R.string.pref_filesource_frequency));
  if (editTextPref.getText().length() == 0)   editTextPref.setText(getString(R.string.pref_filesource_frequency_default));
  editTextPref.setSummary(getString(R.string.pref_filesource_frequency_summ,editTextPref.getText()));
  editTextPref=(EditTextPreference)findPreference(getString(R.string.pref_filesource_sampleRate));
  if (editTextPref.getText().length() == 0)   editTextPref.setText(getString(R.string.pref_filesource_sampleRate_default));
  editTextPref.setSummary(getString(R.string.pref_filesource_sampleRate_summ,editTextPref.getText()));
  editTextPref=(EditTextPreference)findPreference(getString(R.string.pref_filesource_file));
  editTextPref.setSummary(getString(R.string.pref_filesource_file_summ,editTextPref.getText()));
  listPref=(ListPreference)findPreference(getString(R.string.pref_filesource_format));
  listPref.setSummary(getString(R.string.pref_filesource_format_summ,listPref.getEntry()));
  editTextPref=(EditTextPreference)findPreference(getString(R.string.pref_hackrf_upconverterFrequencyShift));
  if (editTextPref.getText().length() == 0)   editTextPref.setText("String_Node_Str");
  editTextPref.setSummary(getString(R.string.pref_hackrf_upconverterFrequencyShift_summ,editTextPref.getText()));
  editTextPref=(EditTextPreference)findPreference(getString(R.string.pref_rtlsdr_ip));
  editTextPref.setSummary(getString(R.string.pref_rtlsdr_ip_summ,editTextPref.getText()));
  editTextPref=(EditTextPreference)findPreference(getString(R.string.pref_rtlsdr_port));
  editTextPref.setSummary(getString(R.string.pref_rtlsdr_port_summ,editTextPref.getText()));
  editTextPref=(EditTextPreference)findPreference(getString(R.string.pref_rtlsdr_frequencyCorrection));
  if (editTextPref.getText().length() == 0)   editTextPref.setText(getString(R.string.pref_rtlsdr_frequencyCorrection_default));
  editTextPref.setSummary(getString(R.string.pref_rtlsdr_frequencyCorrection_summ,editTextPref.getText()));
  editTextPref=(EditTextPreference)findPreference(getString(R.string.pref_rtlsdr_upconverterFrequencyShift));
  if (editTextPref.getText().length() == 0)   editTextPref.setText("String_Node_Str");
  editTextPref.setSummary(getString(R.string.pref_rtlsdr_upconverterFrequencyShift_summ,editTextPref.getText()));
  listPref=(ListPreference)findPreference(getString(R.string.pref_fftSize));
  listPref.setSummary(getString(R.string.pref_fftSize_summ,listPref.getEntry()));
  listPref=(ListPreference)findPreference(getString(R.string.pref_colorMapType));
  listPref.setSummary(getString(R.string.pref_colorMapType_summ,listPref.getEntry()));
  listPref=(ListPreference)findPreference(getString(R.string.pref_fftDrawingType));
  listPref.setSummary(getString(R.string.pref_fftDrawingType_summ,listPref.getEntry()));
  listPref=(ListPreference)findPreference(getString(R.string.pref_averaging));
  listPref.setSummary(getString(R.string.pref_averaging_summ,listPref.getEntry()));
  listPref=(ListPreference)findPreference(getString(R.string.pref_screenOrientation));
  listPref.setSummary(getString(R.string.pref_screenOrientation_summ,listPref.getEntry()));
  listPref=(ListPreference)findPreference(getString(R.string.pref_spectrumWaterfallRatio));
  listPref.setSummary(getString(R.string.pref_spectrumWaterfallRatio_summ,listPref.getEntry()));
  listPref=(ListPreference)findPreference(getString(R.string.pref_fontSize));
  listPref.setSummary(getString(R.string.pref_fontSize_summ,listPref.getEntry()));
  SwitchPreference switchPref=(SwitchPreference)findPreference(getString(R.string.pref_dynamicFrameRate));
  listPref=(ListPreference)findPreference(getString(R.string.pref_frameRate));
  if (switchPref.isChecked())   listPref.setSummary(getString(R.string.pref_frameRate_summ,"String_Node_Str"));
 else   listPref.setSummary(getString(R.string.pref_frameRate_summ,listPref.getEntry()));
  editTextPref=(EditTextPreference)findPreference(getString(R.string.pref_logfile));
  editTextPref.setSummary(getString(R.string.pref_logfile_summ,editTextPref.getText()));
}

Fixed version (ground truth):
/** 
 * Will go through each preference element and initialize/update the summary according to its value.
 * @note this will also correct invalid user inputs on EdittextPreferences!
 */
public void updateSummaries(){
  ListPreference listPref=(ListPreference)findPreference(getString(R.string.pref_sourceType));
  listPref.setSummary(getString(R.string.pref_sourceType_summ,listPref.getEntry()));
  EditTextPreference editTextPref=(EditTextPreference)findPreference(getString(R.string.pref_filesource_frequency));
  if (editTextPref.getText().length() == 0)   editTextPref.setText(getString(R.string.pref_filesource_frequency_default));
  editTextPref.setSummary(getString(R.string.pref_filesource_frequency_summ,editTextPref.getText()));
  editTextPref=(EditTextPreference)findPreference(getString(R.string.pref_filesource_sampleRate));
  if (editTextPref.getText().length() == 0)   editTextPref.setText(getString(R.string.pref_filesource_sampleRate_default));
  editTextPref.setSummary(getString(R.string.pref_filesource_sampleRate_summ,editTextPref.getText()));
  editTextPref=(EditTextPreference)findPreference(getString(R.string.pref_filesource_file));
  editTextPref.setSummary(getString(R.string.pref_filesource_file_summ,editTextPref.getText()));
  listPref=(ListPreference)findPreference(getString(R.string.pref_filesource_format));
  listPref.setSummary(getString(R.string.pref_filesource_format_summ,listPref.getEntry()));
  editTextPref=(EditTextPreference)findPreference(getString(R.string.pref_hackrf_frequencyShift));
  if (editTextPref.getText().length() == 0)   editTextPref.setText("String_Node_Str");
  editTextPref.setSummary(getString(R.string.pref_hackrf_frequencyShift_summ,editTextPref.getText()));
  editTextPref=(EditTextPreference)findPreference(getString(R.string.pref_rtlsdr_ip));
  editTextPref.setSummary(getString(R.string.pref_rtlsdr_ip_summ,editTextPref.getText()));
  editTextPref=(EditTextPreference)findPreference(getString(R.string.pref_rtlsdr_port));
  editTextPref.setSummary(getString(R.string.pref_rtlsdr_port_summ,editTextPref.getText()));
  editTextPref=(EditTextPreference)findPreference(getString(R.string.pref_rtlsdr_frequencyCorrection));
  if (editTextPref.getText().length() == 0)   editTextPref.setText(getString(R.string.pref_rtlsdr_frequencyCorrection_default));
  editTextPref.setSummary(getString(R.string.pref_rtlsdr_frequencyCorrection_summ,editTextPref.getText()));
  editTextPref=(EditTextPreference)findPreference(getString(R.string.pref_rtlsdr_frequencyShift));
  if (editTextPref.getText().length() == 0)   editTextPref.setText("String_Node_Str");
  editTextPref.setSummary(getString(R.string.pref_rtlsdr_frequencyShift_summ,editTextPref.getText()));
  listPref=(ListPreference)findPreference(getString(R.string.pref_fftSize));
  listPref.setSummary(getString(R.string.pref_fftSize_summ,listPref.getEntry()));
  listPref=(ListPreference)findPreference(getString(R.string.pref_colorMapType));
  listPref.setSummary(getString(R.string.pref_colorMapType_summ,listPref.getEntry()));
  listPref=(ListPreference)findPreference(getString(R.string.pref_fftDrawingType));
  listPref.setSummary(getString(R.string.pref_fftDrawingType_summ,listPref.getEntry()));
  listPref=(ListPreference)findPreference(getString(R.string.pref_averaging));
  listPref.setSummary(getString(R.string.pref_averaging_summ,listPref.getEntry()));
  listPref=(ListPreference)findPreference(getString(R.string.pref_screenOrientation));
  listPref.setSummary(getString(R.string.pref_screenOrientation_summ,listPref.getEntry()));
  listPref=(ListPreference)findPreference(getString(R.string.pref_spectrumWaterfallRatio));
  listPref.setSummary(getString(R.string.pref_spectrumWaterfallRatio_summ,listPref.getEntry()));
  listPref=(ListPreference)findPreference(getString(R.string.pref_fontSize));
  listPref.setSummary(getString(R.string.pref_fontSize_summ,listPref.getEntry()));
  SwitchPreference switchPref=(SwitchPreference)findPreference(getString(R.string.pref_dynamicFrameRate));
  listPref=(ListPreference)findPreference(getString(R.string.pref_frameRate));
  if (switchPref.isChecked())   listPref.setSummary(getString(R.string.pref_frameRate_summ,"String_Node_Str"));
 else   listPref.setSummary(getString(R.string.pref_frameRate_summ,listPref.getEntry()));
  editTextPref=(EditTextPreference)findPreference(getString(R.string.pref_logfile));
  editTextPref.setSummary(getString(R.string.pref_logfile_summ,editTextPref.getText()));
}