Program: 184881
Project: 184881
Buggy source:
@Override protected void onCreate(Bundle icicle){
  super.onCreate(icicle);
  mPhone=PhoneFactory.getDefaultPhone();
  if (mPhone.getPhoneName().equals("String_Node_Str")) {
    addPreferencesFromResource(R.xml.cdma_call_feature_setting);
  }
 else {
    addPreferencesFromResource(R.xml.call_feature_setting);
  }
  PreferenceScreen prefSet=getPreferenceScreen();
  mSubMenuVoicemailSettings=(EditPhoneNumberPreference)prefSet.findPreference(BUTTON_VOICEMAIL_KEY);
  mSubMenuFDNSettings=(PreferenceScreen)prefSet.findPreference(BUTTON_FDN_KEY);
  if (mPhone.getPhoneName().equals("String_Node_Str")) {
    mButtonVoicePrivacy=(CheckBoxPreference)findPreference(BUTTON_VP_KEY);
    mButtonTTY=(ListPreference)prefSet.findPreference(BUTTON_TTY_KEY);
    mButtonTTY.setOnPreferenceChangeListener(this);
    int settingsTtyMode=android.provider.Settings.Secure.getInt(mPhone.getContext().getContentResolver(),android.provider.Settings.Secure.PREFERRED_TTY_MODE,preferredTtyMode);
    mButtonTTY.setValue(Integer.toString(settingsTtyMode));
    UpdatePreferredTtyModeSummary(settingsTtyMode);
    mButtonDS=(ListPreference)findPreference(BUTTON_DS_KEY);
    int index=Settings.System.getInt(getContentResolver(),Settings.System.DTMF_TONE_TYPE_WHEN_DIALING,preferredDtmfMode);
    mButtonDS.setValueIndex(index);
    mButtonDS.setOnPreferenceChangeListener(this);
  }
 else   if (mPhone.getPhoneName().equals("String_Node_Str")) {
    mButtonCLIR=(ListPreference)prefSet.findPreference(BUTTON_CLIR_KEY);
    mButtonCW=(CheckBoxPreference)prefSet.findPreference(BUTTON_CW_KEY);
    mButtonCFU=(EditPhoneNumberPreference)prefSet.findPreference(BUTTON_CFU_KEY);
    mButtonCFB=(EditPhoneNumberPreference)prefSet.findPreference(BUTTON_CFB_KEY);
    mButtonCFNRy=(EditPhoneNumberPreference)prefSet.findPreference(BUTTON_CFNRY_KEY);
    mButtonCFNRc=(EditPhoneNumberPreference)prefSet.findPreference(BUTTON_CFNRC_KEY);
    mButtonCFExpand=(PreferenceScreen)prefSet.findPreference(BUTTON_CF_EXPAND_KEY);
    mButtonGSMMoreExpand=(PreferenceScreen)prefSet.findPreference(BUTTON_GSM_MORE_EXPAND_KEY);
    if (mButtonCFU != null) {
      mButtonCFU.setParentActivity(this,CommandsInterface.CF_REASON_UNCONDITIONAL,this);
      mButtonCFU.setDialogOnClosedListener(this);
      mButtonCFU.setDialogTitle(R.string.labelCF);
      mButtonCFU.setDialogMessage(R.string.messageCFU);
    }
    if (mButtonCFB != null) {
      mButtonCFB.setParentActivity(this,CommandsInterface.CF_REASON_BUSY,this);
      mButtonCFB.setDialogOnClosedListener(this);
      mButtonCFB.setDependency(BUTTON_CFU_KEY);
      mButtonCFB.setDialogTitle(R.string.labelCF);
      mButtonCFB.setDialogMessage(R.string.messageCFB);
    }
    if (mButtonCFNRy != null) {
      mButtonCFNRy.setParentActivity(this,CommandsInterface.CF_REASON_NO_REPLY,this);
      mButtonCFNRy.setDialogOnClosedListener(this);
      mButtonCFNRy.setDependency(BUTTON_CFU_KEY);
      mButtonCFNRy.setDialogTitle(R.string.labelCF);
      mButtonCFNRy.setDialogMessage(R.string.messageCFNRy);
    }
    if (mButtonCFNRc != null) {
      mButtonCFNRc.setParentActivity(this,CommandsInterface.CF_REASON_NOT_REACHABLE,this);
      mButtonCFNRc.setDialogOnClosedListener(this);
      mButtonCFNRc.setDependency(BUTTON_CFU_KEY);
      mButtonCFNRc.setDialogTitle(R.string.labelCF);
      mButtonCFNRc.setDialogMessage(R.string.messageCFNRc);
    }
    if (mButtonCLIR != null) {
      mButtonCLIR.setOnPreferenceChangeListener(this);
    }
    mFDNSettingIntent=new Intent(Intent.ACTION_MAIN);
    mFDNSettingIntent.setClassName(this,FdnSetting.class.getName());
    mSubMenuFDNSettings.setIntent(mFDNSettingIntent);
  }
  if (mSubMenuVoicemailSettings != null) {
    mSubMenuVoicemailSettings.setParentActivity(this,VOICEMAIL_PREF_ID,this);
    mSubMenuVoicemailSettings.setDialogOnClosedListener(this);
    mSubMenuVoicemailSettings.setDialogTitle(R.string.voicemail_settings_number_label);
  }
  mContactListIntent=new Intent(Intent.ACTION_GET_CONTENT);
  mContactListIntent.setType(android.provider.Contacts.Phones.CONTENT_ITEM_TYPE);
  if (mSubMenuFDNSettings != null) {
    mFDNSettingIntent=new Intent(Intent.ACTION_MAIN);
    mFDNSettingIntent.setClassName(this,FdnSetting.class.getName());
    mSubMenuFDNSettings.setIntent(mFDNSettingIntent);
  }
  mAppState=AppState.INPUT_READY;
  if (icicle != null) {
    if (mPhone.getPhoneName().equals("String_Node_Str")) {
      mButtonVoicePrivacy.setChecked(icicle.getBoolean(BUTTON_VP_KEY));
    }
 else     if (mPhone.getPhoneName().equals("String_Node_Str")) {
      mDialingNumCFU=icicle.getString(SUMMARY_CFU_KEY);
      mDialingNumCFB=icicle.getString(SUMMARY_CFB_KEY);
      mDialingNumCFNRy=icicle.getString(SUMMARY_CFNRY_KEY);
      mDialingNumCFNRc=icicle.getString(SUMMARY_CFNRC_KEY);
      adjustCFbuttonState(mButtonCFU,icicle.getBoolean(BUTTON_CFU_KEY),R.string.sum_cfu_enabled,mDialingNumCFU);
      adjustCFbuttonState(mButtonCFB,icicle.getBoolean(BUTTON_CFB_KEY),R.string.sum_cfb_enabled,mDialingNumCFB);
      adjustCFbuttonState(mButtonCFNRy,icicle.getBoolean(BUTTON_CFNRY_KEY),R.string.sum_cfnry_enabled,mDialingNumCFNRy);
      adjustCFbuttonState(mButtonCFNRc,icicle.getBoolean(BUTTON_CFNRC_KEY),R.string.sum_cfnrc_enabled,mDialingNumCFNRc);
      setButtonCLIRValue(icicle.getInt(BUTTON_CLIR_KEY));
      if (mButtonCW != null) {
        mButtonCW.setChecked(icicle.getBoolean(BUTTON_CW_KEY));
      }
      mCFDataStale=icicle.getBoolean(BUTTON_CF_EXPAND_KEY);
      mMoreDataStale=icicle.getBoolean(BUTTON_GSM_MORE_EXPAND_KEY);
    }
    mAppState=(AppState)icicle.getSerializable(APP_STATE_KEY);
    mDisplayMode=icicle.getInt(DISPLAY_MODE_KEY);
  }
 else {
    mCFDataStale=true;
    mMoreDataStale=true;
    if (getIntent().getAction().equals(ACTION_ADD_VOICEMAIL)) {
      setAppState(AppState.DIALOG_OPEN);
      mSubMenuVoicemailSettings.showPhoneNumberDialog();
    }
  }
  updateVoiceNumberField();
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle icicle){
  super.onCreate(icicle);
  mPhone=PhoneFactory.getDefaultPhone();
  if (mPhone.getPhoneName().equals("String_Node_Str")) {
    addPreferencesFromResource(R.xml.cdma_call_feature_setting);
  }
 else {
    addPreferencesFromResource(R.xml.call_feature_setting);
  }
  PreferenceScreen prefSet=getPreferenceScreen();
  mSubMenuVoicemailSettings=(EditPhoneNumberPreference)prefSet.findPreference(BUTTON_VOICEMAIL_KEY);
  mSubMenuFDNSettings=(PreferenceScreen)prefSet.findPreference(BUTTON_FDN_KEY);
  if (mPhone.getPhoneName().equals("String_Node_Str")) {
    mButtonVoicePrivacy=(CheckBoxPreference)findPreference(BUTTON_VP_KEY);
    mButtonTTY=(ListPreference)prefSet.findPreference(BUTTON_TTY_KEY);
    mButtonTTY.setOnPreferenceChangeListener(this);
    int settingsTtyMode=android.provider.Settings.Secure.getInt(mPhone.getContext().getContentResolver(),android.provider.Settings.Secure.PREFERRED_TTY_MODE,preferredTtyMode);
    mButtonTTY.setValue(Integer.toString(settingsTtyMode));
    UpdatePreferredTtyModeSummary(settingsTtyMode);
    mButtonDS=(ListPreference)findPreference(BUTTON_DS_KEY);
    int index=Settings.System.getInt(getContentResolver(),Settings.System.DTMF_TONE_TYPE_WHEN_DIALING,preferredDtmfMode);
    mButtonDS.setValueIndex(index);
    mButtonDS.setOnPreferenceChangeListener(this);
  }
 else   if (mPhone.getPhoneName().equals("String_Node_Str")) {
    mButtonCLIR=(ListPreference)prefSet.findPreference(BUTTON_CLIR_KEY);
    mButtonCW=(CheckBoxPreference)prefSet.findPreference(BUTTON_CW_KEY);
    mButtonCFU=(EditPhoneNumberPreference)prefSet.findPreference(BUTTON_CFU_KEY);
    mButtonCFB=(EditPhoneNumberPreference)prefSet.findPreference(BUTTON_CFB_KEY);
    mButtonCFNRy=(EditPhoneNumberPreference)prefSet.findPreference(BUTTON_CFNRY_KEY);
    mButtonCFNRc=(EditPhoneNumberPreference)prefSet.findPreference(BUTTON_CFNRC_KEY);
    mButtonCFExpand=(PreferenceScreen)prefSet.findPreference(BUTTON_CF_EXPAND_KEY);
    mButtonGSMMoreExpand=(PreferenceScreen)prefSet.findPreference(BUTTON_GSM_MORE_EXPAND_KEY);
    if (mButtonCFU != null) {
      mButtonCFU.setParentActivity(this,CommandsInterface.CF_REASON_UNCONDITIONAL,this);
      mButtonCFU.setDialogOnClosedListener(this);
      mButtonCFU.setDialogTitle(R.string.labelCF);
      mButtonCFU.setDialogMessage(R.string.messageCFU);
    }
    if (mButtonCFB != null) {
      mButtonCFB.setParentActivity(this,CommandsInterface.CF_REASON_BUSY,this);
      mButtonCFB.setDialogOnClosedListener(this);
      mButtonCFB.setDependency(BUTTON_CFU_KEY);
      mButtonCFB.setDialogTitle(R.string.labelCF);
      mButtonCFB.setDialogMessage(R.string.messageCFB);
    }
    if (mButtonCFNRy != null) {
      mButtonCFNRy.setParentActivity(this,CommandsInterface.CF_REASON_NO_REPLY,this);
      mButtonCFNRy.setDialogOnClosedListener(this);
      mButtonCFNRy.setDependency(BUTTON_CFU_KEY);
      mButtonCFNRy.setDialogTitle(R.string.labelCF);
      mButtonCFNRy.setDialogMessage(R.string.messageCFNRy);
    }
    if (mButtonCFNRc != null) {
      mButtonCFNRc.setParentActivity(this,CommandsInterface.CF_REASON_NOT_REACHABLE,this);
      mButtonCFNRc.setDialogOnClosedListener(this);
      mButtonCFNRc.setDependency(BUTTON_CFU_KEY);
      mButtonCFNRc.setDialogTitle(R.string.labelCF);
      mButtonCFNRc.setDialogMessage(R.string.messageCFNRc);
    }
    if (mButtonCLIR != null) {
      mButtonCLIR.setOnPreferenceChangeListener(this);
    }
    if (mSubMenuFDNSettings != null) {
      mFDNSettingIntent=new Intent(Intent.ACTION_MAIN);
      mFDNSettingIntent.setClassName(this,FdnSetting.class.getName());
      mSubMenuFDNSettings.setIntent(mFDNSettingIntent);
    }
  }
  if (mSubMenuVoicemailSettings != null) {
    mSubMenuVoicemailSettings.setParentActivity(this,VOICEMAIL_PREF_ID,this);
    mSubMenuVoicemailSettings.setDialogOnClosedListener(this);
    mSubMenuVoicemailSettings.setDialogTitle(R.string.voicemail_settings_number_label);
  }
  mContactListIntent=new Intent(Intent.ACTION_GET_CONTENT);
  mContactListIntent.setType(android.provider.Contacts.Phones.CONTENT_ITEM_TYPE);
  if (mSubMenuFDNSettings != null) {
    mFDNSettingIntent=new Intent(Intent.ACTION_MAIN);
    mFDNSettingIntent.setClassName(this,FdnSetting.class.getName());
    mSubMenuFDNSettings.setIntent(mFDNSettingIntent);
  }
  mAppState=AppState.INPUT_READY;
  if (icicle != null) {
    if (mPhone.getPhoneName().equals("String_Node_Str")) {
      mButtonVoicePrivacy.setChecked(icicle.getBoolean(BUTTON_VP_KEY));
    }
 else     if (mPhone.getPhoneName().equals("String_Node_Str")) {
      mDialingNumCFU=icicle.getString(SUMMARY_CFU_KEY);
      mDialingNumCFB=icicle.getString(SUMMARY_CFB_KEY);
      mDialingNumCFNRy=icicle.getString(SUMMARY_CFNRY_KEY);
      mDialingNumCFNRc=icicle.getString(SUMMARY_CFNRC_KEY);
      adjustCFbuttonState(mButtonCFU,icicle.getBoolean(BUTTON_CFU_KEY),R.string.sum_cfu_enabled,mDialingNumCFU);
      adjustCFbuttonState(mButtonCFB,icicle.getBoolean(BUTTON_CFB_KEY),R.string.sum_cfb_enabled,mDialingNumCFB);
      adjustCFbuttonState(mButtonCFNRy,icicle.getBoolean(BUTTON_CFNRY_KEY),R.string.sum_cfnry_enabled,mDialingNumCFNRy);
      adjustCFbuttonState(mButtonCFNRc,icicle.getBoolean(BUTTON_CFNRC_KEY),R.string.sum_cfnrc_enabled,mDialingNumCFNRc);
      setButtonCLIRValue(icicle.getInt(BUTTON_CLIR_KEY));
      if (mButtonCW != null) {
        mButtonCW.setChecked(icicle.getBoolean(BUTTON_CW_KEY));
      }
      mCFDataStale=icicle.getBoolean(BUTTON_CF_EXPAND_KEY);
      mMoreDataStale=icicle.getBoolean(BUTTON_GSM_MORE_EXPAND_KEY);
    }
    mAppState=(AppState)icicle.getSerializable(APP_STATE_KEY);
    mDisplayMode=icicle.getInt(DISPLAY_MODE_KEY);
  }
 else {
    mCFDataStale=true;
    mMoreDataStale=true;
    if (getIntent().getAction().equals(ACTION_ADD_VOICEMAIL)) {
      setAppState(AppState.DIALOG_OPEN);
      mSubMenuVoicemailSettings.showPhoneNumberDialog();
    }
  }
  updateVoiceNumberField();
}