Program: 184719
Project: 184719
Buggy source:
@Override protected void onCreate(Bundle icicle){
  super.onCreate(icicle);
  if (DBG)   log("String_Node_Str");
  mPhone=PhoneFactory.getDefaultPhone();
  addPreferencesFromResource(R.xml.call_feature_setting);
  mAudioManager=(AudioManager)getSystemService(Context.AUDIO_SERVICE);
  PreferenceScreen prefSet=getPreferenceScreen();
  mSubMenuVoicemailSettings=(EditPhoneNumberPreference)findPreference(BUTTON_VOICEMAIL_KEY);
  if (mSubMenuVoicemailSettings != null) {
    mSubMenuVoicemailSettings.setParentActivity(this,VOICEMAIL_PREF_ID,this);
    mSubMenuVoicemailSettings.setDialogOnClosedListener(this);
    mSubMenuVoicemailSettings.setDialogTitle(R.string.voicemail_settings_number_label);
  }
  mButtonDTMF=(ListPreference)findPreference(BUTTON_DTMF_KEY);
  mButtonAutoRetry=(CheckBoxPreference)findPreference(BUTTON_RETRY_KEY);
  mButtonHAC=(CheckBoxPreference)findPreference(BUTTON_HAC_KEY);
  mButtonTTY=(ListPreference)findPreference(BUTTON_TTY_KEY);
  mVoicemailProviders=(ListPreference)findPreference(BUTTON_VOICEMAIL_PROVIDER_KEY);
  if (mVoicemailProviders != null) {
    mVoicemailProviders.setOnPreferenceChangeListener(this);
    mVoicemailSettings=(PreferenceScreen)findPreference(BUTTON_VOICEMAIL_SETTING_KEY);
    initVoiceMailProviders();
  }
  if (getResources().getBoolean(R.bool.dtmf_type_enabled)) {
    mButtonDTMF.setOnPreferenceChangeListener(this);
  }
 else {
    prefSet.removePreference(mButtonDTMF);
    mButtonDTMF=null;
  }
  if (getResources().getBoolean(R.bool.auto_retry_enabled)) {
    mButtonAutoRetry.setOnPreferenceChangeListener(this);
  }
 else {
    prefSet.removePreference(mButtonAutoRetry);
    mButtonAutoRetry=null;
  }
  if (getResources().getBoolean(R.bool.hac_enabled)) {
    mButtonHAC.setOnPreferenceChangeListener(this);
  }
 else {
    prefSet.removePreference(mButtonHAC);
    mButtonHAC=null;
  }
  if (getResources().getBoolean(R.bool.tty_enabled)) {
    mButtonTTY.setOnPreferenceChangeListener(this);
    ttyHandler=new TTYHandler();
  }
 else {
    prefSet.removePreference(mButtonTTY);
    mButtonTTY=null;
  }
  if (!getResources().getBoolean(R.bool.world_phone)) {
    prefSet.removePreference(prefSet.findPreference(BUTTON_CDMA_OPTIONS));
    prefSet.removePreference(prefSet.findPreference(BUTTON_GSM_UMTS_OPTIONS));
    int phoneType=mPhone.getPhoneType();
    if (phoneType == Phone.PHONE_TYPE_CDMA) {
      prefSet.removePreference(prefSet.findPreference(BUTTON_FDN_KEY));
      addPreferencesFromResource(R.xml.cdma_call_options);
    }
 else     if (phoneType == Phone.PHONE_TYPE_GSM) {
      addPreferencesFromResource(R.xml.gsm_umts_call_options);
    }
 else {
      throw new IllegalStateException("String_Node_Str" + phoneType);
    }
  }
  mContactListIntent=new Intent(Intent.ACTION_GET_CONTENT);
  mContactListIntent.setType(android.provider.Contacts.Phones.CONTENT_ITEM_TYPE);
  if (icicle == null) {
    if (getIntent().getAction().equals(ACTION_ADD_VOICEMAIL) && mVoicemailProviders != null) {
      if (mVMProvidersData.size() > 1) {
        simulatePreferenceClick(mVoicemailProviders);
      }
 else {
        onPreferenceChange(mVoicemailProviders,DEFAULT_VM_PROVIDER_KEY);
        mVoicemailProviders.setValue(DEFAULT_VM_PROVIDER_KEY);
      }
    }
  }
  updateVoiceNumberField();
  mVMProviderSettingsForced=false;
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle icicle){
  super.onCreate(icicle);
  if (DBG)   log("String_Node_Str");
  mPhone=PhoneFactory.getDefaultPhone();
  addPreferencesFromResource(R.xml.call_feature_setting);
  mAudioManager=(AudioManager)getSystemService(Context.AUDIO_SERVICE);
  PreferenceScreen prefSet=getPreferenceScreen();
  mSubMenuVoicemailSettings=(EditPhoneNumberPreference)findPreference(BUTTON_VOICEMAIL_KEY);
  if (mSubMenuVoicemailSettings != null) {
    mSubMenuVoicemailSettings.setParentActivity(this,VOICEMAIL_PREF_ID,this);
    mSubMenuVoicemailSettings.setDialogOnClosedListener(this);
    mSubMenuVoicemailSettings.setDialogTitle(R.string.voicemail_settings_number_label);
  }
  mButtonDTMF=(ListPreference)findPreference(BUTTON_DTMF_KEY);
  mButtonAutoRetry=(CheckBoxPreference)findPreference(BUTTON_RETRY_KEY);
  mButtonHAC=(CheckBoxPreference)findPreference(BUTTON_HAC_KEY);
  mButtonTTY=(ListPreference)findPreference(BUTTON_TTY_KEY);
  mVoicemailProviders=(ListPreference)findPreference(BUTTON_VOICEMAIL_PROVIDER_KEY);
  if (mVoicemailProviders != null) {
    mVoicemailProviders.setOnPreferenceChangeListener(this);
    mVoicemailSettings=(PreferenceScreen)findPreference(BUTTON_VOICEMAIL_SETTING_KEY);
    initVoiceMailProviders();
  }
  if (getResources().getBoolean(R.bool.dtmf_type_enabled)) {
    mButtonDTMF.setOnPreferenceChangeListener(this);
  }
 else {
    prefSet.removePreference(mButtonDTMF);
    mButtonDTMF=null;
  }
  if (getResources().getBoolean(R.bool.auto_retry_enabled)) {
    mButtonAutoRetry.setOnPreferenceChangeListener(this);
  }
 else {
    prefSet.removePreference(mButtonAutoRetry);
    mButtonAutoRetry=null;
  }
  if (getResources().getBoolean(R.bool.hac_enabled)) {
    mButtonHAC.setOnPreferenceChangeListener(this);
  }
 else {
    prefSet.removePreference(mButtonHAC);
    mButtonHAC=null;
  }
  if (getResources().getBoolean(R.bool.tty_enabled)) {
    mButtonTTY.setOnPreferenceChangeListener(this);
  }
 else {
    prefSet.removePreference(mButtonTTY);
    mButtonTTY=null;
  }
  if (!getResources().getBoolean(R.bool.world_phone)) {
    prefSet.removePreference(prefSet.findPreference(BUTTON_CDMA_OPTIONS));
    prefSet.removePreference(prefSet.findPreference(BUTTON_GSM_UMTS_OPTIONS));
    int phoneType=mPhone.getPhoneType();
    if (phoneType == Phone.PHONE_TYPE_CDMA) {
      prefSet.removePreference(prefSet.findPreference(BUTTON_FDN_KEY));
      addPreferencesFromResource(R.xml.cdma_call_options);
    }
 else     if (phoneType == Phone.PHONE_TYPE_GSM) {
      addPreferencesFromResource(R.xml.gsm_umts_call_options);
    }
 else {
      throw new IllegalStateException("String_Node_Str" + phoneType);
    }
  }
  mContactListIntent=new Intent(Intent.ACTION_GET_CONTENT);
  mContactListIntent.setType(android.provider.Contacts.Phones.CONTENT_ITEM_TYPE);
  if (icicle == null) {
    if (getIntent().getAction().equals(ACTION_ADD_VOICEMAIL) && mVoicemailProviders != null) {
      if (mVMProvidersData.size() > 1) {
        simulatePreferenceClick(mVoicemailProviders);
      }
 else {
        onPreferenceChange(mVoicemailProviders,DEFAULT_VM_PROVIDER_KEY);
        mVoicemailProviders.setValue(DEFAULT_VM_PROVIDER_KEY);
      }
    }
  }
  updateVoiceNumberField();
  mVMProviderSettingsForced=false;
}