nus-yam/ex-repair huggingface dataset:
Program: 198643
Project: 198643
Buggy source:
@Override public void registerSink(IFusedLocationHardwareSink eventSink){
synchronized (mLocationSinkLock) {
    if (mLocationSink != null) {
      throw new RuntimeException("String_Node_Str");
    }
    mLocationSink=eventSink;
  }
}

Fixed version (ground truth):
@Override public void registerSink(IFusedLocationHardwareSink eventSink){
synchronized (mLocationSinkLock) {
    if (mLocationSink != null) {
      Log.e(TAG,"String_Node_Str");
    }
    mLocationSink=eventSink;
  }
}
Program: 198644
Project: 198644
Buggy source:
@Override public void registerSink(IFusedLocationHardwareSink eventSink){
synchronized (mLocationSinkLock) {
    if (mLocationSink != null) {
      throw new RuntimeException("String_Node_Str");
    }
    mLocationSink=eventSink;
  }
}

Fixed version (ground truth):
@Override public void registerSink(IFusedLocationHardwareSink eventSink){
synchronized (mLocationSinkLock) {
    if (mLocationSink != null) {
      Log.e(TAG,"String_Node_Str");
    }
    mLocationSink=eventSink;
  }
}
Program: 198645
Project: 198645
Buggy source:
@Override public void registerSink(IFusedLocationHardwareSink eventSink){
synchronized (mLocationSinkLock) {
    if (mLocationSink != null) {
      throw new RuntimeException("String_Node_Str");
    }
    mLocationSink=eventSink;
  }
}

Fixed version (ground truth):
@Override public void registerSink(IFusedLocationHardwareSink eventSink){
synchronized (mLocationSinkLock) {
    if (mLocationSink != null) {
      Log.e(TAG,"String_Node_Str");
    }
    mLocationSink=eventSink;
  }
}
Program: 198646
Project: 198646
Buggy source:
@Override @ServiceThreadOnly protected void disableDevice(boolean initiatedByCec,PendingActionClearedCallback callback){
  super.disableDevice(initiatedByCec,callback);
  assertRunOnServiceThread();
  removeAction(DeviceDiscoveryAction.class);
  removeAction(HotplugDetectionAction.class);
  removeAction(OneTouchRecordAction.class);
  disableSystemAudioIfExist();
  disableArcIfExist();
  clearDeviceInfoList();
  checkIfPendingActionsCleared();
}

Fixed version (ground truth):
@Override @ServiceThreadOnly protected void disableDevice(boolean initiatedByCec,PendingActionClearedCallback callback){
  super.disableDevice(initiatedByCec,callback);
  assertRunOnServiceThread();
  removeAction(DeviceDiscoveryAction.class);
  removeAction(HotplugDetectionAction.class);
  removeAction(OneTouchRecordAction.class);
  removeAction(TimerRecordingAction.class);
  disableSystemAudioIfExist();
  disableArcIfExist();
  clearDeviceInfoList();
  checkIfPendingActionsCleared();
}
Program: 198647
Project: 198647
Buggy source:
private void sendClearTimerMessage(int recorderAddress,int sourceType,byte[] recordSource){
  HdmiCecMessage message=null;
switch (sourceType) {
case TIMER_RECORDING_TYPE_DIGITAL:
    message=HdmiCecMessageBuilder.buildClearDigitalTimer(mAddress,recorderAddress,recordSource);
  break;
case TIMER_RECORDING_TYPE_ANALOGUE:
message=HdmiCecMessageBuilder.buildClearAnalogueTimer(mAddress,recorderAddress,recordSource);
break;
case TIMER_RECORDING_TYPE_EXTERNAL:
message=HdmiCecMessageBuilder.buildClearExternalTimer(mAddress,recorderAddress,recordSource);
break;
default :
Slog.w(TAG,"String_Node_Str" + recorderAddress);
announceTimerRecordingResult(CLEAR_TIMER_STATUS_FAIL_TO_CLEAR_SELECTED_SOURCE);
return;
}
mService.sendCecCommand(message,new SendMessageCallback(){
@Override public void onSendCompleted(int error){
if (error != Constants.SEND_RESULT_SUCCESS) {
announceTimerRecordingResult(CLEAR_TIMER_STATUS_FAIL_TO_CLEAR_SELECTED_SOURCE);
}
}
}
);
}

Fixed version (ground truth):
private void sendClearTimerMessage(int recorderAddress,int sourceType,byte[] recordSource){
  HdmiCecMessage message=null;
switch (sourceType) {
case TIMER_RECORDING_TYPE_DIGITAL:
    message=HdmiCecMessageBuilder.buildClearDigitalTimer(mAddress,recorderAddress,recordSource);
  break;
case TIMER_RECORDING_TYPE_ANALOGUE:
message=HdmiCecMessageBuilder.buildClearAnalogueTimer(mAddress,recorderAddress,recordSource);
break;
case TIMER_RECORDING_TYPE_EXTERNAL:
message=HdmiCecMessageBuilder.buildClearExternalTimer(mAddress,recorderAddress,recordSource);
break;
default :
Slog.w(TAG,"String_Node_Str" + recorderAddress);
announceClearTimerRecordingResult(CLEAR_TIMER_STATUS_FAIL_TO_CLEAR_SELECTED_SOURCE);
return;
}
mService.sendCecCommand(message,new SendMessageCallback(){
@Override public void onSendCompleted(int error){
if (error != Constants.SEND_RESULT_SUCCESS) {
announceClearTimerRecordingResult(CLEAR_TIMER_STATUS_FAIL_TO_CLEAR_SELECTED_SOURCE);
}
}
}
);
}
Program: 198648
Project: 198648
Buggy source:
@Override public void onSendCompleted(int error){
  if (error != Constants.SEND_RESULT_SUCCESS) {
    announceTimerRecordingResult(CLEAR_TIMER_STATUS_FAIL_TO_CLEAR_SELECTED_SOURCE);
  }
}

Fixed version (ground truth):
@Override public void onSendCompleted(int error){
  if (error != Constants.SEND_RESULT_SUCCESS) {
    announceClearTimerRecordingResult(CLEAR_TIMER_STATUS_FAIL_TO_CLEAR_SELECTED_SOURCE);
  }
}
Program: 198649
Project: 198649
Buggy source:
@ServiceThreadOnly void clearTimerRecording(int recorderAddress,int sourceType,byte[] recordSource){
  assertRunOnServiceThread();
  if (!mService.isControlEnabled()) {
    Slog.w(TAG,"String_Node_Str");
    announceTimerRecordingResult(CLEAR_TIMER_STATUS_CEC_DISABLE);
    return;
  }
  if (!checkRecorder(recorderAddress)) {
    Slog.w(TAG,"String_Node_Str" + recorderAddress);
    announceTimerRecordingResult(CLEAR_TIMER_STATUS_CHECK_RECORDER_CONNECTION);
    return;
  }
  if (!checkTimerRecordingSource(sourceType,recordSource)) {
    Slog.w(TAG,"String_Node_Str" + Arrays.toString(recordSource));
    announceTimerRecordingResult(CLEAR_TIMER_STATUS_FAIL_TO_CLEAR_SELECTED_SOURCE);
    return;
  }
  sendClearTimerMessage(recorderAddress,sourceType,recordSource);
}

Fixed version (ground truth):
@ServiceThreadOnly void clearTimerRecording(int recorderAddress,int sourceType,byte[] recordSource){
  assertRunOnServiceThread();
  if (!mService.isControlEnabled()) {
    Slog.w(TAG,"String_Node_Str");
    announceClearTimerRecordingResult(CLEAR_TIMER_STATUS_CEC_DISABLE);
    return;
  }
  if (!checkRecorder(recorderAddress)) {
    Slog.w(TAG,"String_Node_Str" + recorderAddress);
    announceClearTimerRecordingResult(CLEAR_TIMER_STATUS_CHECK_RECORDER_CONNECTION);
    return;
  }
  if (!checkTimerRecordingSource(sourceType,recordSource)) {
    Slog.w(TAG,"String_Node_Str" + Arrays.toString(recordSource));
    announceClearTimerRecordingResult(CLEAR_TIMER_STATUS_FAIL_TO_CLEAR_SELECTED_SOURCE);
    return;
  }
  sendClearTimerMessage(recorderAddress,sourceType,recordSource);
}
Program: 198650
Project: 198650
Buggy source:
private void sendTimerMessage(){
  HdmiCecMessage message=null;
switch (mSourceType) {
case TIMER_RECORDING_TYPE_DIGITAL:
    message=HdmiCecMessageBuilder.buildSetDigitalTimer(getSourceAddress(),mRecorderAddress,mRecordSource);
  break;
case TIMER_RECORDING_TYPE_ANALOGUE:
message=HdmiCecMessageBuilder.buildSetAnalogueTimer(getSourceAddress(),mRecorderAddress,mRecordSource);
break;
case TIMER_RECORDING_TYPE_EXTERNAL:
message=HdmiCecMessageBuilder.buildSetExternalTimer(getSourceAddress(),mRecorderAddress,mRecordSource);
break;
default :
tv().announceTimerRecordingResult(TIMER_RECORDING_RESULT_EXTRA_FAIL_TO_RECORD_SELECTED_SOURCE);
finish();
return;
}
sendCommand(message,new SendMessageCallback(){
@Override public void onSendCompleted(int error){
if (error != Constants.SEND_RESULT_SUCCESS) {
mState=STATE_WAITING_FOR_TIMER_STATUS;
addTimer(mState,TIMER_STATUS_TIMEOUT_MS);
finish();
return;
}
}
}
);
}

Fixed version (ground truth):
private void sendTimerMessage(){
  HdmiCecMessage message=null;
switch (mSourceType) {
case TIMER_RECORDING_TYPE_DIGITAL:
    message=HdmiCecMessageBuilder.buildSetDigitalTimer(getSourceAddress(),mRecorderAddress,mRecordSource);
  break;
case TIMER_RECORDING_TYPE_ANALOGUE:
message=HdmiCecMessageBuilder.buildSetAnalogueTimer(getSourceAddress(),mRecorderAddress,mRecordSource);
break;
case TIMER_RECORDING_TYPE_EXTERNAL:
message=HdmiCecMessageBuilder.buildSetExternalTimer(getSourceAddress(),mRecorderAddress,mRecordSource);
break;
default :
tv().announceTimerRecordingResult(TIMER_RECORDING_RESULT_EXTRA_FAIL_TO_RECORD_SELECTED_SOURCE);
finish();
return;
}
sendCommand(message,new SendMessageCallback(){
@Override public void onSendCompleted(int error){
if (error != Constants.SEND_RESULT_SUCCESS) {
tv().announceTimerRecordingResult(TIMER_RECORDING_RESULT_EXTRA_CHECK_RECORDER_CONNECTION);
finish();
return;
}
mState=STATE_WAITING_FOR_TIMER_STATUS;
addTimer(mState,TIMER_STATUS_TIMEOUT_MS);
}
}
);
}
Program: 198651
Project: 198651
Buggy source:
private boolean handleFeatureAbort(HdmiCecMessage cmd){
  byte[] params=cmd.getParams();
  int messageType=params[0];
switch (messageType) {
case Constants.MESSAGE_SET_DIGITAL_TIMER:
case Constants.MESSAGE_SET_ANALOG_TIMER:
case Constants.MESSAGE_SET_EXTERNAL_TIMER:
    break;
default :
  return false;
}
int reason=params[1];
Slog.i(TAG,"String_Node_Str" + messageType + "String_Node_Str"+ reason);
tv().announceTimerRecordingResult(TIMER_RECORDING_RESULT_EXTRA_CHECK_RECORDER_CONNECTION);
finish();
return true;
}

Fixed version (ground truth):
private boolean handleFeatureAbort(HdmiCecMessage cmd){
  byte[] params=cmd.getParams();
  int messageType=params[0] & 0xFF;
switch (messageType) {
case Constants.MESSAGE_SET_DIGITAL_TIMER:
case Constants.MESSAGE_SET_ANALOG_TIMER:
case Constants.MESSAGE_SET_EXTERNAL_TIMER:
    break;
default :
  return false;
}
int reason=params[1] & 0xFF;
Slog.i(TAG,"String_Node_Str" + messageType + "String_Node_Str"+ reason);
tv().announceTimerRecordingResult(TIMER_RECORDING_RESULT_EXTRA_CHECK_RECORDER_CONNECTION);
finish();
return true;
}
Program: 198652
Project: 198652
Buggy source:
@Override public void onSendCompleted(int error){
  if (error != Constants.SEND_RESULT_SUCCESS) {
    mState=STATE_WAITING_FOR_TIMER_STATUS;
    addTimer(mState,TIMER_STATUS_TIMEOUT_MS);
    finish();
    return;
  }
}

Fixed version (ground truth):
@Override public void onSendCompleted(int error){
  if (error != Constants.SEND_RESULT_SUCCESS) {
    tv().announceTimerRecordingResult(TIMER_RECORDING_RESULT_EXTRA_CHECK_RECORDER_CONNECTION);
    finish();
    return;
  }
  mState=STATE_WAITING_FOR_TIMER_STATUS;
  addTimer(mState,TIMER_STATUS_TIMEOUT_MS);
}
Program: 198653
Project: 198653
Buggy source:
@Override @ServiceThreadOnly protected void disableDevice(boolean initiatedByCec,PendingActionClearedCallback callback){
  super.disableDevice(initiatedByCec,callback);
  assertRunOnServiceThread();
  removeAction(DeviceDiscoveryAction.class);
  removeAction(HotplugDetectionAction.class);
  removeAction(OneTouchRecordAction.class);
  disableSystemAudioIfExist();
  disableArcIfExist();
  clearDeviceInfoList();
  checkIfPendingActionsCleared();
}

Fixed version (ground truth):
@Override @ServiceThreadOnly protected void disableDevice(boolean initiatedByCec,PendingActionClearedCallback callback){
  super.disableDevice(initiatedByCec,callback);
  assertRunOnServiceThread();
  removeAction(DeviceDiscoveryAction.class);
  removeAction(HotplugDetectionAction.class);
  removeAction(OneTouchRecordAction.class);
  removeAction(TimerRecordingAction.class);
  disableSystemAudioIfExist();
  disableArcIfExist();
  clearDeviceInfoList();
  checkIfPendingActionsCleared();
}
Program: 198654
Project: 198654
Buggy source:
private void sendClearTimerMessage(int recorderAddress,int sourceType,byte[] recordSource){
  HdmiCecMessage message=null;
switch (sourceType) {
case TIMER_RECORDING_TYPE_DIGITAL:
    message=HdmiCecMessageBuilder.buildClearDigitalTimer(mAddress,recorderAddress,recordSource);
  break;
case TIMER_RECORDING_TYPE_ANALOGUE:
message=HdmiCecMessageBuilder.buildClearAnalogueTimer(mAddress,recorderAddress,recordSource);
break;
case TIMER_RECORDING_TYPE_EXTERNAL:
message=HdmiCecMessageBuilder.buildClearExternalTimer(mAddress,recorderAddress,recordSource);
break;
default :
Slog.w(TAG,"String_Node_Str" + recorderAddress);
announceTimerRecordingResult(CLEAR_TIMER_STATUS_FAIL_TO_CLEAR_SELECTED_SOURCE);
return;
}
mService.sendCecCommand(message,new SendMessageCallback(){
@Override public void onSendCompleted(int error){
if (error != Constants.SEND_RESULT_SUCCESS) {
announceTimerRecordingResult(CLEAR_TIMER_STATUS_FAIL_TO_CLEAR_SELECTED_SOURCE);
}
}
}
);
}

Fixed version (ground truth):
private void sendClearTimerMessage(int recorderAddress,int sourceType,byte[] recordSource){
  HdmiCecMessage message=null;
switch (sourceType) {
case TIMER_RECORDING_TYPE_DIGITAL:
    message=HdmiCecMessageBuilder.buildClearDigitalTimer(mAddress,recorderAddress,recordSource);
  break;
case TIMER_RECORDING_TYPE_ANALOGUE:
message=HdmiCecMessageBuilder.buildClearAnalogueTimer(mAddress,recorderAddress,recordSource);
break;
case TIMER_RECORDING_TYPE_EXTERNAL:
message=HdmiCecMessageBuilder.buildClearExternalTimer(mAddress,recorderAddress,recordSource);
break;
default :
Slog.w(TAG,"String_Node_Str" + recorderAddress);
announceClearTimerRecordingResult(CLEAR_TIMER_STATUS_FAIL_TO_CLEAR_SELECTED_SOURCE);
return;
}
mService.sendCecCommand(message,new SendMessageCallback(){
@Override public void onSendCompleted(int error){
if (error != Constants.SEND_RESULT_SUCCESS) {
announceClearTimerRecordingResult(CLEAR_TIMER_STATUS_FAIL_TO_CLEAR_SELECTED_SOURCE);
}
}
}
);
}
Program: 198655
Project: 198655
Buggy source:
@Override public void onSendCompleted(int error){
  if (error != Constants.SEND_RESULT_SUCCESS) {
    announceTimerRecordingResult(CLEAR_TIMER_STATUS_FAIL_TO_CLEAR_SELECTED_SOURCE);
  }
}

Fixed version (ground truth):
@Override public void onSendCompleted(int error){
  if (error != Constants.SEND_RESULT_SUCCESS) {
    announceClearTimerRecordingResult(CLEAR_TIMER_STATUS_FAIL_TO_CLEAR_SELECTED_SOURCE);
  }
}
Program: 198656
Project: 198656
Buggy source:
@ServiceThreadOnly void clearTimerRecording(int recorderAddress,int sourceType,byte[] recordSource){
  assertRunOnServiceThread();
  if (!mService.isControlEnabled()) {
    Slog.w(TAG,"String_Node_Str");
    announceTimerRecordingResult(CLEAR_TIMER_STATUS_CEC_DISABLE);
    return;
  }
  if (!checkRecorder(recorderAddress)) {
    Slog.w(TAG,"String_Node_Str" + recorderAddress);
    announceTimerRecordingResult(CLEAR_TIMER_STATUS_CHECK_RECORDER_CONNECTION);
    return;
  }
  if (!checkTimerRecordingSource(sourceType,recordSource)) {
    Slog.w(TAG,"String_Node_Str" + Arrays.toString(recordSource));
    announceTimerRecordingResult(CLEAR_TIMER_STATUS_FAIL_TO_CLEAR_SELECTED_SOURCE);
    return;
  }
  sendClearTimerMessage(recorderAddress,sourceType,recordSource);
}

Fixed version (ground truth):
@ServiceThreadOnly void clearTimerRecording(int recorderAddress,int sourceType,byte[] recordSource){
  assertRunOnServiceThread();
  if (!mService.isControlEnabled()) {
    Slog.w(TAG,"String_Node_Str");
    announceClearTimerRecordingResult(CLEAR_TIMER_STATUS_CEC_DISABLE);
    return;
  }
  if (!checkRecorder(recorderAddress)) {
    Slog.w(TAG,"String_Node_Str" + recorderAddress);
    announceClearTimerRecordingResult(CLEAR_TIMER_STATUS_CHECK_RECORDER_CONNECTION);
    return;
  }
  if (!checkTimerRecordingSource(sourceType,recordSource)) {
    Slog.w(TAG,"String_Node_Str" + Arrays.toString(recordSource));
    announceClearTimerRecordingResult(CLEAR_TIMER_STATUS_FAIL_TO_CLEAR_SELECTED_SOURCE);
    return;
  }
  sendClearTimerMessage(recorderAddress,sourceType,recordSource);
}
Program: 198657
Project: 198657
Buggy source:
private void sendTimerMessage(){
  HdmiCecMessage message=null;
switch (mSourceType) {
case TIMER_RECORDING_TYPE_DIGITAL:
    message=HdmiCecMessageBuilder.buildSetDigitalTimer(getSourceAddress(),mRecorderAddress,mRecordSource);
  break;
case TIMER_RECORDING_TYPE_ANALOGUE:
message=HdmiCecMessageBuilder.buildSetAnalogueTimer(getSourceAddress(),mRecorderAddress,mRecordSource);
break;
case TIMER_RECORDING_TYPE_EXTERNAL:
message=HdmiCecMessageBuilder.buildSetExternalTimer(getSourceAddress(),mRecorderAddress,mRecordSource);
break;
default :
tv().announceTimerRecordingResult(TIMER_RECORDING_RESULT_EXTRA_FAIL_TO_RECORD_SELECTED_SOURCE);
finish();
return;
}
sendCommand(message,new SendMessageCallback(){
@Override public void onSendCompleted(int error){
if (error != Constants.SEND_RESULT_SUCCESS) {
mState=STATE_WAITING_FOR_TIMER_STATUS;
addTimer(mState,TIMER_STATUS_TIMEOUT_MS);
finish();
return;
}
}
}
);
}

Fixed version (ground truth):
private void sendTimerMessage(){
  HdmiCecMessage message=null;
switch (mSourceType) {
case TIMER_RECORDING_TYPE_DIGITAL:
    message=HdmiCecMessageBuilder.buildSetDigitalTimer(getSourceAddress(),mRecorderAddress,mRecordSource);
  break;
case TIMER_RECORDING_TYPE_ANALOGUE:
message=HdmiCecMessageBuilder.buildSetAnalogueTimer(getSourceAddress(),mRecorderAddress,mRecordSource);
break;
case TIMER_RECORDING_TYPE_EXTERNAL:
message=HdmiCecMessageBuilder.buildSetExternalTimer(getSourceAddress(),mRecorderAddress,mRecordSource);
break;
default :
tv().announceTimerRecordingResult(TIMER_RECORDING_RESULT_EXTRA_FAIL_TO_RECORD_SELECTED_SOURCE);
finish();
return;
}
sendCommand(message,new SendMessageCallback(){
@Override public void onSendCompleted(int error){
if (error != Constants.SEND_RESULT_SUCCESS) {
tv().announceTimerRecordingResult(TIMER_RECORDING_RESULT_EXTRA_CHECK_RECORDER_CONNECTION);
finish();
return;
}
mState=STATE_WAITING_FOR_TIMER_STATUS;
addTimer(mState,TIMER_STATUS_TIMEOUT_MS);
}
}
);
}
Program: 198658
Project: 198658
Buggy source:
private boolean handleFeatureAbort(HdmiCecMessage cmd){
  byte[] params=cmd.getParams();
  int messageType=params[0];
switch (messageType) {
case Constants.MESSAGE_SET_DIGITAL_TIMER:
case Constants.MESSAGE_SET_ANALOG_TIMER:
case Constants.MESSAGE_SET_EXTERNAL_TIMER:
    break;
default :
  return false;
}
int reason=params[1];
Slog.i(TAG,"String_Node_Str" + messageType + "String_Node_Str"+ reason);
tv().announceTimerRecordingResult(TIMER_RECORDING_RESULT_EXTRA_CHECK_RECORDER_CONNECTION);
finish();
return true;
}

Fixed version (ground truth):
private boolean handleFeatureAbort(HdmiCecMessage cmd){
  byte[] params=cmd.getParams();
  int messageType=params[0] & 0xFF;
switch (messageType) {
case Constants.MESSAGE_SET_DIGITAL_TIMER:
case Constants.MESSAGE_SET_ANALOG_TIMER:
case Constants.MESSAGE_SET_EXTERNAL_TIMER:
    break;
default :
  return false;
}
int reason=params[1] & 0xFF;
Slog.i(TAG,"String_Node_Str" + messageType + "String_Node_Str"+ reason);
tv().announceTimerRecordingResult(TIMER_RECORDING_RESULT_EXTRA_CHECK_RECORDER_CONNECTION);
finish();
return true;
}
Program: 198659
Project: 198659
Buggy source:
@Override public void onSendCompleted(int error){
  if (error != Constants.SEND_RESULT_SUCCESS) {
    mState=STATE_WAITING_FOR_TIMER_STATUS;
    addTimer(mState,TIMER_STATUS_TIMEOUT_MS);
    finish();
    return;
  }
}

Fixed version (ground truth):
@Override public void onSendCompleted(int error){
  if (error != Constants.SEND_RESULT_SUCCESS) {
    tv().announceTimerRecordingResult(TIMER_RECORDING_RESULT_EXTRA_CHECK_RECORDER_CONNECTION);
    finish();
    return;
  }
  mState=STATE_WAITING_FOR_TIMER_STATUS;
  addTimer(mState,TIMER_STATUS_TIMEOUT_MS);
}
Program: 198660
Project: 198660
Buggy source:
@Override @ServiceThreadOnly protected void disableDevice(boolean initiatedByCec,PendingActionClearedCallback callback){
  super.disableDevice(initiatedByCec,callback);
  assertRunOnServiceThread();
  removeAction(DeviceDiscoveryAction.class);
  removeAction(HotplugDetectionAction.class);
  removeAction(OneTouchRecordAction.class);
  disableSystemAudioIfExist();
  disableArcIfExist();
  clearDeviceInfoList();
  checkIfPendingActionsCleared();
}

Fixed version (ground truth):
@Override @ServiceThreadOnly protected void disableDevice(boolean initiatedByCec,PendingActionClearedCallback callback){
  super.disableDevice(initiatedByCec,callback);
  assertRunOnServiceThread();
  removeAction(DeviceDiscoveryAction.class);
  removeAction(HotplugDetectionAction.class);
  removeAction(OneTouchRecordAction.class);
  removeAction(TimerRecordingAction.class);
  disableSystemAudioIfExist();
  disableArcIfExist();
  clearDeviceInfoList();
  checkIfPendingActionsCleared();
}
Program: 198661
Project: 198661
Buggy source:
private void sendClearTimerMessage(int recorderAddress,int sourceType,byte[] recordSource){
  HdmiCecMessage message=null;
switch (sourceType) {
case TIMER_RECORDING_TYPE_DIGITAL:
    message=HdmiCecMessageBuilder.buildClearDigitalTimer(mAddress,recorderAddress,recordSource);
  break;
case TIMER_RECORDING_TYPE_ANALOGUE:
message=HdmiCecMessageBuilder.buildClearAnalogueTimer(mAddress,recorderAddress,recordSource);
break;
case TIMER_RECORDING_TYPE_EXTERNAL:
message=HdmiCecMessageBuilder.buildClearExternalTimer(mAddress,recorderAddress,recordSource);
break;
default :
Slog.w(TAG,"String_Node_Str" + recorderAddress);
announceTimerRecordingResult(CLEAR_TIMER_STATUS_FAIL_TO_CLEAR_SELECTED_SOURCE);
return;
}
mService.sendCecCommand(message,new SendMessageCallback(){
@Override public void onSendCompleted(int error){
if (error != Constants.SEND_RESULT_SUCCESS) {
announceTimerRecordingResult(CLEAR_TIMER_STATUS_FAIL_TO_CLEAR_SELECTED_SOURCE);
}
}
}
);
}

Fixed version (ground truth):
private void sendClearTimerMessage(int recorderAddress,int sourceType,byte[] recordSource){
  HdmiCecMessage message=null;
switch (sourceType) {
case TIMER_RECORDING_TYPE_DIGITAL:
    message=HdmiCecMessageBuilder.buildClearDigitalTimer(mAddress,recorderAddress,recordSource);
  break;
case TIMER_RECORDING_TYPE_ANALOGUE:
message=HdmiCecMessageBuilder.buildClearAnalogueTimer(mAddress,recorderAddress,recordSource);
break;
case TIMER_RECORDING_TYPE_EXTERNAL:
message=HdmiCecMessageBuilder.buildClearExternalTimer(mAddress,recorderAddress,recordSource);
break;
default :
Slog.w(TAG,"String_Node_Str" + recorderAddress);
announceClearTimerRecordingResult(CLEAR_TIMER_STATUS_FAIL_TO_CLEAR_SELECTED_SOURCE);
return;
}
mService.sendCecCommand(message,new SendMessageCallback(){
@Override public void onSendCompleted(int error){
if (error != Constants.SEND_RESULT_SUCCESS) {
announceClearTimerRecordingResult(CLEAR_TIMER_STATUS_FAIL_TO_CLEAR_SELECTED_SOURCE);
}
}
}
);
}
Program: 198662
Project: 198662
Buggy source:
@Override public void onSendCompleted(int error){
  if (error != Constants.SEND_RESULT_SUCCESS) {
    announceTimerRecordingResult(CLEAR_TIMER_STATUS_FAIL_TO_CLEAR_SELECTED_SOURCE);
  }
}

Fixed version (ground truth):
@Override public void onSendCompleted(int error){
  if (error != Constants.SEND_RESULT_SUCCESS) {
    announceClearTimerRecordingResult(CLEAR_TIMER_STATUS_FAIL_TO_CLEAR_SELECTED_SOURCE);
  }
}
Program: 198663
Project: 198663
Buggy source:
@ServiceThreadOnly void clearTimerRecording(int recorderAddress,int sourceType,byte[] recordSource){
  assertRunOnServiceThread();
  if (!mService.isControlEnabled()) {
    Slog.w(TAG,"String_Node_Str");
    announceTimerRecordingResult(CLEAR_TIMER_STATUS_CEC_DISABLE);
    return;
  }
  if (!checkRecorder(recorderAddress)) {
    Slog.w(TAG,"String_Node_Str" + recorderAddress);
    announceTimerRecordingResult(CLEAR_TIMER_STATUS_CHECK_RECORDER_CONNECTION);
    return;
  }
  if (!checkTimerRecordingSource(sourceType,recordSource)) {
    Slog.w(TAG,"String_Node_Str" + Arrays.toString(recordSource));
    announceTimerRecordingResult(CLEAR_TIMER_STATUS_FAIL_TO_CLEAR_SELECTED_SOURCE);
    return;
  }
  sendClearTimerMessage(recorderAddress,sourceType,recordSource);
}

Fixed version (ground truth):
@ServiceThreadOnly void clearTimerRecording(int recorderAddress,int sourceType,byte[] recordSource){
  assertRunOnServiceThread();
  if (!mService.isControlEnabled()) {
    Slog.w(TAG,"String_Node_Str");
    announceClearTimerRecordingResult(CLEAR_TIMER_STATUS_CEC_DISABLE);
    return;
  }
  if (!checkRecorder(recorderAddress)) {
    Slog.w(TAG,"String_Node_Str" + recorderAddress);
    announceClearTimerRecordingResult(CLEAR_TIMER_STATUS_CHECK_RECORDER_CONNECTION);
    return;
  }
  if (!checkTimerRecordingSource(sourceType,recordSource)) {
    Slog.w(TAG,"String_Node_Str" + Arrays.toString(recordSource));
    announceClearTimerRecordingResult(CLEAR_TIMER_STATUS_FAIL_TO_CLEAR_SELECTED_SOURCE);
    return;
  }
  sendClearTimerMessage(recorderAddress,sourceType,recordSource);
}
Program: 198664
Project: 198664
Buggy source:
private void sendTimerMessage(){
  HdmiCecMessage message=null;
switch (mSourceType) {
case TIMER_RECORDING_TYPE_DIGITAL:
    message=HdmiCecMessageBuilder.buildSetDigitalTimer(getSourceAddress(),mRecorderAddress,mRecordSource);
  break;
case TIMER_RECORDING_TYPE_ANALOGUE:
message=HdmiCecMessageBuilder.buildSetAnalogueTimer(getSourceAddress(),mRecorderAddress,mRecordSource);
break;
case TIMER_RECORDING_TYPE_EXTERNAL:
message=HdmiCecMessageBuilder.buildSetExternalTimer(getSourceAddress(),mRecorderAddress,mRecordSource);
break;
default :
tv().announceTimerRecordingResult(TIMER_RECORDING_RESULT_EXTRA_FAIL_TO_RECORD_SELECTED_SOURCE);
finish();
return;
}
sendCommand(message,new SendMessageCallback(){
@Override public void onSendCompleted(int error){
if (error != Constants.SEND_RESULT_SUCCESS) {
mState=STATE_WAITING_FOR_TIMER_STATUS;
addTimer(mState,TIMER_STATUS_TIMEOUT_MS);
finish();
return;
}
}
}
);
}

Fixed version (ground truth):
private void sendTimerMessage(){
  HdmiCecMessage message=null;
switch (mSourceType) {
case TIMER_RECORDING_TYPE_DIGITAL:
    message=HdmiCecMessageBuilder.buildSetDigitalTimer(getSourceAddress(),mRecorderAddress,mRecordSource);
  break;
case TIMER_RECORDING_TYPE_ANALOGUE:
message=HdmiCecMessageBuilder.buildSetAnalogueTimer(getSourceAddress(),mRecorderAddress,mRecordSource);
break;
case TIMER_RECORDING_TYPE_EXTERNAL:
message=HdmiCecMessageBuilder.buildSetExternalTimer(getSourceAddress(),mRecorderAddress,mRecordSource);
break;
default :
tv().announceTimerRecordingResult(TIMER_RECORDING_RESULT_EXTRA_FAIL_TO_RECORD_SELECTED_SOURCE);
finish();
return;
}
sendCommand(message,new SendMessageCallback(){
@Override public void onSendCompleted(int error){
if (error != Constants.SEND_RESULT_SUCCESS) {
tv().announceTimerRecordingResult(TIMER_RECORDING_RESULT_EXTRA_CHECK_RECORDER_CONNECTION);
finish();
return;
}
mState=STATE_WAITING_FOR_TIMER_STATUS;
addTimer(mState,TIMER_STATUS_TIMEOUT_MS);
}
}
);
}
Program: 198665
Project: 198665
Buggy source:
private boolean handleFeatureAbort(HdmiCecMessage cmd){
  byte[] params=cmd.getParams();
  int messageType=params[0];
switch (messageType) {
case Constants.MESSAGE_SET_DIGITAL_TIMER:
case Constants.MESSAGE_SET_ANALOG_TIMER:
case Constants.MESSAGE_SET_EXTERNAL_TIMER:
    break;
default :
  return false;
}
int reason=params[1];
Slog.i(TAG,"String_Node_Str" + messageType + "String_Node_Str"+ reason);
tv().announceTimerRecordingResult(TIMER_RECORDING_RESULT_EXTRA_CHECK_RECORDER_CONNECTION);
finish();
return true;
}

Fixed version (ground truth):
private boolean handleFeatureAbort(HdmiCecMessage cmd){
  byte[] params=cmd.getParams();
  int messageType=params[0] & 0xFF;
switch (messageType) {
case Constants.MESSAGE_SET_DIGITAL_TIMER:
case Constants.MESSAGE_SET_ANALOG_TIMER:
case Constants.MESSAGE_SET_EXTERNAL_TIMER:
    break;
default :
  return false;
}
int reason=params[1] & 0xFF;
Slog.i(TAG,"String_Node_Str" + messageType + "String_Node_Str"+ reason);
tv().announceTimerRecordingResult(TIMER_RECORDING_RESULT_EXTRA_CHECK_RECORDER_CONNECTION);
finish();
return true;
}
Program: 198666
Project: 198666
Buggy source:
@Override public void onSendCompleted(int error){
  if (error != Constants.SEND_RESULT_SUCCESS) {
    mState=STATE_WAITING_FOR_TIMER_STATUS;
    addTimer(mState,TIMER_STATUS_TIMEOUT_MS);
    finish();
    return;
  }
}

Fixed version (ground truth):
@Override public void onSendCompleted(int error){
  if (error != Constants.SEND_RESULT_SUCCESS) {
    tv().announceTimerRecordingResult(TIMER_RECORDING_RESULT_EXTRA_CHECK_RECORDER_CONNECTION);
    finish();
    return;
  }
  mState=STATE_WAITING_FOR_TIMER_STATUS;
  addTimer(mState,TIMER_STATUS_TIMEOUT_MS);
}
Program: 198667
Project: 198667
Buggy source:
@Override @ServiceThreadOnly protected void disableDevice(boolean initiatedByCec,PendingActionClearedCallback callback){
  super.disableDevice(initiatedByCec,callback);
  assertRunOnServiceThread();
  removeAction(DeviceDiscoveryAction.class);
  removeAction(HotplugDetectionAction.class);
  removeAction(OneTouchRecordAction.class);
  disableSystemAudioIfExist();
  disableArcIfExist();
  clearDeviceInfoList();
  checkIfPendingActionsCleared();
}

Fixed version (ground truth):
@Override @ServiceThreadOnly protected void disableDevice(boolean initiatedByCec,PendingActionClearedCallback callback){
  super.disableDevice(initiatedByCec,callback);
  assertRunOnServiceThread();
  removeAction(DeviceDiscoveryAction.class);
  removeAction(HotplugDetectionAction.class);
  removeAction(OneTouchRecordAction.class);
  removeAction(TimerRecordingAction.class);
  disableSystemAudioIfExist();
  disableArcIfExist();
  clearDeviceInfoList();
  checkIfPendingActionsCleared();
}
Program: 198668
Project: 198668
Buggy source:
private void sendClearTimerMessage(int recorderAddress,int sourceType,byte[] recordSource){
  HdmiCecMessage message=null;
switch (sourceType) {
case TIMER_RECORDING_TYPE_DIGITAL:
    message=HdmiCecMessageBuilder.buildClearDigitalTimer(mAddress,recorderAddress,recordSource);
  break;
case TIMER_RECORDING_TYPE_ANALOGUE:
message=HdmiCecMessageBuilder.buildClearAnalogueTimer(mAddress,recorderAddress,recordSource);
break;
case TIMER_RECORDING_TYPE_EXTERNAL:
message=HdmiCecMessageBuilder.buildClearExternalTimer(mAddress,recorderAddress,recordSource);
break;
default :
Slog.w(TAG,"String_Node_Str" + recorderAddress);
announceTimerRecordingResult(CLEAR_TIMER_STATUS_FAIL_TO_CLEAR_SELECTED_SOURCE);
return;
}
mService.sendCecCommand(message,new SendMessageCallback(){
@Override public void onSendCompleted(int error){
if (error != Constants.SEND_RESULT_SUCCESS) {
announceTimerRecordingResult(CLEAR_TIMER_STATUS_FAIL_TO_CLEAR_SELECTED_SOURCE);
}
}
}
);
}

Fixed version (ground truth):
private void sendClearTimerMessage(int recorderAddress,int sourceType,byte[] recordSource){
  HdmiCecMessage message=null;
switch (sourceType) {
case TIMER_RECORDING_TYPE_DIGITAL:
    message=HdmiCecMessageBuilder.buildClearDigitalTimer(mAddress,recorderAddress,recordSource);
  break;
case TIMER_RECORDING_TYPE_ANALOGUE:
message=HdmiCecMessageBuilder.buildClearAnalogueTimer(mAddress,recorderAddress,recordSource);
break;
case TIMER_RECORDING_TYPE_EXTERNAL:
message=HdmiCecMessageBuilder.buildClearExternalTimer(mAddress,recorderAddress,recordSource);
break;
default :
Slog.w(TAG,"String_Node_Str" + recorderAddress);
announceClearTimerRecordingResult(CLEAR_TIMER_STATUS_FAIL_TO_CLEAR_SELECTED_SOURCE);
return;
}
mService.sendCecCommand(message,new SendMessageCallback(){
@Override public void onSendCompleted(int error){
if (error != Constants.SEND_RESULT_SUCCESS) {
announceClearTimerRecordingResult(CLEAR_TIMER_STATUS_FAIL_TO_CLEAR_SELECTED_SOURCE);
}
}
}
);
}
Program: 198669
Project: 198669
Buggy source:
@Override public void onSendCompleted(int error){
  if (error != Constants.SEND_RESULT_SUCCESS) {
    announceTimerRecordingResult(CLEAR_TIMER_STATUS_FAIL_TO_CLEAR_SELECTED_SOURCE);
  }
}

Fixed version (ground truth):
@Override public void onSendCompleted(int error){
  if (error != Constants.SEND_RESULT_SUCCESS) {
    announceClearTimerRecordingResult(CLEAR_TIMER_STATUS_FAIL_TO_CLEAR_SELECTED_SOURCE);
  }
}
Program: 198670
Project: 198670
Buggy source:
@ServiceThreadOnly void clearTimerRecording(int recorderAddress,int sourceType,byte[] recordSource){
  assertRunOnServiceThread();
  if (!mService.isControlEnabled()) {
    Slog.w(TAG,"String_Node_Str");
    announceTimerRecordingResult(CLEAR_TIMER_STATUS_CEC_DISABLE);
    return;
  }
  if (!checkRecorder(recorderAddress)) {
    Slog.w(TAG,"String_Node_Str" + recorderAddress);
    announceTimerRecordingResult(CLEAR_TIMER_STATUS_CHECK_RECORDER_CONNECTION);
    return;
  }
  if (!checkTimerRecordingSource(sourceType,recordSource)) {
    Slog.w(TAG,"String_Node_Str" + Arrays.toString(recordSource));
    announceTimerRecordingResult(CLEAR_TIMER_STATUS_FAIL_TO_CLEAR_SELECTED_SOURCE);
    return;
  }
  sendClearTimerMessage(recorderAddress,sourceType,recordSource);
}

Fixed version (ground truth):
@ServiceThreadOnly void clearTimerRecording(int recorderAddress,int sourceType,byte[] recordSource){
  assertRunOnServiceThread();
  if (!mService.isControlEnabled()) {
    Slog.w(TAG,"String_Node_Str");
    announceClearTimerRecordingResult(CLEAR_TIMER_STATUS_CEC_DISABLE);
    return;
  }
  if (!checkRecorder(recorderAddress)) {
    Slog.w(TAG,"String_Node_Str" + recorderAddress);
    announceClearTimerRecordingResult(CLEAR_TIMER_STATUS_CHECK_RECORDER_CONNECTION);
    return;
  }
  if (!checkTimerRecordingSource(sourceType,recordSource)) {
    Slog.w(TAG,"String_Node_Str" + Arrays.toString(recordSource));
    announceClearTimerRecordingResult(CLEAR_TIMER_STATUS_FAIL_TO_CLEAR_SELECTED_SOURCE);
    return;
  }
  sendClearTimerMessage(recorderAddress,sourceType,recordSource);
}
Program: 198671
Project: 198671
Buggy source:
private void sendTimerMessage(){
  HdmiCecMessage message=null;
switch (mSourceType) {
case TIMER_RECORDING_TYPE_DIGITAL:
    message=HdmiCecMessageBuilder.buildSetDigitalTimer(getSourceAddress(),mRecorderAddress,mRecordSource);
  break;
case TIMER_RECORDING_TYPE_ANALOGUE:
message=HdmiCecMessageBuilder.buildSetAnalogueTimer(getSourceAddress(),mRecorderAddress,mRecordSource);
break;
case TIMER_RECORDING_TYPE_EXTERNAL:
message=HdmiCecMessageBuilder.buildSetExternalTimer(getSourceAddress(),mRecorderAddress,mRecordSource);
break;
default :
tv().announceTimerRecordingResult(TIMER_RECORDING_RESULT_EXTRA_FAIL_TO_RECORD_SELECTED_SOURCE);
finish();
return;
}
sendCommand(message,new SendMessageCallback(){
@Override public void onSendCompleted(int error){
if (error != Constants.SEND_RESULT_SUCCESS) {
mState=STATE_WAITING_FOR_TIMER_STATUS;
addTimer(mState,TIMER_STATUS_TIMEOUT_MS);
finish();
return;
}
}
}
);
}

Fixed version (ground truth):
private void sendTimerMessage(){
  HdmiCecMessage message=null;
switch (mSourceType) {
case TIMER_RECORDING_TYPE_DIGITAL:
    message=HdmiCecMessageBuilder.buildSetDigitalTimer(getSourceAddress(),mRecorderAddress,mRecordSource);
  break;
case TIMER_RECORDING_TYPE_ANALOGUE:
message=HdmiCecMessageBuilder.buildSetAnalogueTimer(getSourceAddress(),mRecorderAddress,mRecordSource);
break;
case TIMER_RECORDING_TYPE_EXTERNAL:
message=HdmiCecMessageBuilder.buildSetExternalTimer(getSourceAddress(),mRecorderAddress,mRecordSource);
break;
default :
tv().announceTimerRecordingResult(TIMER_RECORDING_RESULT_EXTRA_FAIL_TO_RECORD_SELECTED_SOURCE);
finish();
return;
}
sendCommand(message,new SendMessageCallback(){
@Override public void onSendCompleted(int error){
if (error != Constants.SEND_RESULT_SUCCESS) {
tv().announceTimerRecordingResult(TIMER_RECORDING_RESULT_EXTRA_CHECK_RECORDER_CONNECTION);
finish();
return;
}
mState=STATE_WAITING_FOR_TIMER_STATUS;
addTimer(mState,TIMER_STATUS_TIMEOUT_MS);
}
}
);
}
Program: 198672
Project: 198672
Buggy source:
private boolean handleFeatureAbort(HdmiCecMessage cmd){
  byte[] params=cmd.getParams();
  int messageType=params[0];
switch (messageType) {
case Constants.MESSAGE_SET_DIGITAL_TIMER:
case Constants.MESSAGE_SET_ANALOG_TIMER:
case Constants.MESSAGE_SET_EXTERNAL_TIMER:
    break;
default :
  return false;
}
int reason=params[1];
Slog.i(TAG,"String_Node_Str" + messageType + "String_Node_Str"+ reason);
tv().announceTimerRecordingResult(TIMER_RECORDING_RESULT_EXTRA_CHECK_RECORDER_CONNECTION);
finish();
return true;
}

Fixed version (ground truth):
private boolean handleFeatureAbort(HdmiCecMessage cmd){
  byte[] params=cmd.getParams();
  int messageType=params[0] & 0xFF;
switch (messageType) {
case Constants.MESSAGE_SET_DIGITAL_TIMER:
case Constants.MESSAGE_SET_ANALOG_TIMER:
case Constants.MESSAGE_SET_EXTERNAL_TIMER:
    break;
default :
  return false;
}
int reason=params[1] & 0xFF;
Slog.i(TAG,"String_Node_Str" + messageType + "String_Node_Str"+ reason);
tv().announceTimerRecordingResult(TIMER_RECORDING_RESULT_EXTRA_CHECK_RECORDER_CONNECTION);
finish();
return true;
}
Program: 198673
Project: 198673
Buggy source:
@Override public void onSendCompleted(int error){
  if (error != Constants.SEND_RESULT_SUCCESS) {
    mState=STATE_WAITING_FOR_TIMER_STATUS;
    addTimer(mState,TIMER_STATUS_TIMEOUT_MS);
    finish();
    return;
  }
}

Fixed version (ground truth):
@Override public void onSendCompleted(int error){
  if (error != Constants.SEND_RESULT_SUCCESS) {
    tv().announceTimerRecordingResult(TIMER_RECORDING_RESULT_EXTRA_CHECK_RECORDER_CONNECTION);
    finish();
    return;
  }
  mState=STATE_WAITING_FOR_TIMER_STATUS;
  addTimer(mState,TIMER_STATUS_TIMEOUT_MS);
}
Program: 198675
Project: 198675
Buggy source:
private ValueAnimator getAnimatorToRadius(float circleRadius){
  ValueAnimator animator=ValueAnimator.ofFloat(mCircleRadius,circleRadius);
  mCircleAnimator=animator;
  mCircleStartValue=mCircleRadius;
  mCircleWillBeHidden=circleRadius == 0.0f;
  animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(){
    @Override public void onAnimationUpdate(    ValueAnimator animation){
      mCircleRadius=(float)animation.getAnimatedValue();
      invalidate();
    }
  }
);
  animator.addListener(mCircleEndListener);
  return animator;
}

Fixed version (ground truth):
private ValueAnimator getAnimatorToRadius(float circleRadius){
  ValueAnimator animator=ValueAnimator.ofFloat(mCircleRadius,circleRadius);
  mCircleAnimator=animator;
  mCircleStartValue=mCircleRadius;
  mCircleWillBeHidden=circleRadius == 0.0f;
  animator.addUpdateListener(new ValueAnimator.AnimatorUpdateListener(){
    @Override public void onAnimationUpdate(    ValueAnimator animation){
      mCircleRadius=(float)animation.getAnimatedValue();
      updateIconColor();
      invalidate();
    }
  }
);
  animator.addListener(mCircleEndListener);
  return animator;
}
Program: 198676
Project: 198676
Buggy source:
@Override protected void onDraw(Canvas canvas){
  drawBackgroundCircle(canvas);
  drawArrow(canvas);
  canvas.save();
  updateIconColor();
  canvas.scale(mImageScale,mImageScale,getWidth() / 2,getHeight() / 2);
  super.onDraw(canvas);
  canvas.restore();
}

Fixed version (ground truth):
@Override protected void onDraw(Canvas canvas){
  drawBackgroundCircle(canvas);
  drawArrow(canvas);
  canvas.save();
  canvas.scale(mImageScale,mImageScale,getWidth() / 2,getHeight() / 2);
  super.onDraw(canvas);
  canvas.restore();
}
Program: 198677
Project: 198677
Buggy source:
@Override public void registerSink(IFusedLocationHardwareSink eventSink){
synchronized (mLocationSinkLock) {
    if (mLocationSink != null) {
      throw new RuntimeException("String_Node_Str");
    }
    mLocationSink=eventSink;
  }
}

Fixed version (ground truth):
@Override public void registerSink(IFusedLocationHardwareSink eventSink){
synchronized (mLocationSinkLock) {
    if (mLocationSink != null) {
      Log.e(TAG,"String_Node_Str");
    }
    mLocationSink=eventSink;
  }
}
Program: 198678
Project: 198678
Buggy source:
@Override public void registerSink(IFusedLocationHardwareSink eventSink){
synchronized (mLocationSinkLock) {
    if (mLocationSink != null) {
      throw new RuntimeException("String_Node_Str");
    }
    mLocationSink=eventSink;
  }
}

Fixed version (ground truth):
@Override public void registerSink(IFusedLocationHardwareSink eventSink){
synchronized (mLocationSinkLock) {
    if (mLocationSink != null) {
      Log.e(TAG,"String_Node_Str");
    }
    mLocationSink=eventSink;
  }
}
Program: 198679
Project: 198679
Buggy source:
private static void checkTimeValue(int hour,int minute){
  if (hour < 0 || hour > 24) {
    throw new IllegalArgumentException("String_Node_Str" + hour);
  }
  if (minute < 0 || minute > 60) {
    throw new IllegalArgumentException("String_Node_Str" + minute);
  }
}

Fixed version (ground truth):
private static void checkTimeValue(int hour,int minute){
  if (hour < 0 || hour > 23) {
    throw new IllegalArgumentException("String_Node_Str" + hour);
  }
  if (minute < 0 || minute > 59) {
    throw new IllegalArgumentException("String_Node_Str" + minute);
  }
}
Program: 198680
Project: 198680
Buggy source:
private static void checkDurationValue(int hour,int minute){
  if (hour < 0 || hour > 99) {
    throw new IllegalArgumentException("String_Node_Str" + hour);
  }
  if (minute < 0 || minute > 60) {
    throw new IllegalArgumentException("String_Node_Str" + minute);
  }
}

Fixed version (ground truth):
private static void checkDurationValue(int hour,int minute){
  if (hour < 0 || hour > 99) {
    throw new IllegalArgumentException("String_Node_Str" + hour);
  }
  if (minute < 0 || minute > 59) {
    throw new IllegalArgumentException("String_Node_Str" + minute);
  }
}
Program: 198681
Project: 198681
Buggy source:
private static void checkTimeValue(int hour,int minute){
  if (hour < 0 || hour > 24) {
    throw new IllegalArgumentException("String_Node_Str" + hour);
  }
  if (minute < 0 || minute > 60) {
    throw new IllegalArgumentException("String_Node_Str" + minute);
  }
}

Fixed version (ground truth):
private static void checkTimeValue(int hour,int minute){
  if (hour < 0 || hour > 23) {
    throw new IllegalArgumentException("String_Node_Str" + hour);
  }
  if (minute < 0 || minute > 59) {
    throw new IllegalArgumentException("String_Node_Str" + minute);
  }
}
Program: 198682
Project: 198682
Buggy source:
private static void checkDurationValue(int hour,int minute){
  if (hour < 0 || hour > 99) {
    throw new IllegalArgumentException("String_Node_Str" + hour);
  }
  if (minute < 0 || minute > 60) {
    throw new IllegalArgumentException("String_Node_Str" + minute);
  }
}

Fixed version (ground truth):
private static void checkDurationValue(int hour,int minute){
  if (hour < 0 || hour > 99) {
    throw new IllegalArgumentException("String_Node_Str" + hour);
  }
  if (minute < 0 || minute > 59) {
    throw new IllegalArgumentException("String_Node_Str" + minute);
  }
}
Program: 198683
Project: 198683
Buggy source:
private static void checkTimeValue(int hour,int minute){
  if (hour < 0 || hour > 24) {
    throw new IllegalArgumentException("String_Node_Str" + hour);
  }
  if (minute < 0 || minute > 60) {
    throw new IllegalArgumentException("String_Node_Str" + minute);
  }
}

Fixed version (ground truth):
private static void checkTimeValue(int hour,int minute){
  if (hour < 0 || hour > 23) {
    throw new IllegalArgumentException("String_Node_Str" + hour);
  }
  if (minute < 0 || minute > 59) {
    throw new IllegalArgumentException("String_Node_Str" + minute);
  }
}
Program: 198684
Project: 198684
Buggy source:
private static void checkDurationValue(int hour,int minute){
  if (hour < 0 || hour > 99) {
    throw new IllegalArgumentException("String_Node_Str" + hour);
  }
  if (minute < 0 || minute > 60) {
    throw new IllegalArgumentException("String_Node_Str" + minute);
  }
}

Fixed version (ground truth):
private static void checkDurationValue(int hour,int minute){
  if (hour < 0 || hour > 99) {
    throw new IllegalArgumentException("String_Node_Str" + hour);
  }
  if (minute < 0 || minute > 59) {
    throw new IllegalArgumentException("String_Node_Str" + minute);
  }
}
Program: 198685
Project: 198685
Buggy source:
/** 
 * Handles the incoming active source command.
 * @param newActive new active source information
 */
void process(ActiveSource newActive){
  HdmiCecLocalDeviceTv tv=mSource;
  ActiveSource activeSource=tv.getActiveSource();
  if (activeSource.equals(newActive)) {
    invokeCallback(HdmiControlManager.RESULT_SUCCESS);
    return;
  }
  HdmiCecDeviceInfo device=mService.getDeviceInfo(newActive.logicalAddress);
  if (device == null) {
    tv.startNewDeviceAction(newActive);
  }
  ActiveSource current=tv.getActiveSource();
  if (!tv.isProhibitMode()) {
    tv.updateActiveSource(newActive);
    if (!current.equals(newActive)) {
      boolean notifyInputChange=(mCallback == null);
      tv.updateActiveInput(newActive.physicalAddress,notifyInputChange);
    }
    invokeCallback(HdmiControlManager.RESULT_SUCCESS);
  }
 else {
    if (current.logicalAddress == getSourceAddress()) {
      HdmiCecMessage activeSourceCommand=HdmiCecMessageBuilder.buildActiveSource(current.logicalAddress,current.physicalAddress);
      mService.sendCecCommand(activeSourceCommand);
      tv.updateActiveSource(current);
      invokeCallback(HdmiControlManager.RESULT_SUCCESS);
    }
 else {
      HdmiCecMessage routingChange=HdmiCecMessageBuilder.buildRoutingChange(getSourceAddress(),newActive.physicalAddress,current.physicalAddress);
      mService.sendCecCommand(routingChange);
      tv.addAndStartAction(new RoutingControlAction(tv,current.physicalAddress,true,mCallback));
    }
  }
}

Fixed version (ground truth):
/** 
 * Handles the incoming active source command.
 * @param newActive new active source information
 */
void process(ActiveSource newActive){
  HdmiCecLocalDeviceTv tv=mSource;
  ActiveSource activeSource=tv.getActiveSource();
  if (activeSource.equals(newActive)) {
    invokeCallback(HdmiControlManager.RESULT_SUCCESS);
    return;
  }
  HdmiCecDeviceInfo device=mService.getDeviceInfo(newActive.logicalAddress);
  if (device == null) {
    tv.startNewDeviceAction(newActive);
  }
  if (!tv.isProhibitMode()) {
    tv.updateActiveSource(newActive);
    boolean notifyInputChange=(mCallback == null);
    tv.updateActiveInput(newActive.physicalAddress,notifyInputChange);
    invokeCallback(HdmiControlManager.RESULT_SUCCESS);
  }
 else {
    ActiveSource current=tv.getActiveSource();
    if (current.logicalAddress == getSourceAddress()) {
      HdmiCecMessage activeSourceCommand=HdmiCecMessageBuilder.buildActiveSource(current.logicalAddress,current.physicalAddress);
      mService.sendCecCommand(activeSourceCommand);
      tv.updateActiveSource(current);
      invokeCallback(HdmiControlManager.RESULT_SUCCESS);
    }
 else {
      HdmiCecMessage routingChange=HdmiCecMessageBuilder.buildRoutingChange(getSourceAddress(),newActive.physicalAddress,current.physicalAddress);
      mService.sendCecCommand(routingChange);
      tv.addAndStartAction(new RoutingControlAction(tv,current.physicalAddress,true,mCallback));
    }
  }
}
Program: 198686
Project: 198686
Buggy source:
private void handleNewDeviceAtTheTailOfActivePath(int path){
  if (isTailOfActivePath(path,getActivePath())) {
    removeAction(RoutingControlAction.class);
    int newPath=mService.portIdToPath(getActivePortId());
    mService.sendCecCommand(HdmiCecMessageBuilder.buildRoutingChange(mAddress,getActivePath(),newPath));
    addAndStartAction(new RoutingControlAction(this,getActivePortId(),false,null));
  }
}

Fixed version (ground truth):
private void handleNewDeviceAtTheTailOfActivePath(int path){
  if (isTailOfActivePath(path,getActivePath())) {
    removeAction(RoutingControlAction.class);
    int newPath=mService.portIdToPath(getActivePortId());
    setActivePath(newPath);
    mService.sendCecCommand(HdmiCecMessageBuilder.buildRoutingChange(mAddress,getActivePath(),newPath));
    addAndStartAction(new RoutingControlAction(this,newPath,false,null));
  }
}
Program: 198687
Project: 198687
Buggy source:
@ServiceThreadOnly void updateActiveInput(int path,boolean notifyInputChange){
  assertRunOnServiceThread();
  if (path == getActivePath()) {
    return;
  }
  int portId=mService.pathToPortId(path);
  setActivePath(path);
  setPrevPortId(portId);
  if (notifyInputChange) {
    ActiveSource activeSource=getActiveSource();
    HdmiCecDeviceInfo info=getDeviceInfo(activeSource.logicalAddress);
    if (info == null) {
      info=new HdmiCecDeviceInfo(Constants.ADDR_INVALID,path,portId,HdmiCecDeviceInfo.DEVICE_RESERVED,0,null);
    }
    mService.invokeInputChangeListener(info);
  }
}

Fixed version (ground truth):
@ServiceThreadOnly void updateActiveInput(int path,boolean notifyInputChange){
  assertRunOnServiceThread();
  if (path == getActivePath()) {
    return;
  }
  setPrevPortId(getActivePortId());
  int portId=mService.pathToPortId(path);
  setActivePath(path);
  if (notifyInputChange) {
    ActiveSource activeSource=getActiveSource();
    HdmiCecDeviceInfo info=getDeviceInfo(activeSource.logicalAddress);
    if (info == null) {
      info=new HdmiCecDeviceInfo(Constants.ADDR_INVALID,path,portId,HdmiCecDeviceInfo.DEVICE_RESERVED,0,null);
    }
    mService.invokeInputChangeListener(info);
  }
}