Program: 80585
Project: 80585
Buggy source:
@Override public void onCreate(final Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  addPreferencesFromResource(R.layout.apps_widget_settings);
  int defaultAppsNo=WIDGET_3X3_DEFAULT_APPSNO;
  int defaultAppsNoLs=WIDGET_3X3_DEFAULT_APPSNO_LS;
  SharedPreferences mPrefs=prefs.prefsGet();
  apps_by_widget_size_preference=(SwitchPreference)findPreference(Settings.APPS_BY_WIDGET_SIZE_PREFERENCE);
  apps_by_widget_size_preference.setChecked(mPrefs.getBoolean(Settings.APPS_BY_WIDGET_SIZE_PREFERENCE,Settings.APPS_BY_WIDGET_SIZE_DEFAULT));
  apps_by_widget_size_preference.setOnPreferenceChangeListener(changeListener);
  background_color_preference=(ColorPickerPreference)findPreference(Settings.BACKGROUND_COLOR_PREFERENCE);
  int intColor=mPrefs.getInt(Settings.BACKGROUND_COLOR_PREFERENCE,Settings.BACKGROUND_COLOR_DEFAULT);
  String hexColor=String.format("String_Node_Str",(intColor));
  background_color_preference.setSummary(hexColor);
  background_color_preference.setOnPreferenceChangeListener(changeListener);
  appnos_preference=(UpdatingListPreference)findPreference(Settings.STATS_WIDGET_APPSNO_PREFERENCE);
  appnos_preference.setValue(mPrefs.getString(extras == null ? Settings.STATS_WIDGET_APPSNO_PREFERENCE : Integer.toString(defaultAppsNo),Integer.toString(defaultAppsNo)));
  appnos_preference.setOnPreferenceChangeListener(changeListener);
  if (apps_by_widget_size_preference.isChecked()) {
    appnos_preference.setSummary(R.string.automatic_appsno);
  }
  appnos_ls_preference=(UpdatingListPreference)findPreference(Settings.STATS_WIDGET_APPSNO_LS_PREFERENCE);
  appnos_ls_preference.setValue(mPrefs.getString(extras == null ? Settings.STATS_WIDGET_APPSNO_LS_PREFERENCE : Integer.toString(defaultAppsNoLs),Integer.toString(defaultAppsNoLs)));
  appnos_ls_preference.setOnPreferenceChangeListener(changeListener);
  if (apps_by_widget_size_preference.isChecked()) {
    appnos_ls_preference.setSummary(R.string.automatic_appsno);
  }
  weighted_recents_preference=(CheckBoxPreference)findPreference(Settings.WEIGHTED_RECENTS_PREFERENCE);
  weighted_recents_preference.setChecked(mPrefs.getBoolean(Settings.WEIGHTED_RECENTS_PREFERENCE,Settings.WEIGHTED_RECENTS_DEFAULT));
  weighted_recents_preference.setOnPreferenceChangeListener(changeListener);
  weight_priority_preference=(UpdatingListPreference)findPreference(Settings.WEIGHT_PRIORITY_PREFERENCE);
  weight_priority_preference.setValue(mPrefs.getString(Settings.WEIGHT_PRIORITY_PREFERENCE,Integer.toString(Settings.WEIGHT_PRIORITY_DEFAULT)));
  weight_priority_preference.setOnPreferenceChangeListener(changeListener);
  colorize_preference=(CheckBoxPreference)findPreference(Settings.COLORIZE_PREFERENCE);
  colorize_preference.setChecked(mPrefs.getBoolean(Settings.COLORIZE_PREFERENCE,Settings.COLORIZE_DEFAULT));
  colorize_preference.setOnPreferenceChangeListener(changeListener);
  icon_color_preference=(ColorPickerPreference)findPreference(Settings.ICON_COLOR_PREFERENCE);
  int intColor2=mPrefs.getInt(Settings.ICON_COLOR_PREFERENCE,Settings.ICON_COLOR_DEFAULT);
  String hexColor2=String.format("String_Node_Str",(intColor2));
  icon_color_preference.setSummary(hexColor2);
  icon_color_preference.setOnPreferenceChangeListener(changeListener);
  icon_size_preference=(UpdatingListPreference)findPreference(Settings.ICON_SIZE_PREFERENCE);
  icon_size_preference.setValue(mPrefs.getString(Settings.ICON_SIZE_PREFERENCE,Integer.toString(Settings.ICON_SIZE_DEFAULT)));
  icon_size_preference.setOnPreferenceChangeListener(changeListener);
}

Fixed version (ground truth):
@Override public void onCreate(final Bundle savedInstanceState){
  super.onCreate(savedInstanceState);
  addPreferencesFromResource(R.layout.apps_widget_settings);
  int defaultAppsNo=APPS_WIDGET_DEFAULT_APPSNO;
  int defaultAppsNoLs=APPS_WIDGET_DEFAULT_APPSNO_LS;
  SharedPreferences mPrefs=prefs.prefsGet();
  apps_by_widget_size_preference=(SwitchPreference)findPreference(Settings.APPS_BY_WIDGET_SIZE_PREFERENCE);
  apps_by_widget_size_preference.setChecked(mPrefs.getBoolean(Settings.APPS_BY_WIDGET_SIZE_PREFERENCE,Settings.APPS_BY_WIDGET_SIZE_DEFAULT));
  apps_by_widget_size_preference.setOnPreferenceChangeListener(changeListener);
  background_color_preference=(ColorPickerPreference)findPreference(Settings.BACKGROUND_COLOR_PREFERENCE);
  int intColor=mPrefs.getInt(Settings.BACKGROUND_COLOR_PREFERENCE,Settings.BACKGROUND_COLOR_DEFAULT);
  String hexColor=String.format("String_Node_Str",(intColor));
  background_color_preference.setSummary(hexColor);
  background_color_preference.setOnPreferenceChangeListener(changeListener);
  appnos_preference=(UpdatingListPreference)findPreference(Settings.STATS_WIDGET_APPSNO_PREFERENCE);
  appnos_preference.setValue(mPrefs.getString(extras == null ? Settings.STATS_WIDGET_APPSNO_PREFERENCE : Integer.toString(defaultAppsNo),Integer.toString(defaultAppsNo)));
  appnos_preference.setOnPreferenceChangeListener(changeListener);
  if (apps_by_widget_size_preference.isChecked()) {
    appnos_preference.setSummary(R.string.automatic_appsno);
  }
  appnos_ls_preference=(UpdatingListPreference)findPreference(Settings.STATS_WIDGET_APPSNO_LS_PREFERENCE);
  appnos_ls_preference.setValue(mPrefs.getString(extras == null ? Settings.STATS_WIDGET_APPSNO_LS_PREFERENCE : Integer.toString(defaultAppsNoLs),Integer.toString(defaultAppsNoLs)));
  appnos_ls_preference.setOnPreferenceChangeListener(changeListener);
  if (apps_by_widget_size_preference.isChecked()) {
    appnos_ls_preference.setSummary(R.string.automatic_appsno);
  }
  weighted_recents_preference=(CheckBoxPreference)findPreference(Settings.WEIGHTED_RECENTS_PREFERENCE);
  weighted_recents_preference.setChecked(mPrefs.getBoolean(Settings.WEIGHTED_RECENTS_PREFERENCE,Settings.WEIGHTED_RECENTS_DEFAULT));
  weighted_recents_preference.setOnPreferenceChangeListener(changeListener);
  weight_priority_preference=(UpdatingListPreference)findPreference(Settings.WEIGHT_PRIORITY_PREFERENCE);
  weight_priority_preference.setValue(mPrefs.getString(Settings.WEIGHT_PRIORITY_PREFERENCE,Integer.toString(Settings.WEIGHT_PRIORITY_DEFAULT)));
  weight_priority_preference.setOnPreferenceChangeListener(changeListener);
  colorize_preference=(CheckBoxPreference)findPreference(Settings.COLORIZE_PREFERENCE);
  colorize_preference.setChecked(mPrefs.getBoolean(Settings.COLORIZE_PREFERENCE,Settings.COLORIZE_DEFAULT));
  colorize_preference.setOnPreferenceChangeListener(changeListener);
  icon_color_preference=(ColorPickerPreference)findPreference(Settings.ICON_COLOR_PREFERENCE);
  int intColor2=mPrefs.getInt(Settings.ICON_COLOR_PREFERENCE,Settings.ICON_COLOR_DEFAULT);
  String hexColor2=String.format("String_Node_Str",(intColor2));
  icon_color_preference.setSummary(hexColor2);
  icon_color_preference.setOnPreferenceChangeListener(changeListener);
  icon_size_preference=(UpdatingListPreference)findPreference(Settings.ICON_SIZE_PREFERENCE);
  icon_size_preference.setValue(mPrefs.getString(Settings.ICON_SIZE_PREFERENCE,Integer.toString(Settings.ICON_SIZE_DEFAULT)));
  icon_size_preference.setOnPreferenceChangeListener(changeListener);
}