Program: 184739
Project: 184739
Buggy source:
@Override protected void onCreate(Bundle icicle){
  super.onCreate(icicle);
  setContentView(R.layout.emergency_dialer);
  Resources r=getResources();
  mDigitsBackground=r.getDrawable(R.drawable.btn_dial_textfield_active);
  mDigitsEmptyBackground=r.getDrawable(R.drawable.btn_dial_textfield);
  mDigits=(EditText)findViewById(R.id.digits);
  mDigits.setKeyListener(DialerKeyListener.getInstance());
  mDigits.setOnClickListener(this);
  mDigits.setOnKeyListener(this);
  mDigits.setLongClickable(false);
  maybeAddNumberFormatting();
  View view=findViewById(R.id.one);
  if (view != null) {
    setupKeypad();
  }
  mVoicemailDialAndDeleteRow=findViewById(R.id.voicemailAndDialAndDelete);
  if (r.getBoolean(R.bool.config_show_onscreen_dial_button)) {
    mVoicemailDialAndDeleteRow.findViewById(R.id.voicemailButton).setEnabled(false);
    mDialButton=mVoicemailDialAndDeleteRow.findViewById(R.id.dialButton);
    mDialButton.setOnClickListener(this);
    mDelete=mVoicemailDialAndDeleteRow.findViewById(R.id.deleteButton);
    mDelete.setOnClickListener(this);
    mDelete.setOnLongClickListener(this);
  }
 else {
    mVoicemailDialAndDeleteRow.setVisibility(View.GONE);
    mVoicemailDialAndDeleteRow=null;
  }
  if (icicle != null) {
    super.onRestoreInstanceState(icicle);
  }
synchronized (mToneGeneratorLock) {
    if (mToneGenerator == null) {
      try {
        mToneGenerator=new ToneGenerator(AudioManager.STREAM_DTMF,TONE_RELATIVE_VOLUME);
      }
 catch (      RuntimeException e) {
        Log.w(LOG_TAG,"String_Node_Str" + e);
        mToneGenerator=null;
      }
    }
  }
  final IntentFilter intentFilter=new IntentFilter();
  intentFilter.addAction(Intent.ACTION_SCREEN_OFF);
  registerReceiver(mBroadcastReceiver,intentFilter);
  initVibrationPattern(r);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle icicle){
  super.onCreate(icicle);
  setContentView(R.layout.emergency_dialer);
  Resources r=getResources();
  mDigitsBackground=r.getDrawable(R.drawable.btn_dial_textfield_active);
  mDigitsEmptyBackground=r.getDrawable(R.drawable.btn_dial_textfield);
  mDigits=(EditText)findViewById(R.id.digits);
  mDigits.setKeyListener(DialerKeyListener.getInstance());
  mDigits.setOnClickListener(this);
  mDigits.setOnKeyListener(this);
  mDigits.setLongClickable(false);
  maybeAddNumberFormatting();
  View view=findViewById(R.id.one);
  if (view != null) {
    setupKeypad();
  }
  mVoicemailDialAndDeleteRow=findViewById(R.id.voicemailAndDialAndDelete);
  if (r.getBoolean(R.bool.config_show_onscreen_dial_button)) {
    mVoicemailDialAndDeleteRow.findViewById(R.id.voicemailButton).setEnabled(false);
    mDialButton=mVoicemailDialAndDeleteRow.findViewById(R.id.dialButton);
    mDialButton.setOnClickListener(this);
    mDelete=mVoicemailDialAndDeleteRow.findViewById(R.id.deleteButton);
    mDelete.setOnClickListener(this);
    mDelete.setOnLongClickListener(this);
  }
 else {
    mVoicemailDialAndDeleteRow.setVisibility(View.GONE);
    mVoicemailDialAndDeleteRow=null;
  }
  if (icicle != null) {
    super.onRestoreInstanceState(icicle);
  }
synchronized (mToneGeneratorLock) {
    if (mToneGenerator == null) {
      try {
        mToneGenerator=new ToneGenerator(DIAL_TONE_STREAM_TYPE,TONE_RELATIVE_VOLUME);
        setVolumeControlStream(DIAL_TONE_STREAM_TYPE);
      }
 catch (      RuntimeException e) {
        Log.w(LOG_TAG,"String_Node_Str" + e);
        mToneGenerator=null;
      }
    }
  }
  final IntentFilter intentFilter=new IntentFilter();
  intentFilter.addAction(Intent.ACTION_SCREEN_OFF);
  registerReceiver(mBroadcastReceiver,intentFilter);
  initVibrationPattern(r);
}