nus-yam/ex-repair huggingface dataset:
Program: 184883
Project: 184883
Buggy source:
/** 
 * Performs Call logging based on Timeout or Ignore Call Waiting Call for CDMA, and finally calls Hangup on the Call Waiting connection.
 */
void onCdmaCallWaitingReject(){
  final Call ringingCall=mPhone.getRingingCall();
  if (ringingCall.getState() == Call.State.WAITING) {
    Connection c=ringingCall.getLatestConnection();
    if (c != null) {
      String number=c.getAddress();
      int isPrivateNumber=c.getNumberPresentation();
      long date=c.getCreateTime();
      long duration=c.getDurationMillis();
      int callLogType=mCallWaitingTimeOut ? CallLog.Calls.MISSED_TYPE : CallLog.Calls.INCOMING_TYPE;
      Object o=c.getUserData();
      CallerInfo ci;
      if ((o == null) || (o instanceof CallerInfo)) {
        ci=(CallerInfo)o;
      }
 else {
        ci=((PhoneUtils.CallerInfoToken)o).currentInfo;
      }
      Calls.addCall(ci,mApplication,number,isPrivateNumber,callLogType,date,(int)duration / 1000);
      if (callLogType == CallLog.Calls.MISSED_TYPE) {
        NotificationMgr.getDefault().notifyMissedCall(ci.name,ci.phoneNumber,ci.phoneLabel,date);
      }
      mApplication.cdmaPhoneCallState.setCurrentCallState(CdmaPhoneCallState.PhoneCallState.SINGLE_ACTIVE);
      PhoneUtils.hangup(c);
    }
    mCallWaitingTimeOut=false;
  }
}

Fixed version (ground truth):
/** 
 * Performs Call logging based on Timeout or Ignore Call Waiting Call for CDMA, and finally calls Hangup on the Call Waiting connection.
 */
void onCdmaCallWaitingReject(){
  final Call ringingCall=mPhone.getRingingCall();
  if (ringingCall.getState() == Call.State.WAITING) {
    Connection c=ringingCall.getLatestConnection();
    if (c != null) {
      final String number=c.getAddress();
      final int presentation=c.getNumberPresentation();
      final long date=c.getCreateTime();
      final long duration=c.getDurationMillis();
      final int callLogType=mCallWaitingTimeOut ? CallLog.Calls.MISSED_TYPE : CallLog.Calls.INCOMING_TYPE;
      Object o=c.getUserData();
      final CallerInfo ci;
      if ((o == null) || (o instanceof CallerInfo)) {
        ci=(CallerInfo)o;
      }
 else {
        ci=((PhoneUtils.CallerInfoToken)o).currentInfo;
      }
      Thread t=new Thread(){
        public void run(){
          Calls.addCall(ci,mApplication,number,presentation,callLogType,date,(int)duration / 1000);
          if (DBG)           log("String_Node_Str");
        }
      }
;
      t.start();
      if (callLogType == CallLog.Calls.MISSED_TYPE) {
        showMissedCallNotification(c,date);
      }
      mApplication.cdmaPhoneCallState.setCurrentCallState(CdmaPhoneCallState.PhoneCallState.SINGLE_ACTIVE);
      PhoneUtils.hangup(c);
    }
    mCallWaitingTimeOut=false;
  }
}
Program: 184885
Project: 184885
Buggy source:
/** 
 * Updates the visibility of the onscreen "answer" UI.  On devices with no hardware CALL button, this UI becomes visible while an incoming call is ringing. TODO: This method should eventually be rolled into a more general method to update *all* onscreen UI elements that need to be different on different devices (depending on which hard buttons are present and/or if we don't have to worry about false touches while in-call.)
 */
private void updateOnscreenAnswerUi(){
  if (mOnscreenAnswerUiContainer != null) {
    if (mPhone.getState() == Phone.State.RINGING) {
      mOnscreenAnswerUiContainer.setVisibility(View.VISIBLE);
    }
 else {
      mOnscreenAnswerUiContainer.setVisibility(View.GONE);
    }
  }
}

Fixed version (ground truth):
/** 
 * Updates the visibility of the onscreen "answer" UI.  On devices with no hardware CALL button, this UI becomes visible while an incoming call is ringing. TODO: This method should eventually be rolled into a more general method to update *all* onscreen UI elements that need to be different on different devices (depending on which hard buttons are present and/or if we don't have to worry about false touches while in-call.)
 */
private void updateOnscreenAnswerUi(){
  if (mOnscreenAnswerUiContainer != null) {
    if (DBG)     log("String_Node_Str" + mPhone.getState().toString());
    if (mPhone.getState() == Phone.State.RINGING) {
      mOnscreenAnswerUiContainer.setVisibility(View.VISIBLE);
    }
 else {
      mOnscreenAnswerUiContainer.setVisibility(View.GONE);
    }
    if (DBG)     log("String_Node_Str" + mOnscreenAnswerUiContainer.getVisibility());
  }
}
Program: 184886
Project: 184886
Buggy source:
/** 
 * Answer the ringing call.
 */
void internalAnswerCall(){
  if (DBG)   log("String_Node_Str");
  PhoneUtils.answerCall(mPhone);
}

Fixed version (ground truth):
/** 
 * Answer the ringing call.
 */
void internalAnswerCall(){
  if (DBG)   log("String_Node_Str");
  PhoneUtils.answerCall(mPhone);
  if (mPhone.getPhoneName().equals("String_Node_Str")) {
    PhoneUtils.setMute(mPhone,false);
  }
}
Program: 184887
Project: 184887
Buggy source:
/** 
 * Restore the mute setting from the earliest connection of the foreground call.
 */
static Boolean restoreMuteState(Phone phone){
  Connection c=phone.getForegroundCall().getEarliestConnection();
  if (c != null) {
    Boolean shouldMute=sConnectionMuteTable.get(phone.getForegroundCall().getEarliestConnection());
    if (shouldMute == null) {
      if (DBG)       log("String_Node_Str");
      shouldMute=Boolean.FALSE;
    }
    setMute(phone,shouldMute.booleanValue());
    return shouldMute;
  }
  return Boolean.valueOf(getMute(phone));
}

Fixed version (ground truth):
/** 
 * Restore the mute setting from the earliest connection of the foreground call.
 */
static Boolean restoreMuteState(Phone phone){
  Connection c=phone.getForegroundCall().getEarliestConnection();
  if (c != null) {
    Boolean shouldMute;
    if (phone.getPhoneName().equals("String_Node_Str") && PhoneApp.getInstance().cdmaPhoneCallState.getCurrentCallState() == CdmaPhoneCallState.PhoneCallState.THRWAY_ACTIVE) {
      shouldMute=sConnectionMuteTable.get(phone.getForegroundCall().getLatestConnection());
    }
 else {
      shouldMute=sConnectionMuteTable.get(phone.getForegroundCall().getEarliestConnection());
    }
    if (shouldMute == null) {
      if (DBG)       log("String_Node_Str");
      shouldMute=Boolean.FALSE;
    }
    setMute(phone,shouldMute.booleanValue());
    return shouldMute;
  }
  return Boolean.valueOf(getMute(phone));
}
Program: 184888
Project: 184888
Buggy source:
private BluetoothPhoneState(){
  updateServiceState(false,mPhone.getServiceState());
  updatePhoneState(false,null);
  mBattchg=5;
  mSignal=asuToSignal(mPhone.getSignalStrength());
  mPhone.registerForServiceStateChanged(mStateChangeHandler,SERVICE_STATE_CHANGED,null);
  mPhone.registerForPhoneStateChanged(mStateChangeHandler,PHONE_STATE_CHANGED,null);
  IntentFilter filter=new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
  filter.addAction(TelephonyIntents.ACTION_SIGNAL_STRENGTH_CHANGED);
  mContext.registerReceiver(mStateReceiver,filter);
}

Fixed version (ground truth):
private BluetoothPhoneState(){
  updateServiceState(false,mPhone.getServiceState());
  updatePhoneState(false,null);
  mBattchg=5;
  mSignal=asuToSignal(mPhone.getSignalStrength());
  mPhone.registerForServiceStateChanged(mStateChangeHandler,SERVICE_STATE_CHANGED,null);
  mPhone.registerForPhoneStateChanged(mStateChangeHandler,PHONE_STATE_CHANGED,null);
  if (mPhone.getPhoneName().equals("String_Node_Str")) {
    mPhone.registerForCallWaiting(mStateChangeHandler,PHONE_CDMA_CALL_WAITING,null);
  }
  IntentFilter filter=new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
  filter.addAction(TelephonyIntents.ACTION_SIGNAL_STRENGTH_CHANGED);
  mContext.registerReceiver(mStateReceiver,filter);
}
Program: 184889
Project: 184889
Buggy source:
private void updateBtPhoneStateAfterRadioTechnologyChange(){
  if (DBG)   Log.d(TAG,"String_Node_Str");
  mPhone.unregisterForServiceStateChanged(mStateChangeHandler);
  mPhone.unregisterForPhoneStateChanged(mStateChangeHandler);
  mPhone.registerForServiceStateChanged(mStateChangeHandler,SERVICE_STATE_CHANGED,null);
  mPhone.registerForPhoneStateChanged(mStateChangeHandler,PHONE_STATE_CHANGED,null);
}

Fixed version (ground truth):
private void updateBtPhoneStateAfterRadioTechnologyChange(){
  if (DBG)   Log.d(TAG,"String_Node_Str");
  mPhone.unregisterForServiceStateChanged(mStateChangeHandler);
  mPhone.unregisterForPhoneStateChanged(mStateChangeHandler);
  mPhone.unregisterForCallWaiting(mStateChangeHandler);
  mPhone.registerForServiceStateChanged(mStateChangeHandler,SERVICE_STATE_CHANGED,null);
  mPhone.registerForPhoneStateChanged(mStateChangeHandler,PHONE_STATE_CHANGED,null);
  if (mPhone.getPhoneName().equals("String_Node_Str")) {
    mPhone.registerForCallWaiting(mStateChangeHandler,PHONE_CDMA_CALL_WAITING,null);
  }
}
Program: 184891
Project: 184891
Buggy source:
/** 
 * Plays tone when the DTMF setting is normal(Short).
 */
void startToneCdma(char tone){
  mDTMFToneType=Settings.System.getInt(mInCallScreen.getContentResolver(),Settings.System.DTMF_TONE_TYPE_WHEN_DIALING,CallFeaturesSetting.preferredDtmfMode);
  if (mDTMFToneType == CallFeaturesSetting.DTMF_TONE_TYPE_NORMAL) {
    sendShortDtmfToNetwork(tone);
  }
 else {
    Log.i(LOG_TAG,"String_Node_Str" + tone);
    mPhone.startDtmf(tone);
  }
  if (mDTMFToneEnabled) {
synchronized (mToneGeneratorLock) {
      if (mToneGenerator == null) {
        if (DBG)         log("String_Node_Str" + tone);
      }
 else {
        if (DBG)         log("String_Node_Str" + tone);
        stopToneCdma();
        mToneGenerator.startTone(mToneMap.get(tone));
        if (mDTMFToneType == CallFeaturesSetting.DTMF_TONE_TYPE_NORMAL) {
          mHandler.removeMessages(STOP_DTMF_TONE);
          mHandler.sendEmptyMessageDelayed(STOP_DTMF_TONE,DTMF_DURATION_MS);
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Plays tone when the DTMF setting is normal(Short).
 */
void startToneCdma(char tone){
  mDTMFToneType=Settings.System.getInt(mInCallScreen.getContentResolver(),Settings.System.DTMF_TONE_TYPE_WHEN_DIALING,CallFeaturesSetting.preferredDtmfMode);
  if (mDTMFToneType == CallFeaturesSetting.DTMF_TONE_TYPE_NORMAL) {
    sendShortDtmfToNetwork(tone);
  }
 else {
    Log.i(LOG_TAG,"String_Node_Str" + tone);
    mPhone.startDtmf(tone);
  }
  if (mDTMFToneEnabled) {
synchronized (mToneGeneratorLock) {
      if (mToneGenerator == null) {
        if (DBG)         log("String_Node_Str" + tone);
      }
 else {
        if (DBG)         log("String_Node_Str" + tone);
        mToneGenerator.startTone(mToneMap.get(tone));
        if (mDTMFToneType == CallFeaturesSetting.DTMF_TONE_TYPE_NORMAL) {
          mHandler.removeMessages(STOP_DTMF_TONE);
          mHandler.sendEmptyMessageDelayed(STOP_DTMF_TONE,DTMF_DURATION_MS);
        }
      }
    }
  }
}
Program: 184892
Project: 184892
Buggy source:
private BluetoothPhoneState(){
  updateServiceState(false,mPhone.getServiceState());
  updatePhoneState(false,null);
  mBattchg=5;
  mSignal=asuToSignal(mPhone.getSignalStrength());
  mPhone.registerForServiceStateChanged(mStateChangeHandler,SERVICE_STATE_CHANGED,null);
  mPhone.registerForPreciseCallStateChanged(mStateChangeHandler,PHONE_STATE_CHANGED,null);
  IntentFilter filter=new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
  filter.addAction(TelephonyIntents.ACTION_SIGNAL_STRENGTH_CHANGED);
  mContext.registerReceiver(mStateReceiver,filter);
}

Fixed version (ground truth):
private BluetoothPhoneState(){
  updateServiceState(false,mPhone.getServiceState());
  updatePhoneState(false,null);
  mBattchg=5;
  mSignal=asuToSignal(mPhone.getSignalStrength());
  mPhone.registerForServiceStateChanged(mStateChangeHandler,SERVICE_STATE_CHANGED,null);
  mPhone.registerForPreciseCallStateChanged(mStateChangeHandler,PHONE_STATE_CHANGED,null);
  if (mPhone.getPhoneName().equals("String_Node_Str")) {
    mPhone.registerForCallWaiting(mStateChangeHandler,PHONE_CDMA_CALL_WAITING,null);
  }
  IntentFilter filter=new IntentFilter(Intent.ACTION_BATTERY_CHANGED);
  filter.addAction(TelephonyIntents.ACTION_SIGNAL_STRENGTH_CHANGED);
  mContext.registerReceiver(mStateReceiver,filter);
}
Program: 184893
Project: 184893
Buggy source:
private void updateBtPhoneStateAfterRadioTechnologyChange(){
  if (DBG)   Log.d(TAG,"String_Node_Str");
  mPhone.unregisterForServiceStateChanged(mStateChangeHandler);
  mPhone.unregisterForPreciseCallStateChanged(mStateChangeHandler);
  mPhone.registerForServiceStateChanged(mStateChangeHandler,SERVICE_STATE_CHANGED,null);
  mPhone.registerForPreciseCallStateChanged(mStateChangeHandler,PHONE_STATE_CHANGED,null);
}

Fixed version (ground truth):
private void updateBtPhoneStateAfterRadioTechnologyChange(){
  if (DBG)   Log.d(TAG,"String_Node_Str");
  mPhone.unregisterForServiceStateChanged(mStateChangeHandler);
  mPhone.unregisterForPreciseCallStateChanged(mStateChangeHandler);
  mPhone.unregisterForCallWaiting(mStateChangeHandler);
  mPhone.registerForServiceStateChanged(mStateChangeHandler,SERVICE_STATE_CHANGED,null);
  mPhone.registerForPreciseCallStateChanged(mStateChangeHandler,PHONE_STATE_CHANGED,null);
  if (mPhone.getPhoneName().equals("String_Node_Str")) {
    mPhone.registerForCallWaiting(mStateChangeHandler,PHONE_CDMA_CALL_WAITING,null);
  }
}
Program: 184897
Project: 184897
Buggy source:
private String getCallFailedString(Call call){
  Phone phone=PhoneApp.getInstance().phone;
  Connection c=call.getEarliestConnection();
  int resID;
  if (c == null) {
    if (DBG)     log("String_Node_Str");
    resID=R.string.card_title_call_ended;
  }
 else {
    Connection.DisconnectCause cause=c.getDisconnectCause();
switch (cause) {
case BUSY:
      resID=R.string.callFailed_userBusy;
    break;
case CONGESTION:
  resID=R.string.callFailed_congestion;
break;
case LOST_SIGNAL:
resID=R.string.callFailed_noSignal;
break;
case LIMIT_EXCEEDED:
resID=R.string.callFailed_limitExceeded;
break;
case POWER_OFF:
resID=R.string.callFailed_powerOff;
break;
case ICC_ERROR:
resID=R.string.callFailed_simError;
break;
case OUT_OF_SERVICE:
resID=R.string.callFailed_outOfService;
break;
default :
resID=R.string.card_title_call_ended;
break;
}
}
return getContext().getString(resID);
}

Fixed version (ground truth):
private String getCallFailedString(Call call){
  Connection c=call.getEarliestConnection();
  int resID;
  if (c == null) {
    if (DBG)     log("String_Node_Str");
    resID=R.string.card_title_call_ended;
  }
 else {
    Connection.DisconnectCause cause=c.getDisconnectCause();
switch (cause) {
case BUSY:
      resID=R.string.callFailed_userBusy;
    break;
case CONGESTION:
  resID=R.string.callFailed_congestion;
break;
case LOST_SIGNAL:
resID=R.string.callFailed_noSignal;
break;
case LIMIT_EXCEEDED:
resID=R.string.callFailed_limitExceeded;
break;
case POWER_OFF:
resID=R.string.callFailed_powerOff;
break;
case ICC_ERROR:
resID=R.string.callFailed_simError;
break;
case OUT_OF_SERVICE:
resID=R.string.callFailed_outOfService;
break;
default :
resID=R.string.card_title_call_ended;
break;
}
}
return getContext().getString(resID);
}
Program: 184898
Project: 184898
Buggy source:
void reset(){
  if (DBG)   log("String_Node_Str");
  mRingerSilenced=false;
  showCallConnected();
  setUpperTitle("String_Node_Str");
}

Fixed version (ground truth):
void reset(){
  if (DBG)   log("String_Node_Str");
  showCallConnected();
  setUpperTitle("String_Node_Str");
}
Program: 184901
Project: 184901
Buggy source:
private String getCallFailedString(Call call){
  Phone phone=PhoneApp.getInstance().phone;
  Connection c=call.getEarliestConnection();
  int resID;
  if (c == null) {
    if (DBG)     log("String_Node_Str");
    resID=R.string.card_title_call_ended;
  }
 else {
    Connection.DisconnectCause cause=c.getDisconnectCause();
switch (cause) {
case BUSY:
      resID=R.string.callFailed_userBusy;
    break;
case CONGESTION:
  resID=R.string.callFailed_congestion;
break;
case LOST_SIGNAL:
resID=R.string.callFailed_noSignal;
break;
case LIMIT_EXCEEDED:
resID=R.string.callFailed_limitExceeded;
break;
case POWER_OFF:
resID=R.string.callFailed_powerOff;
break;
case ICC_ERROR:
resID=R.string.callFailed_simError;
break;
case OUT_OF_SERVICE:
resID=R.string.callFailed_outOfService;
break;
default :
resID=R.string.card_title_call_ended;
break;
}
}
return getContext().getString(resID);
}

Fixed version (ground truth):
private String getCallFailedString(Call call){
  Connection c=call.getEarliestConnection();
  int resID;
  if (c == null) {
    if (DBG)     log("String_Node_Str");
    resID=R.string.card_title_call_ended;
  }
 else {
    Connection.DisconnectCause cause=c.getDisconnectCause();
switch (cause) {
case BUSY:
      resID=R.string.callFailed_userBusy;
    break;
case CONGESTION:
  resID=R.string.callFailed_congestion;
break;
case LOST_SIGNAL:
resID=R.string.callFailed_noSignal;
break;
case LIMIT_EXCEEDED:
resID=R.string.callFailed_limitExceeded;
break;
case POWER_OFF:
resID=R.string.callFailed_powerOff;
break;
case ICC_ERROR:
resID=R.string.callFailed_simError;
break;
case OUT_OF_SERVICE:
resID=R.string.callFailed_outOfService;
break;
default :
resID=R.string.card_title_call_ended;
break;
}
}
return getContext().getString(resID);
}
Program: 184902
Project: 184902
Buggy source:
void reset(){
  if (DBG)   log("String_Node_Str");
  mRingerSilenced=false;
  showCallConnected();
  setUpperTitle("String_Node_Str");
}

Fixed version (ground truth):
void reset(){
  if (DBG)   log("String_Node_Str");
  showCallConnected();
  setUpperTitle("String_Node_Str");
}
Program: 184906
Project: 184906
Buggy source:
private void onNewRingingConnection(AsyncResult r){
  Connection c=(Connection)r.result;
  if (DBG)   log("String_Node_Str" + c);
  PhoneApp app=PhoneApp.getInstance();
  boolean provisioned=Settings.Secure.getInt(mPhone.getContext().getContentResolver(),Settings.Secure.DEVICE_PROVISIONED,0) != 0;
  if (!provisioned) {
    Log.i(LOG_TAG,"String_Node_Str");
    PhoneUtils.hangupRingingCall(mPhone);
    return;
  }
  if (c != null && c.isRinging()) {
    Call.State state=c.getState();
    if (VDBG)     log("String_Node_Str" + state);
    if (state == Call.State.INCOMING) {
      PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_RINGING);
      startIncomingCallQuery(c);
    }
 else {
      if (VDBG)       log("String_Node_Str");
      new InCallTonePlayer(InCallTonePlayer.TONE_CALL_WAITING).start();
      PhoneUtils.showIncomingCallUi();
    }
  }
  if (VDBG)   log("String_Node_Str");
  mApplication.requestWakeState(PhoneApp.WakeState.PARTIAL);
  if (VDBG)   log("String_Node_Str");
}

Fixed version (ground truth):
private void onNewRingingConnection(AsyncResult r){
  Connection c=(Connection)r.result;
  if (DBG)   log("String_Node_Str" + c);
  boolean provisioned=Settings.Secure.getInt(mPhone.getContext().getContentResolver(),Settings.Secure.DEVICE_PROVISIONED,0) != 0;
  if (!provisioned) {
    Log.i(LOG_TAG,"String_Node_Str");
    PhoneUtils.hangupRingingCall(mPhone);
    return;
  }
  if (c != null && c.isRinging()) {
    Call.State state=c.getState();
    if (VDBG)     log("String_Node_Str" + state);
    if (state == Call.State.INCOMING) {
      PhoneUtils.setAudioControlState(PhoneUtils.AUDIO_RINGING);
      startIncomingCallQuery(c);
    }
 else {
      if (VDBG)       log("String_Node_Str");
      new InCallTonePlayer(InCallTonePlayer.TONE_CALL_WAITING).start();
      PhoneUtils.showIncomingCallUi();
    }
  }
  if (VDBG)   log("String_Node_Str");
  mApplication.requestWakeState(PhoneApp.WakeState.PARTIAL);
  if (VDBG)   log("String_Node_Str");
}
Program: 184907
Project: 184907
Buggy source:
@Override public boolean dispatchTouchEvent(MotionEvent event){
  int x=(int)event.getX();
  int y=(int)event.getY();
  int closestDeltaX=0;
  int closestDeltaY=0;
  ArrayList<View> touchables=getTouchables();
  int minDistance=Integer.MAX_VALUE;
  View closest=null;
  final int numTouchables=touchables.size();
  Rect closestBounds=new Rect();
  Rect touchableBounds=new Rect();
  for (int i=0; i < numTouchables; i++) {
    View touchable=touchables.get(i);
    touchable.getDrawingRect(touchableBounds);
    offsetDescendantRectToMyCoords(touchable,touchableBounds);
    if (touchableBounds.contains(x,y)) {
      return super.dispatchTouchEvent(event);
    }
    int deltaX;
    if (x > touchableBounds.right) {
      deltaX=touchableBounds.right - 1 - x;
    }
 else     if (x < touchableBounds.left) {
      deltaX=touchableBounds.left + 1 - x;
    }
 else {
      deltaX=0;
    }
    int deltaY;
    if (y > touchableBounds.bottom) {
      deltaY=touchableBounds.bottom - 1 - y;
    }
 else     if (y < touchableBounds.top) {
      deltaY=touchableBounds.top + 1 - y;
    }
 else {
      deltaY=0;
    }
    final int distanceSquared=(deltaX * deltaX) + (deltaY * deltaY);
    if (distanceSquared < minDistance) {
      minDistance=distanceSquared;
      closest=touchable;
      closestDeltaX=deltaX;
      closestDeltaY=deltaY;
    }
  }
  if (closest != null) {
    event.offsetLocation(closestDeltaX,closestDeltaY);
    return super.dispatchTouchEvent(event);
  }
 else {
    return super.dispatchTouchEvent(event);
  }
}

Fixed version (ground truth):
@Override public boolean dispatchTouchEvent(MotionEvent event){
  int x=(int)event.getX();
  int y=(int)event.getY();
  int closestDeltaX=0;
  int closestDeltaY=0;
  ArrayList<View> touchables=getTouchables();
  int minDistance=Integer.MAX_VALUE;
  View closest=null;
  final int numTouchables=touchables.size();
  Rect touchableBounds=new Rect();
  for (int i=0; i < numTouchables; i++) {
    View touchable=touchables.get(i);
    touchable.getDrawingRect(touchableBounds);
    offsetDescendantRectToMyCoords(touchable,touchableBounds);
    if (touchableBounds.contains(x,y)) {
      return super.dispatchTouchEvent(event);
    }
    int deltaX;
    if (x > touchableBounds.right) {
      deltaX=touchableBounds.right - 1 - x;
    }
 else     if (x < touchableBounds.left) {
      deltaX=touchableBounds.left + 1 - x;
    }
 else {
      deltaX=0;
    }
    int deltaY;
    if (y > touchableBounds.bottom) {
      deltaY=touchableBounds.bottom - 1 - y;
    }
 else     if (y < touchableBounds.top) {
      deltaY=touchableBounds.top + 1 - y;
    }
 else {
      deltaY=0;
    }
    final int distanceSquared=(deltaX * deltaX) + (deltaY * deltaY);
    if (distanceSquared < minDistance) {
      minDistance=distanceSquared;
      closest=touchable;
      closestDeltaX=deltaX;
      closestDeltaY=deltaY;
    }
  }
  if (closest != null) {
    event.offsetLocation(closestDeltaX,closestDeltaY);
    return super.dispatchTouchEvent(event);
  }
 else {
    return super.dispatchTouchEvent(event);
  }
}
Program: 184908
Project: 184908
Buggy source:
public void onClick(View view){
  final Editable digits=mDigits.getText();
switch (view.getId()) {
case R.id.one:
{
      playTone(ToneGenerator.TONE_DTMF_1);
      keyPressed(KeyEvent.KEYCODE_1);
      return;
    }
case R.id.two:
{
    playTone(ToneGenerator.TONE_DTMF_2);
    keyPressed(KeyEvent.KEYCODE_2);
    return;
  }
case R.id.three:
{
  playTone(ToneGenerator.TONE_DTMF_3);
  keyPressed(KeyEvent.KEYCODE_3);
  return;
}
case R.id.four:
{
playTone(ToneGenerator.TONE_DTMF_4);
keyPressed(KeyEvent.KEYCODE_4);
return;
}
case R.id.five:
{
playTone(ToneGenerator.TONE_DTMF_5);
keyPressed(KeyEvent.KEYCODE_5);
return;
}
case R.id.six:
{
playTone(ToneGenerator.TONE_DTMF_6);
keyPressed(KeyEvent.KEYCODE_6);
return;
}
case R.id.seven:
{
playTone(ToneGenerator.TONE_DTMF_7);
keyPressed(KeyEvent.KEYCODE_7);
return;
}
case R.id.eight:
{
playTone(ToneGenerator.TONE_DTMF_8);
keyPressed(KeyEvent.KEYCODE_8);
return;
}
case R.id.nine:
{
playTone(ToneGenerator.TONE_DTMF_9);
keyPressed(KeyEvent.KEYCODE_9);
return;
}
case R.id.zero:
{
playTone(ToneGenerator.TONE_DTMF_0);
keyPressed(KeyEvent.KEYCODE_0);
return;
}
case R.id.pound:
{
playTone(ToneGenerator.TONE_DTMF_P);
keyPressed(KeyEvent.KEYCODE_POUND);
return;
}
case R.id.star:
{
playTone(ToneGenerator.TONE_DTMF_S);
keyPressed(KeyEvent.KEYCODE_STAR);
return;
}
case R.id.digits:
{
placeCall();
return;
}
case R.id.backspace:
{
keyPressed(KeyEvent.KEYCODE_DEL);
return;
}
}
}

Fixed version (ground truth):
public void onClick(View view){
switch (view.getId()) {
case R.id.one:
{
      playTone(ToneGenerator.TONE_DTMF_1);
      keyPressed(KeyEvent.KEYCODE_1);
      return;
    }
case R.id.two:
{
    playTone(ToneGenerator.TONE_DTMF_2);
    keyPressed(KeyEvent.KEYCODE_2);
    return;
  }
case R.id.three:
{
  playTone(ToneGenerator.TONE_DTMF_3);
  keyPressed(KeyEvent.KEYCODE_3);
  return;
}
case R.id.four:
{
playTone(ToneGenerator.TONE_DTMF_4);
keyPressed(KeyEvent.KEYCODE_4);
return;
}
case R.id.five:
{
playTone(ToneGenerator.TONE_DTMF_5);
keyPressed(KeyEvent.KEYCODE_5);
return;
}
case R.id.six:
{
playTone(ToneGenerator.TONE_DTMF_6);
keyPressed(KeyEvent.KEYCODE_6);
return;
}
case R.id.seven:
{
playTone(ToneGenerator.TONE_DTMF_7);
keyPressed(KeyEvent.KEYCODE_7);
return;
}
case R.id.eight:
{
playTone(ToneGenerator.TONE_DTMF_8);
keyPressed(KeyEvent.KEYCODE_8);
return;
}
case R.id.nine:
{
playTone(ToneGenerator.TONE_DTMF_9);
keyPressed(KeyEvent.KEYCODE_9);
return;
}
case R.id.zero:
{
playTone(ToneGenerator.TONE_DTMF_0);
keyPressed(KeyEvent.KEYCODE_0);
return;
}
case R.id.pound:
{
playTone(ToneGenerator.TONE_DTMF_P);
keyPressed(KeyEvent.KEYCODE_POUND);
return;
}
case R.id.star:
{
playTone(ToneGenerator.TONE_DTMF_S);
keyPressed(KeyEvent.KEYCODE_STAR);
return;
}
case R.id.digits:
{
placeCall();
return;
}
case R.id.backspace:
{
keyPressed(KeyEvent.KEYCODE_DEL);
return;
}
}
}
Program: 184909
Project: 184909
Buggy source:
/** 
 * Do some delayed cleanup after a Phone call gets disconnected. This method gets called a couple of seconds after any DISCONNECT event from the Phone; it's triggered by the DELAYED_CLEANUP_AFTER_DISCONNECT message we send in onDisconnect(). If the Phone is totally idle right now, that means we've already shown the "call ended" state for a couple of seconds, and it's now time to finish() this activity. If the Phone is *not* idle right now, that probably means that one call ended but the other line is still in use.  In that case, we *don't* exit the in-call screen, but we at least turn off the backlight (which we turned on in onDisconnect().)
 */
private void delayedCleanupAfterDisconnect(){
  if (VDBG)   log("String_Node_Str" + mPhone.getState());
  mPhone.clearDisconnected();
  final PhoneApp app=PhoneApp.getInstance();
  if (!phoneIsInUse()) {
    if (DBG)     log("String_Node_Str");
    if (mIsForegroundActivity) {
      if (DBG)       log("String_Node_Str");
      if (mShowCallLogAfterDisconnect && !isPhoneStateRestricted()) {
        if (VDBG)         log("String_Node_Str");
        final Intent intent=PhoneApp.createCallLogIntent();
        startActivity(intent);
      }
      finish();
    }
  }
 else {
    if (DBG)     log("String_Node_Str");
    if (DBG)     PhoneUtils.dumpCallState(mPhone);
  }
}

Fixed version (ground truth):
/** 
 * Do some delayed cleanup after a Phone call gets disconnected. This method gets called a couple of seconds after any DISCONNECT event from the Phone; it's triggered by the DELAYED_CLEANUP_AFTER_DISCONNECT message we send in onDisconnect(). If the Phone is totally idle right now, that means we've already shown the "call ended" state for a couple of seconds, and it's now time to finish() this activity. If the Phone is *not* idle right now, that probably means that one call ended but the other line is still in use.  In that case, we *don't* exit the in-call screen, but we at least turn off the backlight (which we turned on in onDisconnect().)
 */
private void delayedCleanupAfterDisconnect(){
  if (VDBG)   log("String_Node_Str" + mPhone.getState());
  mPhone.clearDisconnected();
  if (!phoneIsInUse()) {
    if (DBG)     log("String_Node_Str");
    if (mIsForegroundActivity) {
      if (DBG)       log("String_Node_Str");
      if (mShowCallLogAfterDisconnect && !isPhoneStateRestricted()) {
        if (VDBG)         log("String_Node_Str");
        final Intent intent=PhoneApp.createCallLogIntent();
        startActivity(intent);
      }
      finish();
    }
  }
 else {
    if (DBG)     log("String_Node_Str");
    if (DBG)     PhoneUtils.dumpCallState(mPhone);
  }
}
Program: 184913
Project: 184913
Buggy source:
@Override protected boolean processFile(final File file){
  logger.info("String_Node_Str",file.getAbsolutePath());
  StringWriter writer=new StringWriter();
  final TransformerFactory transformerFactory=TransformerFactory.newInstance();
  try {
    final Transformer transformer=transformerFactory.newTransformer(new StreamSource(template));
    transformer.transform(new StreamSource(file),new StreamResult(writer));
    String result=writer.toString();
    String outputFileName=getTemplate().getAbsolutePath() + File.pathSeparator + buildResultFilename(result);
    BufferedWriter out=new BufferedWriter(new FileWriter(outputFileName));
    out.write(result);
    out.close();
    return true;
  }
 catch (  TransformerConfigurationException e) {
  }
catch (  TransformerException e) {
  }
catch (  IOException e) {
  }
  return false;
}

Fixed version (ground truth):
@Override protected boolean processFile(final File file){
  logger.info("String_Node_Str",file.getAbsolutePath());
  StringWriter writer=new StringWriter();
  final TransformerFactory transformerFactory=TransformerFactory.newInstance();
  try {
    final Transformer transformer=transformerFactory.newTransformer(new StreamSource(template));
    transformer.transform(new StreamSource(file),new StreamResult(writer));
    String result=writer.toString();
    String outputFileName=getDestinationDirectory().getAbsolutePath() + File.separator + buildResultFilename(result);
    BufferedWriter out=new BufferedWriter(new FileWriter(outputFileName));
    out.write(result);
    out.close();
    return true;
  }
 catch (  TransformerConfigurationException e) {
  }
catch (  TransformerException e) {
  }
catch (  IOException e) {
  }
  return false;
}
Program: 184914
Project: 184914
Buggy source:
private void processPresentations() throws RepositoryException {
  mLogger.debug("String_Node_Str");
  Map<String,Presentation> tNewPresentations=new HashMap<String,Presentation>();
  Map<String,Long> tPathEntries=getChildrenRevisions(getLocation("String_Node_Str"));
  for (  Map.Entry<String,Long> tEntry : tPathEntries.entrySet()) {
    ;
    Presentation tPresentation=(Presentation)mApplicationContext.getBean("String_Node_Str",new Object[]{tEntry.getValue(),tEntry.getKey()});
    tNewPresentations.put(tEntry.getKey(),tPresentation);
  }
  mLogger.debug("String_Node_Str");
  Repository tRepository=getRepository();
  RepositoryChangeset<Presentation> tChangeset=new RepositoryChangeset<Presentation>(tRepository.getPresentations(),tNewPresentations);
  for (  Map.Entry<String,Presentation> tEntry : tChangeset.getRemovals().entrySet()) {
    tRepository.removePresentation(tEntry.getKey(),tEntry.getValue());
  }
  for (  Map.Entry<String,Presentation> tEntry : tChangeset.getAdditions().entrySet()) {
    tRepository.addPresentation(tEntry.getKey(),tEntry.getValue());
  }
  for (  Map.Entry<String,Presentation> tEntry : tChangeset.getUpdates().entrySet()) {
    tRepository.updatePresentation(tEntry.getKey(),tEntry.getValue());
  }
}

Fixed version (ground truth):
private void processPresentations() throws RepositoryException {
  mLogger.debug("String_Node_Str");
  Map<String,Presentation> tNewPresentations=new HashMap<String,Presentation>();
  Map<String,Long> tPathEntries=getChildrenRevisions(getLocation("String_Node_Str"));
  for (  Map.Entry<String,Long> tEntry : tPathEntries.entrySet()) {
    ;
    Presentation tPresentation=(Presentation)mApplicationContext.getBean("String_Node_Str",new Object[]{tEntry.getValue(),"String_Node_Str" + tEntry.getKey()});
    tNewPresentations.put(tEntry.getKey(),tPresentation);
  }
  mLogger.debug("String_Node_Str");
  Repository tRepository=getRepository();
  RepositoryChangeset<Presentation> tChangeset=new RepositoryChangeset<Presentation>(tRepository.getPresentations(),tNewPresentations);
  for (  Map.Entry<String,Presentation> tEntry : tChangeset.getRemovals().entrySet()) {
    tRepository.removePresentation(tEntry.getKey(),tEntry.getValue());
  }
  for (  Map.Entry<String,Presentation> tEntry : tChangeset.getAdditions().entrySet()) {
    tRepository.addPresentation(tEntry.getKey(),tEntry.getValue());
  }
  for (  Map.Entry<String,Presentation> tEntry : tChangeset.getUpdates().entrySet()) {
    tRepository.updatePresentation(tEntry.getKey(),tEntry.getValue());
  }
}
Program: 184915
Project: 184915
Buggy source:
private Map<String,Long> getChildrenRevisions(final String iLocation) throws RepositoryException {
  try {
    final Map<String,Long> tChildren=new HashMap<String,Long>();
    mClient.info2(iLocation,Revision.HEAD,Revision.HEAD,Depth.immediates,null,new InfoCallback(){
      @Override public void singleInfo(      final Info2 iInfo){
        if (iInfo.getPath().equals(iLocation)) {
          return;
        }
        tChildren.put(iInfo.getPath(),iInfo.getLastChangedRev());
      }
    }
);
    return tChildren;
  }
 catch (  ClientException tException) {
    throw new RepositoryException("String_Node_Str",tException);
  }
}

Fixed version (ground truth):
private Map<String,Long> getChildrenRevisions(final String iLocation) throws RepositoryException {
  try {
    final Map<String,Long> tChildren=new HashMap<String,Long>();
    mClient.info2(iLocation,Revision.HEAD,Revision.HEAD,Depth.immediates,null,new InfoCallback(){
      @Override public void singleInfo(      final Info2 iInfo){
        if (iInfo.getUrl().equals(iLocation)) {
          return;
        }
        tChildren.put(iInfo.getPath(),iInfo.getLastChangedRev());
      }
    }
);
    return tChildren;
  }
 catch (  ClientException tException) {
    throw new RepositoryException("String_Node_Str",tException);
  }
}
Program: 184916
Project: 184916
Buggy source:
@Override public void singleInfo(final Info2 iInfo){
  if (iInfo.getPath().equals(iLocation)) {
    return;
  }
  tChildren.put(iInfo.getPath(),iInfo.getLastChangedRev());
}

Fixed version (ground truth):
@Override public void singleInfo(final Info2 iInfo){
  if (iInfo.getUrl().equals(iLocation)) {
    return;
  }
  tChildren.put(iInfo.getPath(),iInfo.getLastChangedRev());
}
Program: 184917
Project: 184917
Buggy source:
protected final String getEndpoint(final String[] iResources){
  StringBuilder tEndpointBuilder=new StringBuilder("String_Node_Str").append(getAddress());
  tEndpointBuilder.append("String_Node_Str").append(getPort());
  for (  final String tResource : iResources) {
    tEndpointBuilder.append("String_Node_Str").append(tResource);
  }
  return tEndpointBuilder.toString();
}

Fixed version (ground truth):
protected final String getEndpoint(final String[] iResources){
  StringBuilder tEndpointBuilder=new StringBuilder("String_Node_Str").append(getAddress());
  tEndpointBuilder.append("String_Node_Str").append(getPort());
  tEndpointBuilder.append("String_Node_Str");
  for (  final String tResource : iResources) {
    tEndpointBuilder.append(tResource).append("String_Node_Str");
  }
  return tEndpointBuilder.toString();
}
Program: 184918
Project: 184918
Buggy source:
private Network(){
  if (System.getProperty("String_Node_Str").equals("String_Node_Str")) {
    mDevices=new HashMap<UUID,NetworkEntity>();
    mUpnpService=new UpnpServiceImpl();
    mListeners=new ArrayList<INetworkListener>();
  }
 else   if (System.getProperty("String_Node_Str").equals("String_Node_Str")) {
    mDevices=new HashMap<UUID,NetworkEntity>();
    mUpnpService=new UpnpServiceImpl(new CompatUpnpServiceConfiguration());
    mListeners=new ArrayList<INetworkListener>();
  }
 else {
    throw new RuntimeException("String_Node_Str" + System.getProperty("String_Node_Str") + "String_Node_Str");
  }
}

Fixed version (ground truth):
private Network(){
  mDevices=new HashMap<UUID,NetworkEntity>();
  mUpnpService=new UpnpServiceImpl();
  mListeners=new ArrayList<INetworkListener>();
}
Program: 184919
Project: 184919
Buggy source:
@Override public final void run() throws ServiceRunException {
  try {
    getLogger().debug("String_Node_Str");
    mConfigurationsRevision=getConfigurations();
    processConfigurations();
  }
 catch (  RepositoryException tException) {
    throw new ServiceRunException("String_Node_Str",tException);
  }
  try {
    getLogger().debug("String_Node_Str");
    mConfigurationsRevision=checkPresentations();
    processPresentations();
  }
 catch (  RepositoryException tException) {
    throw new ServiceRunException("String_Node_Str",tException);
  }
  mSVNMonitor.schedule(new Monitor(),mSVNMonitorInterval * 1000,mSVNMonitorInterval * 1000);
}

Fixed version (ground truth):
@Override public final void run() throws ServiceRunException {
  try {
    getLogger().debug("String_Node_Str");
    mConnectionsRevision=getConnections();
    processConnections();
  }
 catch (  RepositoryException tException) {
    throw new ServiceRunException("String_Node_Str",tException);
  }
  try {
    getLogger().debug("String_Node_Str");
    mConfigurationsRevision=getConfigurations();
    processConfigurations();
  }
 catch (  RepositoryException tException) {
    throw new ServiceRunException("String_Node_Str",tException);
  }
  try {
    getLogger().debug("String_Node_Str");
    mConfigurationsRevision=checkPresentations();
    processPresentations();
  }
 catch (  RepositoryException tException) {
    throw new ServiceRunException("String_Node_Str",tException);
  }
  mSVNMonitor.schedule(new Monitor(),mSVNMonitorInterval * 1000,mSVNMonitorInterval * 1000);
}
Program: 184920
Project: 184920
Buggy source:
public RepositoryMonitor() throws ServiceSetupException {
  mSVNCheckoutRoot=new File(getConfiguration().getString("String_Node_Str"));
  if (!mSVNCheckoutRoot.exists() || !mSVNCheckoutRoot.canWrite())   throw new ServiceSetupException("String_Node_Str");
  Pattern tLocationPattern=Pattern.compile("String_Node_Str");
  mSVNLocation=getConfiguration().getString("String_Node_Str");
  Matcher tLocationMatcher=tLocationPattern.matcher(mSVNLocation);
  if (!tLocationMatcher.find()) {
    throw new ServiceSetupException("String_Node_Str" + mSVNLocation + "String_Node_Str");
  }
  Repository.getInstance().setServer(mSVNLocation);
  mSVNClient=new SVNClient();
  Integer tInterval=getConfiguration().getInt("String_Node_Str");
  if (tInterval <= 0) {
    throw new ServiceSetupException("String_Node_Str");
  }
  mSVNMonitorInterval=tInterval;
  getLogger().debug("String_Node_Str" + tInterval + "String_Node_Str");
  mSVNMonitor=new Timer();
}

Fixed version (ground truth):
public RepositoryMonitor() throws ServiceSetupException {
  mSVNCheckoutRoot=new File(getConfiguration().getString("String_Node_Str"));
  if (!mSVNCheckoutRoot.exists())   mSVNCheckoutRoot.mkdirs();
  if (!mSVNCheckoutRoot.exists() || !mSVNCheckoutRoot.canWrite())   throw new ServiceSetupException("String_Node_Str");
  Pattern tLocationPattern=Pattern.compile("String_Node_Str");
  mSVNLocation=getConfiguration().getString("String_Node_Str");
  Matcher tLocationMatcher=tLocationPattern.matcher(mSVNLocation);
  if (!tLocationMatcher.find()) {
    throw new ServiceSetupException("String_Node_Str" + mSVNLocation + "String_Node_Str");
  }
  Repository.getInstance().setServer(mSVNLocation);
  mSVNClient=new SVNClient();
  Integer tInterval=getConfiguration().getInt("String_Node_Str");
  if (tInterval <= 0) {
    throw new ServiceSetupException("String_Node_Str");
  }
  mSVNMonitorInterval=tInterval;
  getLogger().debug("String_Node_Str" + tInterval + "String_Node_Str");
  mSVNMonitor=new Timer();
}
Program: 184921
Project: 184921
Buggy source:
public Processor(final File iFile,final String iValidationFilename) throws RepositoryException {
  mLogger=Service.getLogger(this);
  if (iValidationFilename != null) {
    if (System.getProperty("String_Node_Str").equals("String_Node_Str")) {
      mLogger.warn("String_Node_Str");
    }
 else {
      try {
        String tSchemaLanguage="String_Node_Str";
        SchemaFactory tSchemaFactory=SchemaFactory.newInstance(tSchemaLanguage);
        Schema tSchema=tSchemaFactory.newSchema(this.getClass().getClassLoader().getResource("String_Node_Str"));
        Validator tValidator=tSchema.newValidator();
        tValidator.validate(new StreamSource(iValidationFilename));
      }
 catch (      SAXException tException) {
        throw new RepositoryException("String_Node_Str",tException);
      }
catch (      IOException tException) {
        throw new RepositoryException("String_Node_Str",tException);
      }
    }
  }
  try {
    if (PARSER_FACTORY == null) {
      PARSER_FACTORY=XmlPullParserFactory.newInstance();
      PARSER_FACTORY.setNamespaceAware(true);
      PARSER_FACTORY.setValidating(false);
    }
  }
 catch (  XmlPullParserException tException) {
    throw new RepositoryException("String_Node_Str",tException);
  }
  try {
    mParser=PARSER_FACTORY.newPullParser();
    mParser.setInput(new FileInputStream(iFile),null);
  }
 catch (  XmlPullParserException tException) {
    throw new RepositoryException("String_Node_Str",tException);
  }
catch (  FileNotFoundException tException) {
    throw new RepositoryException("String_Node_Str",tException);
  }
}

Fixed version (ground truth):
public Processor(final File iFile,final String iValidationFilename) throws RepositoryException {
  mLogger=Service.getLogger(this);
  if (iValidationFilename != null) {
    try {
      String tSchemaLanguage="String_Node_Str";
      SchemaFactory tSchemaFactory=SchemaFactory.newInstance(tSchemaLanguage);
      Schema tSchema=tSchemaFactory.newSchema(this.getClass().getClassLoader().getResource(iValidationFilename));
      Validator tValidator=tSchema.newValidator();
      tValidator.validate(new StreamSource(iFile));
    }
 catch (    SAXException tException) {
      throw new RepositoryException("String_Node_Str",tException);
    }
catch (    IOException tException) {
      throw new RepositoryException("String_Node_Str",tException);
    }
  }
  try {
    if (PARSER_FACTORY == null) {
      PARSER_FACTORY=XmlPullParserFactory.newInstance();
      PARSER_FACTORY.setNamespaceAware(true);
      PARSER_FACTORY.setValidating(false);
    }
  }
 catch (  XmlPullParserException tException) {
    throw new RepositoryException("String_Node_Str",tException);
  }
  try {
    mParser=PARSER_FACTORY.newPullParser();
    mParser.setInput(new FileInputStream(iFile),null);
  }
 catch (  XmlPullParserException tException) {
    throw new RepositoryException("String_Node_Str",tException);
  }
catch (  FileNotFoundException tException) {
    throw new RepositoryException("String_Node_Str",tException);
  }
}
Program: 184922
Project: 184922
Buggy source:
private static void stop(){
  for (  ServiceType tServiceType : mSubservices.keySet()) {
    Service tService=mSubservices.get(tServiceType);
    mLogger.debug("String_Node_Str" + mServiceNames.get(tServiceType));
    try {
      tService.stop();
      mSubservices.remove(tServiceType);
    }
 catch (    ServiceRunException e) {
      mLogger.error("String_Node_Str" + mServiceNames.get(tServiceType),e);
    }
  }
}

Fixed version (ground truth):
private static void stop(){
  for (  ServiceType tServiceType : SUBSERVICES.keySet()) {
    Service tService=SUBSERVICES.get(tServiceType);
    LOGGER.debug("String_Node_Str" + cServiceNames.get(tServiceType));
    try {
      tService.stop();
      SUBSERVICES.remove(tServiceType);
    }
 catch (    ServiceRunException tException) {
      LOGGER.error("String_Node_Str" + cServiceNames.get(tServiceType),tException);
    }
  }
}
Program: 184923
Project: 184923
Buggy source:
public static SignalHandler install(String signalName){
  mLogger.debug("String_Node_Str" + signalName);
  Signal diagSignal=new Signal(signalName);
  Main instance=new Main();
  instance.oldHandler=Signal.handle(diagSignal,instance);
  return instance;
}

Fixed version (ground truth):
public static SignalHandler install(final String iSignalName){
  LOGGER.debug("String_Node_Str" + iSignalName);
  Signal tSignal=new Signal(iSignalName);
  Main tInstance=new Main();
  tInstance.mOldHandler=Signal.handle(tSignal,tInstance);
  return tInstance;
}
Program: 184924
Project: 184924
Buggy source:
public void signalAction(Signal signal){
  mLogger.info("String_Node_Str" + signal.getName());
  if (mStatus == Status.RUNNING) {
    mLogger.info("String_Node_Str");
    mStatus=Status.STOPPING;
    stop();
    mLogger.info("String_Node_Str");
    mStatus=Status.IDLE;
    System.exit(0);
  }
 else   if (mStatus != Status.STOPPING) {
    mLogger.info("String_Node_Str");
    mStatus=Status.IDLE;
    System.exit(0);
  }
 else {
    mLogger.debug("String_Node_Str" + mStatus.name());
  }
}

Fixed version (ground truth):
public final void signalAction(final Signal iSignal){
  LOGGER.info("String_Node_Str" + iSignal.getName());
  if (STATUS == Status.RUNNING) {
    LOGGER.info("String_Node_Str");
    STATUS=Status.STOPPING;
    stop();
    LOGGER.info("String_Node_Str");
    STATUS=Status.IDLE;
    System.exit(0);
  }
 else   if (STATUS != Status.STOPPING) {
    LOGGER.info("String_Node_Str");
    STATUS=Status.IDLE;
    System.exit(0);
  }
 else {
    LOGGER.debug("String_Node_Str" + STATUS.name());
  }
}
Program: 184925
Project: 184925
Buggy source:
private static boolean start(){
  for (  ServiceType tServiceType : mSubservices.keySet()) {
    Service tService=mSubservices.get(tServiceType);
    mLogger.debug("String_Node_Str" + mServiceNames.get(tServiceType));
    try {
      tService.run();
    }
 catch (    ServiceRunException e) {
      mLogger.error("String_Node_Str" + mServiceNames.get(tServiceType),e);
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
private static boolean start(){
  for (  ServiceType tServiceType : SUBSERVICES.keySet()) {
    Service tService=SUBSERVICES.get(tServiceType);
    LOGGER.debug("String_Node_Str" + cServiceNames.get(tServiceType));
    try {
      tService.run();
    }
 catch (    ServiceRunException tException) {
      LOGGER.error("String_Node_Str" + cServiceNames.get(tServiceType),tException);
      return false;
    }
  }
  return true;
}
Program: 184926
Project: 184926
Buggy source:
@Override public void handle(Signal signal){
  mLogger.info("String_Node_Str" + signal.getName());
  try {
    signalAction(signal);
    if (oldHandler != SIG_DFL && oldHandler != SIG_IGN) {
      oldHandler.handle(signal);
    }
  }
 catch (  Exception e) {
    mLogger.error("String_Node_Str" + signal.getName() + "String_Node_Str",e);
  }
}

Fixed version (ground truth):
@Override public final void handle(final Signal iSignal){
  LOGGER.info("String_Node_Str" + iSignal.getName());
  try {
    signalAction(iSignal);
    if (mOldHandler != SIG_DFL && mOldHandler != SIG_IGN) {
      mOldHandler.handle(iSignal);
    }
  }
 catch (  Exception tException) {
    LOGGER.error("String_Node_Str" + iSignal.getName() + "String_Node_Str",tException);
  }
}