nus-yam/ex-repair huggingface dataset:
Program: 33088
Project: 33088
Buggy source:
/** 
 * Gets exposed property or parameter name.
 * @param inputParameter for exposure
 * @return property name
 */
private String getExposedPropertyOrParamName(AnnotatedParameter inputParameter){
  final Expose expose=inputParameter.getAnnotation(Expose.class);
  String property;
  if (expose != null) {
    property=expose.value();
  }
 else {
    property=inputParameter.getParameterName();
  }
  return property;
}

Fixed version (ground truth):
/** 
 * Gets exposed property or parameter name.
 * @param inputParameter for exposure
 * @return property name
 */
private String getExposedPropertyOrParamName(ActionInputParameter inputParameter){
  final Expose expose=inputParameter.getAnnotation(Expose.class);
  String property;
  if (expose != null) {
    property=expose.value();
  }
 else {
    property=inputParameter.getParameterName();
  }
  return property;
}
Program: 33090
Project: 33090
Buggy source:
/** 
 * Allows to specify possible values for an argument. This allows an   {@link de.escalon.hypermedia.spring.action.ActionDescriptor} to determine possiblevalues for an action argument. <p> The example below defines four possible values for the <code>mood</code> parameter. <pre> &#0064;RequestMapping(value = "/customer", method = RequestMethod.GET, params = { "mood" }) public HttpEntity<SamplePersonResource> showPersonByMood( &#0064;RequestParam &#0064;Select({ "angry", "happy", "grumpy", "bored" }) String mood) { ... } </pre>
 */
@Override public Object[] get(String[] value,Object... args){
  return value;
}

Fixed version (ground truth):
/** 
 * Allows to specify possible values for an argument. This allows an   {@link de.escalon.hypermedia.spring.action.ActionDescriptor} to determine possiblevalues for an action argument. <p> The example below defines four possible values for the <code>mood</code> parameter. <pre> &#0064;RequestMapping(value = "/customer", method = RequestMethod.GET, params = { "mood" }) public HttpEntity&lt;SamplePersonResourcegt; showPersonByMood( &#0064;RequestParam &#0064;Select({ "angry", "happy", "grumpy", "bored" }) String mood) { ... } </pre>
 */
@Override public Object[] get(String[] value,Object... args){
  return value;
}
Program: 33091
Project: 33091
Buggy source:
/** 
 * Gets header name of the affordance, either Link or Link-Header.
 * @return header name
 */
public String getHeaderName(){
  String headerName;
  if (uriTemplateComponents.hasVariables()) {
    headerName="String_Node_Str";
  }
 else {
    headerName="String_Node_Str";
  }
  return headerName;
}

Fixed version (ground truth):
/** 
 * Gets header name of the affordance, either Link or Link-Header.
 * @return header name
 */
@JsonIgnore public String getHeaderName(){
  String headerName;
  if (uriTemplateComponents.hasVariables()) {
    headerName="String_Node_Str";
  }
 else {
    headerName="String_Node_Str";
  }
  return headerName;
}
Program: 33092
Project: 33092
Buggy source:
public List<String> getRels(){
  final List<String> rels=linkParams.get("String_Node_Str");
  return rels == null ? Collections.<String>emptyList() : Collections.unmodifiableList(rels);
}

Fixed version (ground truth):
@JsonIgnore public List<String> getRels(){
  final List<String> rels=linkParams.get("String_Node_Str");
  return rels == null ? Collections.<String>emptyList() : Collections.unmodifiableList(rels);
}
Program: 33093
Project: 33093
Buggy source:
public List<ActionDescriptor> getActionDescriptors(){
  return Collections.unmodifiableList(actionDescriptors);
}

Fixed version (ground truth):
@JsonIgnore public List<ActionDescriptor> getActionDescriptors(){
  return Collections.unmodifiableList(actionDescriptors);
}
Program: 33095
Project: 33095
Buggy source:
@Override public void onReceive(Context context,Intent intent){
  proximitySensor=AppRTCProximitySensor.create(apprtcContext,new Runnable(){
    public void run(){
      onProximitySensorChangedState();
    }
  }
);
  savedAudioMode=audioManager.getMode();
  savedIsSpeakerPhoneOn=audioManager.isSpeakerphoneOn();
  savedIsMicrophoneMute=audioManager.isMicrophoneMute();
  audioManager.requestAudioFocus(null,AudioManager.STREAM_VOICE_CALL,AudioManager.AUDIOFOCUS_GAIN);
  audioManager.setMode(AudioManager.MODE_IN_COMMUNICATION);
  setMicrophoneMute(false);
  int state=intent.getIntExtra("String_Node_Str",STATE_UNPLUGGED);
  int microphone=intent.getIntExtra("String_Node_Str",HAS_NO_MIC);
  String name=intent.getStringExtra("String_Node_Str");
  RCLogger.d(TAG,"String_Node_Str" + AppRTCUtils.getThreadInfo() + "String_Node_Str"+ "String_Node_Str"+ intent.getAction()+ "String_Node_Str"+ (state == STATE_UNPLUGGED ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str"+ (microphone == HAS_MIC ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str"+ name+ "String_Node_Str"+ isInitialStickyBroadcast());
switch (state) {
case STATE_UNPLUGGED:
    updateAudioDeviceState(false);
  break;
case STATE_PLUGGED:
if (selectedAudioDevice != AudioDevice.WIRED_HEADSET) {
  updateAudioDeviceState(true);
}
break;
default :
RCLogger.e(TAG,"String_Node_Str");
break;
}
callAudioInitialized=true;
}

Fixed version (ground truth):
@Override public void onReceive(Context context,Intent intent){
  proximitySensor=AppRTCProximitySensor.create(apprtcContext,new Runnable(){
    public void run(){
      onProximitySensorChangedState();
    }
  }
);
  savedAudioMode=audioManager.getMode();
  savedIsSpeakerPhoneOn=audioManager.isSpeakerphoneOn();
  savedIsMicrophoneMute=audioManager.isMicrophoneMute();
  audioManager.requestAudioFocus(null,AudioManager.STREAM_VOICE_CALL,AudioManager.AUDIOFOCUS_GAIN);
  audioManager.setMode(AudioManager.MODE_IN_COMMUNICATION);
  setMicrophoneMute(false);
  int state=intent.getIntExtra("String_Node_Str",STATE_UNPLUGGED);
  int microphone=intent.getIntExtra("String_Node_Str",HAS_NO_MIC);
  String name=intent.getStringExtra("String_Node_Str");
  RCLogger.d(TAG,"String_Node_Str" + AppRTCUtils.getThreadInfo() + "String_Node_Str"+ "String_Node_Str"+ intent.getAction()+ "String_Node_Str"+ (state == STATE_UNPLUGGED ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str"+ (microphone == HAS_MIC ? "String_Node_Str" : "String_Node_Str")+ "String_Node_Str"+ name+ "String_Node_Str"+ isInitialStickyBroadcast());
switch (state) {
case STATE_UNPLUGGED:
    updateAudioDeviceState(false);
  break;
case STATE_PLUGGED:
updateAudioDeviceState(true);
break;
default :
RCLogger.e(TAG,"String_Node_Str");
break;
}
callAudioInitialized=true;
}
Program: 33119
Project: 33119
Buggy source:
/** 
 * Internal service callback; not meant for application use
 * @param jobId the job Id that was used in the original request, so that we can correlate the two
 * @param connectivityStatus connectivity status at the point of the reply
 * @param status status code for this action
 * @param text status text for this action
 */
public void onOpenReply(String jobId,RCDeviceListener.RCConnectivityStatus connectivityStatus,RCClient.ErrorCodes status,String text){
  RCLogger.i(TAG,"String_Node_Str" + jobId + "String_Node_Str"+ connectivityStatus+ "String_Node_Str"+ status+ "String_Node_Str"+ text);
  cachedConnectivityStatus=connectivityStatus;
  if (isServiceAttached) {
    listener.onInitialized(this,connectivityStatus,status.ordinal(),text);
  }
 else {
    RCLogger.w(TAG,"String_Node_Str" + RCClient.errorText(status));
  }
  registerForPush(false);
  if (status == RCClient.ErrorCodes.SUCCESS) {
    state=DeviceState.READY;
  }
 else {
    release();
  }
}

Fixed version (ground truth):
/** 
 * Internal service callback; not meant for application use
 * @param jobId the job Id that was used in the original request, so that we can correlate the two
 * @param connectivityStatus connectivity status at the point of the reply
 * @param status status code for this action
 * @param text status text for this action
 */
public void onOpenReply(String jobId,RCDeviceListener.RCConnectivityStatus connectivityStatus,RCClient.ErrorCodes status,String text){
  RCLogger.i(TAG,"String_Node_Str" + jobId + "String_Node_Str"+ connectivityStatus+ "String_Node_Str"+ status+ "String_Node_Str"+ text);
  cachedConnectivityStatus=connectivityStatus;
  if (isServiceAttached) {
    listener.onInitialized(this,connectivityStatus,status.ordinal(),text);
  }
 else {
    RCLogger.w(TAG,"String_Node_Str" + RCClient.errorText(status));
  }
  if ((Boolean)parameters.get(RCDevice.ParameterKeys.PUSH_NOTIFICATIONS_ENABLE_PUSH_FOR_ACCOUNT)) {
    registerForPush(false);
  }
  if (status == RCClient.ErrorCodes.SUCCESS) {
    state=DeviceState.READY;
  }
 else {
    release();
  }
}
Program: 33124
Project: 33124
Buggy source:
@Override public void onFragmentInteraction(String action){
  if (action == "String_Node_Str") {
    FragmentTransaction ft=getFragmentManager().beginTransaction();
    ft.hide(keypadFragment);
    ft.commit();
  }
}

Fixed version (ground truth):
@Override public void onFragmentInteraction(String action){
  if (action.equals("String_Node_Str")) {
    FragmentTransaction ft=getFragmentManager().beginTransaction();
    ft.hide(keypadFragment);
    ft.commit();
  }
}
Program: 33125
Project: 33125
Buggy source:
public void onReleased(RCDevice device,int statusCode,String statusText){
  if (statusCode != RCClient.ErrorCodes.SUCCESS.ordinal()) {
    showOkAlert("String_Node_Str",statusText);
  }
}

Fixed version (ground truth):
public void onReleased(RCDevice device,int statusCode,String statusText){
  if (statusCode != RCClient.ErrorCodes.SUCCESS.ordinal()) {
    Toast.makeText(getApplicationContext(),"String_Node_Str" + statusText,Toast.LENGTH_SHORT).show();
  }
 else {
    handleConnectivityUpdate(RCConnectivityStatus.RCConnectivityStatusNone,"String_Node_Str" + statusText);
  }
}
Program: 33126
Project: 33126
Buggy source:
public void onClick(DialogInterface dialog,int which){
  dialog.dismiss();
}

Fixed version (ground truth):
/** 
 * Main Activity onClick
 */
public void onClick(View view){
  if (view.getId() == R.id.imageButton_add) {
    DialogFragment newFragment=AddUserDialogFragment.newInstance(AddUserDialogFragment.DIALOG_TYPE_ADD_CONTACT,"String_Node_Str","String_Node_Str");
    newFragment.show(getFragmentManager(),"String_Node_Str");
  }
}
Program: 33127
Project: 33127
Buggy source:
public void onConnectivityUpdate(RCDevice device,RCConnectivityStatus connectivityStatus){
  String text="String_Node_Str";
  if (connectivityStatus == RCConnectivityStatus.RCConnectivityStatusNone) {
    text="String_Node_Str";
  }
  if (connectivityStatus == RCConnectivityStatus.RCConnectivityStatusWiFi) {
    text="String_Node_Str";
  }
  if (connectivityStatus == RCConnectivityStatus.RCConnectivityStatusCellular) {
    text="String_Node_Str";
  }
  if (connectivityStatus == RCConnectivityStatus.RCConnectivityStatusNone) {
    getSupportActionBar().setBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.colorTextSecondary)));
  }
 else {
    getSupportActionBar().setBackgroundDrawable(new ColorDrawable(getResources().getColor(R.color.colorPrimary)));
  }
  if (connectivityStatus != this.previousConnectivityStatus) {
    showOkAlert("String_Node_Str",text);
    this.previousConnectivityStatus=connectivityStatus;
  }
}

Fixed version (ground truth):
public void onConnectivityUpdate(RCDevice device,RCConnectivityStatus connectivityStatus){
  handleConnectivityUpdate(connectivityStatus,null);
}
Program: 33128
Project: 33128
Buggy source:
public void onInitialized(RCDevice device,RCDeviceListener.RCConnectivityStatus connectivityStatus,int statusCode,String statusText){
  if (statusCode == RCClient.ErrorCodes.SUCCESS.ordinal()) {
    onConnectivityUpdate(device,connectivityStatus);
  }
 else   if (statusCode == RCClient.ErrorCodes.ERROR_NO_CONNECTIVITY.ordinal()) {
    onConnectivityUpdate(device,connectivityStatus);
  }
 else {
    showOkAlert("String_Node_Str",statusText);
  }
}

Fixed version (ground truth):
public void onInitialized(RCDevice device,RCDeviceListener.RCConnectivityStatus connectivityStatus,int statusCode,String statusText){
  if (statusCode == RCClient.ErrorCodes.SUCCESS.ordinal()) {
    handleConnectivityUpdate(connectivityStatus,"String_Node_Str" + connectivityStatus);
  }
 else   if (statusCode == RCClient.ErrorCodes.ERROR_NO_CONNECTIVITY.ordinal()) {
    handleConnectivityUpdate(connectivityStatus,null);
  }
 else {
    Toast.makeText(getApplicationContext(),"String_Node_Str" + statusText,Toast.LENGTH_SHORT).show();
  }
}
Program: 33129
Project: 33129
Buggy source:
/** 
 * RCDeviceListener callbacks
 */
public void onStartListening(RCDevice device){
}

Fixed version (ground truth):
/** 
 * RCDeviceListener callbacks
 */
public void onStartListening(RCDevice device,RCDeviceListener.RCConnectivityStatus connectivityStatus){
  handleConnectivityUpdate(connectivityStatus,null);
}
Program: 33130
Project: 33130
Buggy source:
public void onStopListening(RCDevice device,int errorCode,String errorText){
  showOkAlert("String_Node_Str",errorText);
}

Fixed version (ground truth):
public void onStopListening(RCDevice device,int errorCode,String errorText){
  if (errorCode == RCClient.ErrorCodes.SUCCESS.ordinal()) {
    handleConnectivityUpdate(RCConnectivityStatus.RCConnectivityStatusNone,"String_Node_Str" + errorText);
  }
 else {
    handleConnectivityUpdate(RCConnectivityStatus.RCConnectivityStatusNone,"String_Node_Str" + errorText);
  }
}
Program: 33131
Project: 33131
Buggy source:
public void onStartListening(RCDevice device){
}

Fixed version (ground truth):
public void onStartListening(RCDevice device,RCConnectivityStatus connectivityStatus){
}
Program: 33132
Project: 33132
Buggy source:
public void onErrorEvent(String id,RCClient.ErrorCodes status,String text){
  if (status == RCClient.ErrorCodes.SUCCESS) {
    RCLogger.i(TAG,"String_Node_Str" + id + "String_Node_Str"+ text);
  }
 else {
    RCLogger.i(TAG,"String_Node_Str" + id + "String_Node_Str"+ text);
  }
}

Fixed version (ground truth):
public void onErrorEvent(String id,RCDeviceListener.RCConnectivityStatus connectivityStatus,RCClient.ErrorCodes status,String text){
  cachedConnectivityStatus=connectivityStatus;
  if (status == RCClient.ErrorCodes.SUCCESS) {
    RCLogger.i(TAG,"String_Node_Str" + id + "String_Node_Str"+ text);
  }
 else {
    RCLogger.i(TAG,"String_Node_Str" + id + "String_Node_Str"+ text);
    listener.onStopListening(this,status.ordinal(),text);
  }
}
Program: 33133
Project: 33133
Buggy source:
/** 
 * Create an outgoing connection to an endpoint
 * @param parameters Parameters such as the endpoint we want to connect to or SIP custom headers. Ifyou want to pass SIP custom headers, you need to add a separate (String, String) HashMap inside 'parameters' hash and introduce your headers there. For an example please check HelloWorld or Messenger samples.
 * @param listener   The listener object that will receive events when the connection state changes
 * @return An RCConnection object representing the new connection or null in case of error. Errormeans that RCDevice.state not ready to make a call (this usually means no WiFi available)
 */
public RCConnection connect(Map<String,Object> parameters,RCConnectionListener listener){
  RCLogger.i(TAG,"String_Node_Str" + parameters.toString());
  if (cachedConnectivityStatus == RCDeviceListener.RCConnectivityStatus.RCConnectivityStatusNone) {
    RCLogger.e(TAG,"String_Node_Str");
    String username="String_Node_Str";
    if (parameters != null && parameters.get("String_Node_Str") != null)     username=parameters.get("String_Node_Str").toString();
    sendQoSNoConnectionIntent(username,this.getConnectivityStatus().toString());
    return null;
  }
  if (state == DeviceState.READY) {
    RCLogger.i(TAG,"String_Node_Str");
    RCConnection connection=new RCConnection(null,false,RCConnection.ConnectionState.PENDING,this,uiClient,listener);
    connection.open(parameters);
    connections.put(connection.getId(),connection);
    state=DeviceState.BUSY;
    return connection;
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Create an outgoing connection to an endpoint
 * @param parameters Parameters such as the endpoint we want to connect to or SIP custom headers. Ifyou want to pass SIP custom headers, you need to add a separate (String, String) HashMap inside 'parameters' hash and introduce your headers there. For an example please check HelloWorld or Messenger samples.
 * @param listener   The listener object that will receive events when the connection state changes
 * @return An RCConnection object representing the new connection or null in case of error. Errormeans that RCDevice.state not ready to make a call (this usually means no WiFi available)
 */
public RCConnection connect(Map<String,Object> parameters,RCConnectionListener listener){
  RCLogger.i(TAG,"String_Node_Str" + parameters.toString());
  if (cachedConnectivityStatus == RCDeviceListener.RCConnectivityStatus.RCConnectivityStatusNone) {
    String username="String_Node_Str";
    if (parameters != null && parameters.get("String_Node_Str") != null)     username=parameters.get("String_Node_Str").toString();
    sendQoSNoConnectionIntent(username,this.getConnectivityStatus().toString());
  }
  if (state == DeviceState.READY) {
    RCLogger.i(TAG,"String_Node_Str");
    RCConnection connection=new RCConnection(null,false,RCConnection.ConnectionState.PENDING,this,uiClient,listener);
    connection.open(parameters);
    connections.put(connection.getId(),connection);
    state=DeviceState.BUSY;
    return connection;
  }
 else {
    return null;
  }
}
Program: 33134
Project: 33134
Buggy source:
public void onReconfigureReply(String id,RCClient.ErrorCodes status,String text){
  if (status == RCClient.ErrorCodes.SUCCESS) {
    RCLogger.i(TAG,"String_Node_Str" + id + "String_Node_Str"+ text);
  }
 else {
    RCLogger.i(TAG,"String_Node_Str" + id + "String_Node_Str"+ text);
  }
}

Fixed version (ground truth):
public void onReconfigureReply(String id,RCDeviceListener.RCConnectivityStatus connectivityStatus,RCClient.ErrorCodes status,String text){
  cachedConnectivityStatus=connectivityStatus;
  if (status == RCClient.ErrorCodes.SUCCESS) {
    RCLogger.i(TAG,"String_Node_Str" + id + "String_Node_Str"+ text);
    state=DeviceState.READY;
    listener.onStartListening(this,connectivityStatus);
  }
 else {
    RCLogger.i(TAG,"String_Node_Str" + id + "String_Node_Str"+ text);
    state=DeviceState.OFFLINE;
    listener.onStopListening(this,status.ordinal(),text);
  }
}
Program: 33135
Project: 33135
Buggy source:
/** 
 * RCDevice started listening for incoming connections (<b>Not Implemented yet</b>)
 * @param device Device of interest
 */
void onStartListening(RCDevice device);

Fixed version (ground truth):
/** 
 * RCDevice started listening for incoming connections
 * @param device Device of interest
 * @param connectivityStatus Connectivity status when started listening
 */
void onStartListening(RCDevice device,RCDeviceListener.RCConnectivityStatus connectivityStatus);
Program: 33136
Project: 33136
Buggy source:
public ClientTransaction jainSipCallHangup(JainSipJob jainSipJob,HashMap<String,Object> clientConfiguration) throws JainSipException {
  RCLogger.i(TAG,"String_Node_Str" + jainSipJob.id);
  Request byeRequest=null;
  try {
    byeRequest=jainSipClient.jainSipMessageBuilder.buildByeRequest(jainSipJob.transaction.getDialog(),clientConfiguration);
    RCLogger.v(TAG,"String_Node_Str" + byeRequest.toString());
    ClientTransaction transaction=jainSipClient.jainSipProvider.getNewClientTransaction(byeRequest);
    jainSipJob.transaction.getDialog().sendRequest(transaction);
    jainSipJob.updateTransaction(transaction);
    return transaction;
  }
 catch (  SipException e) {
    throw new JainSipException(RCClient.ErrorCodes.ERROR_SIGNALING_CALL_HANGUP_FAILED,RCClient.errorText(RCClient.ErrorCodes.ERROR_SIGNALING_CALL_HANGUP_FAILED));
  }
catch (  Exception e) {
    throw new RuntimeException("String_Node_Str");
  }
}

Fixed version (ground truth):
public ClientTransaction jainSipCallHangup(JainSipJob jainSipJob,HashMap<String,Object> clientConfiguration) throws JainSipException {
  RCLogger.i(TAG,"String_Node_Str" + jainSipJob.id);
  Request byeRequest=null;
  try {
    byeRequest=jainSipClient.jainSipMessageBuilder.buildByeRequest(jainSipJob.transaction.getDialog(),clientConfiguration);
    RCLogger.v(TAG,"String_Node_Str" + byeRequest.toString());
    ClientTransaction transaction=jainSipClient.jainSipProvider.getNewClientTransaction(byeRequest);
    jainSipJob.transaction.getDialog().sendRequest(transaction);
    jainSipJob.updateTransaction(transaction);
    return transaction;
  }
 catch (  SipException e) {
    throw new JainSipException(RCClient.ErrorCodes.ERROR_SIGNALING_CALL_HANGUP_FAILED,RCClient.errorText(RCClient.ErrorCodes.ERROR_SIGNALING_CALL_HANGUP_FAILED));
  }
catch (  Exception e) {
    e.printStackTrace();
    throw new RuntimeException("String_Node_Str");
  }
}
Program: 33137
Project: 33137
Buggy source:
public void onInitialized(RCDevice device,RCDeviceListener.RCConnectivityStatus connectivityStatus,int statusCode,String statusText){
  if (statusCode == RCClient.ErrorCodes.SUCCESS.ordinal()) {
    handleConnectivityUpdate(connectivityStatus,"String_Node_Str" + connectivityStatus);
  }
 else   if (statusCode == RCClient.ErrorCodes.ERROR_NO_CONNECTIVITY.ordinal()) {
    handleConnectivityUpdate(connectivityStatus,null);
  }
 else {
    Toast.makeText(getApplicationContext(),"String_Node_Str" + statusText,Toast.LENGTH_LONG).show();
  }
}

Fixed version (ground truth):
public void onInitialized(RCDevice device,RCDeviceListener.RCConnectivityStatus connectivityStatus,int statusCode,String statusText){
  if (statusCode == RCClient.ErrorCodes.SUCCESS.ordinal()) {
    handleConnectivityUpdate(connectivityStatus,"String_Node_Str" + connectivityStatus);
  }
 else   if (statusCode == RCClient.ErrorCodes.ERROR_DEVICE_NO_CONNECTIVITY.ordinal()) {
    handleConnectivityUpdate(connectivityStatus,null);
  }
 else {
    Toast.makeText(getApplicationContext(),"String_Node_Str" + statusText,Toast.LENGTH_LONG).show();
  }
}
Program: 33139
Project: 33139
Buggy source:
@Override public void onIceServersError(final String description){
  Handler mainHandler=new Handler(RCClient.getContext().getMainLooper());
  Runnable myRunnable=new Runnable(){
    @Override public void run(){
      RCConnection.this.listener.onDisconnected(RCConnection.this,RCClient.ErrorCodes.WEBRTC_TURN_ERROR.ordinal(),description);
    }
  }
;
  mainHandler.post(myRunnable);
}

Fixed version (ground truth):
@Override public void onIceServersError(final String description){
  Handler mainHandler=new Handler(RCClient.getContext().getMainLooper());
  Runnable myRunnable=new Runnable(){
    @Override public void run(){
      RCConnection.this.listener.onDisconnected(RCConnection.this,RCClient.ErrorCodes.ERROR_CONNECTION_WEBRTC_TURN_ERROR.ordinal(),description);
    }
  }
;
  mainHandler.post(myRunnable);
}
Program: 33140
Project: 33140
Buggy source:
@Override public void onPeerConnectionError(final String description){
  final RCConnection connection=this;
  Handler mainHandler=new Handler(RCClient.getContext().getMainLooper());
  Runnable myRunnable=new Runnable(){
    @Override public void run(){
      RCLogger.e(TAG,"String_Node_Str" + description);
      disconnect();
      if (connection.listener != null) {
        connection.listener.onDisconnected(connection,RCClient.ErrorCodes.WEBRTC_PEERCONNECTION_ERROR.ordinal(),description);
      }
      sendQoSDisconnectErrorIntent(RCClient.ErrorCodes.WEBRTC_PEERCONNECTION_ERROR.ordinal(),description);
    }
  }
;
  mainHandler.post(myRunnable);
}

Fixed version (ground truth):
@Override public void onPeerConnectionError(final String description){
  final RCConnection connection=this;
  Handler mainHandler=new Handler(RCClient.getContext().getMainLooper());
  Runnable myRunnable=new Runnable(){
    @Override public void run(){
      RCLogger.e(TAG,"String_Node_Str" + description);
      disconnect();
      if (connection.listener != null) {
        connection.listener.onDisconnected(connection,RCClient.ErrorCodes.ERROR_CONNECTION_WEBRTC_PEERCONNECTION_ERROR.ordinal(),description);
      }
      sendQoSDisconnectErrorIntent(RCClient.ErrorCodes.ERROR_CONNECTION_WEBRTC_PEERCONNECTION_ERROR.ordinal(),description);
    }
  }
;
  mainHandler.post(myRunnable);
}
Program: 33141
Project: 33141
Buggy source:
private boolean haveConnectivity(){
  if (device == null) {
    return false;
  }
  RCDeviceListener.RCConnectivityStatus state=device.getConnectivityStatus();
  if (state == RCDeviceListener.RCConnectivityStatus.RCConnectivityStatusWiFi || state == RCDeviceListener.RCConnectivityStatus.RCConnectivityStatusCellular) {
    return true;
  }
 else {
    if (this.listener != null) {
      this.listener.onDisconnected(this,RCClient.ErrorCodes.NO_CONNECTIVITY.ordinal(),RCClient.errorText(RCClient.ErrorCodes.NO_CONNECTIVITY));
    }
    sendQoSDisconnectErrorIntent(RCClient.ErrorCodes.NO_CONNECTIVITY.ordinal(),RCClient.errorText(RCClient.ErrorCodes.NO_CONNECTIVITY));
    return false;
  }
}

Fixed version (ground truth):
private boolean haveConnectivity(){
  if (device == null) {
    return false;
  }
  RCDeviceListener.RCConnectivityStatus state=device.getConnectivityStatus();
  if (state == RCDeviceListener.RCConnectivityStatus.RCConnectivityStatusWiFi || state == RCDeviceListener.RCConnectivityStatus.RCConnectivityStatusCellular) {
    return true;
  }
 else {
    if (this.listener != null) {
      this.listener.onDisconnected(this,RCClient.ErrorCodes.ERROR_DEVICE_NO_CONNECTIVITY.ordinal(),RCClient.errorText(RCClient.ErrorCodes.ERROR_DEVICE_NO_CONNECTIVITY));
    }
    sendQoSDisconnectErrorIntent(RCClient.ErrorCodes.ERROR_DEVICE_NO_CONNECTIVITY.ordinal(),RCClient.errorText(RCClient.ErrorCodes.ERROR_DEVICE_NO_CONNECTIVITY));
    return false;
  }
}
Program: 33142
Project: 33142
Buggy source:
public void onOpenReply(String id,boolean successful,String text){
  if (successful) {
    RCLogger.i(TAG,"String_Node_Str" + id + "String_Node_Str"+ text);
  }
 else {
    RCLogger.i(TAG,"String_Node_Str" + id + "String_Node_Str"+ text);
  }
}

Fixed version (ground truth):
public void onOpenReply(String id,RCClient.ErrorCodes status,String text){
  if (status == RCClient.ErrorCodes.SUCCESS) {
    RCLogger.i(TAG,"String_Node_Str" + id + "String_Node_Str"+ text);
  }
 else {
    RCLogger.i(TAG,"String_Node_Str" + id + "String_Node_Str"+ text);
  }
}
Program: 33143
Project: 33143
Buggy source:
public abstract void onOpenReply(String id,boolean successful,String text);

Fixed version (ground truth):
public abstract void onOpenReply(String id,RCClient.ErrorCodes status,String text);
Program: 33144
Project: 33144
Buggy source:
@Override public void handleMessage(Message inputMessage){
  SignalingMessage message=(SignalingMessage)inputMessage.obj;
  if (message.type == SignalingMessage.MessageType.OPEN_REPLY) {
    listener.onOpenReply(message.id,message.successful,message.text);
  }
 else   if (message.type == SignalingMessage.MessageType.CALL_REPLY) {
  }
 else   if (message.type == SignalingMessage.MessageType.CALL_EVENT) {
  }
}

Fixed version (ground truth):
@Override public void handleMessage(Message inputMessage){
  SignalingMessage message=(SignalingMessage)inputMessage.obj;
  if (message.type == SignalingMessage.MessageType.OPEN_REPLY) {
    listener.onOpenReply(message.id,message.status,message.text);
  }
 else   if (message.type == SignalingMessage.MessageType.CALL_REPLY) {
  }
 else   if (message.type == SignalingMessage.MessageType.CALL_EVENT) {
  }
}
Program: 33145
Project: 33145
Buggy source:
@Override public Dialog onCreateDialog(Bundle savedInstanceState){
  String title="String_Node_Str";
  String positiveText="String_Node_Str";
  if (getArguments().getInt("String_Node_Str") == DIALOG_TYPE_UPDATE_CONTACT) {
    title="String_Node_Str";
    positiveText="String_Node_Str";
  }
  View view=getActivity().getLayoutInflater().inflate(R.layout.fragment_dialog_add_contact,null);
  txtUsername=(EditText)view.findViewById(R.id.editText_username);
  txtSipuri=(EditText)view.findViewById(R.id.editText_sipuri);
  AlertDialog.Builder builder=new AlertDialog.Builder(getActivity());
  builder.setView(view).setTitle(title).setPositiveButton(positiveText,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int whichButton){
      listener.onDialogPositiveClick(getArguments().getInt("String_Node_Str"),txtUsername.getText().toString(),txtSipuri.getText().toString());
    }
  }
).setNegativeButton("String_Node_Str",new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int whichButton){
      listener.onDialogNegativeClick();
    }
  }
);
  return builder.create();
}

Fixed version (ground truth):
@Override public Dialog onCreateDialog(Bundle savedInstanceState){
  View view=getActivity().getLayoutInflater().inflate(R.layout.fragment_dialog_add_contact,null);
  txtUsername=(EditText)view.findViewById(R.id.editText_username);
  txtSipuri=(EditText)view.findViewById(R.id.editText_sipuri);
  String title="String_Node_Str";
  String positiveText="String_Node_Str";
  if (getArguments().getInt("String_Node_Str") == DIALOG_TYPE_UPDATE_CONTACT) {
    title="String_Node_Str";
    positiveText="String_Node_Str";
    txtUsername.setText(getArguments().getString("String_Node_Str","String_Node_Str"));
    txtSipuri.setText(getArguments().getString("String_Node_Str","String_Node_Str"));
    txtSipuri.setEnabled(false);
  }
  AlertDialog.Builder builder=new AlertDialog.Builder(getActivity());
  builder.setView(view).setTitle(title).setPositiveButton(positiveText,new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int whichButton){
      listener.onDialogPositiveClick(getArguments().getInt("String_Node_Str"),txtUsername.getText().toString(),txtSipuri.getText().toString());
    }
  }
).setNegativeButton("String_Node_Str",new DialogInterface.OnClickListener(){
    public void onClick(    DialogInterface dialog,    int whichButton){
      listener.onDialogNegativeClick();
    }
  }
);
  return builder.create();
}
Program: 33146
Project: 33146
Buggy source:
public void onDialogPositiveClick(int type,String username,String sipuri){
  if (type == AddUserDialogFragment.DIALOG_TYPE_ADD_CONTACT) {
    this.contactsController.addContact(contactList,username,sipuri);
  }
 else {
    this.contactsController.updateContact(contactList,username,sipuri);
  }
  this.listViewAdapter.notifyDataSetChanged();
}

Fixed version (ground truth):
public void onDialogPositiveClick(int type,String username,String sipuri){
  if (type == AddUserDialogFragment.DIALOG_TYPE_ADD_CONTACT) {
    if (username.isEmpty() || sipuri.isEmpty()) {
      showOkAlert("String_Node_Str","String_Node_Str");
      return;
    }
 else {
      this.contactsController.addContact(contactList,username,sipuri);
    }
  }
 else {
    this.contactsController.updateContact(contactList,username,sipuri);
  }
  this.listViewAdapter.notifyDataSetChanged();
}
Program: 33147
Project: 33147
Buggy source:
void addContact(ArrayList<Map<String,String>> list,String username,String sipuri){
  if (prefsContacts.getString(sipuri,"String_Node_Str").equals("String_Node_Str")) {
    SharedPreferences.Editor prefEdit=prefsContacts.edit();
    prefEdit.putString(sipuri,username);
    prefEdit.commit();
  }
 else {
    Log.w(TAG,"String_Node_Str" + username + "String_Node_Str"+ sipuri);
  }
  list.add(createEntry(sipuri,username));
}

Fixed version (ground truth):
void addContact(ArrayList<Map<String,String>> list,String username,String sipuri){
  if (prefsContacts.getString(sipuri,"String_Node_Str").equals("String_Node_Str")) {
    SharedPreferences.Editor prefEdit=prefsContacts.edit();
    prefEdit.putString(sipuri,username);
    prefEdit.commit();
  }
 else {
    Log.w(TAG,"String_Node_Str" + username + "String_Node_Str"+ sipuri);
    return;
  }
  list.add(createEntry(sipuri,username));
}
Program: 33148
Project: 33148
Buggy source:
void updateContact(ArrayList<Map<String,String>> list,String username,String sipuri){
  if (!prefsContacts.getString(sipuri,"String_Node_Str").equals("String_Node_Str")) {
    SharedPreferences.Editor prefEdit=prefsContacts.edit();
    prefEdit.putString(sipuri,username);
    prefEdit.commit();
  }
 else {
    Log.w(TAG,"String_Node_Str" + username + "String_Node_Str"+ sipuri);
  }
  HashMap<String,String> map=new HashMap<String,String>();
  map.put("String_Node_Str",sipuri);
  map.put("String_Node_Str",username);
  int index=0;
  if ((index=list.indexOf(map)) != -1) {
    list.set(index,map);
  }
 else {
    Log.w(TAG,"String_Node_Str" + username + "String_Node_Str"+ sipuri);
  }
}

Fixed version (ground truth):
void updateContact(ArrayList<Map<String,String>> list,String username,String sipuri){
  if (!prefsContacts.getString(sipuri,"String_Node_Str").equals("String_Node_Str")) {
    SharedPreferences.Editor prefEdit=prefsContacts.edit();
    prefEdit.putString(sipuri,username);
    prefEdit.commit();
  }
 else {
    Log.w(TAG,"String_Node_Str" + username + "String_Node_Str"+ sipuri);
    return;
  }
  int index=0;
  boolean found=false;
  for (  Map<String,String> item : list) {
    if (item.containsValue(sipuri)) {
      found=true;
      break;
    }
    index++;
  }
  if (found) {
    HashMap<String,String> map=new HashMap<String,String>();
    map.put("String_Node_Str",sipuri);
    map.put("String_Node_Str",username);
    list.set(index,map);
  }
}
Program: 33149
Project: 33149
Buggy source:
private static Path findBestJar(Path origJarPath,Path updatesDirectory) throws IOException {
  if (!Files.isDirectory(updatesDirectory))   throw new IllegalArgumentException("String_Node_Str" + updatesDirectory);
  int bestUpdateSeen=extractVerFromFilename(origJarPath);
  Path bestJarSeen=null;
  for (  Path path : Utils.listDir(updatesDirectory)) {
    try {
      int n=extractVerFromFilename(path);
      if (n > -1) {
        log.debug("String_Node_Str",path);
        if (n > bestUpdateSeen) {
          bestUpdateSeen=n;
          bestJarSeen=path;
        }
      }
    }
 catch (    NumberFormatException e) {
      log.warn("String_Node_Str",path);
    }
  }
  if (bestJarSeen == null)   bestJarSeen=origJarPath;
  return bestJarSeen;
}

Fixed version (ground truth):
static Path findBestJar(Path origJarPath,Path updatesDirectory) throws IOException {
  if (!Files.isDirectory(updatesDirectory))   throw new IllegalArgumentException("String_Node_Str" + updatesDirectory);
  int bestUpdateSeen=extractVerFromFilename(origJarPath);
  Path bestJarSeen=null;
  for (  Path path : Utils.listDir(updatesDirectory)) {
    try {
      int n=extractVerFromFilename(path);
      if (n > -1) {
        if (n > bestUpdateSeen) {
          bestUpdateSeen=n;
          bestJarSeen=path;
        }
      }
    }
 catch (    NumberFormatException e) {
      log.warn("String_Node_Str",path);
    }
  }
  if (bestJarSeen == null)   bestJarSeen=origJarPath;
  return bestJarSeen;
}
Program: 33150
Project: 33150
Buggy source:
private static int extractVerFromFilename(Path path){
  String fn=path.getFileName().toString();
  if (!fn.endsWith("String_Node_Str"))   return -1;
  fn=fn.substring(0,fn.length() - 4);
  try {
    return Integer.parseInt(fn);
  }
 catch (  NumberFormatException e) {
    return -1;
  }
}

Fixed version (ground truth):
static int extractVerFromFilename(Path path){
  String fn=path.getFileName().toString();
  if (!fn.endsWith("String_Node_Str"))   return -1;
  fn=fn.substring(0,fn.length() - 4);
  try {
    return Integer.parseInt(fn);
  }
 catch (  NumberFormatException e) {
    return -1;
  }
}
Program: 33151
Project: 33151
Buggy source:
/** 
 * Writes a text file to the app install dir containing the given version number. It is read at startup and prevents the highest version from being used.
 */
public static void pinToVersion(Path updatesDirectory,int version){
  try {
    Path pinPath=updatesDirectory.resolve(VERSION_PIN_FILE_NAME);
    Files.write(pinPath,String.valueOf(version).getBytes(),StandardOpenOption.CREATE_NEW);
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
/** 
 * Writes a text file to the app install dir containing the given version number. It is read at startup and prevents the highest version from being used.
 */
public static void pinToVersion(Path updatesDirectory,int version){
  try {
    Path pinPath=updatesDirectory.resolve(VERSION_PIN_FILE_NAME);
    Files.write(pinPath,String.valueOf(version).getBytes(),StandardOpenOption.WRITE,StandardOpenOption.CREATE);
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
}
Program: 33152
Project: 33152
Buggy source:
@Override protected UpdateSummary call() throws Exception {
  UFXProtocol.Updates updates=processSignedIndex(downloadSignedIndex());
  return new UpdateSummary(newHighestVersion,updates);
}

Fixed version (ground truth):
@Override protected UpdateSummary call() throws Exception {
  highestLocalVersion=UpdateFX.extractVerFromFilename(UpdateFX.findBestJar(pathToOrigJar,localUpdatesDir));
  newHighestVersion=highestLocalVersion;
  UFXProtocol.Updates updates=processSignedIndex(downloadSignedIndex());
  return new UpdateSummary(newHighestVersion,updates);
}
Program: 33154
Project: 33154
Buggy source:
private void processDownloadedUpdates(List<UFXProtocol.Update> updates,List<Path> files) throws IOException, Ex.BadUpdateHash {
  int cursor=0;
  for (  Path path : files) {
    UFXProtocol.Update update=updates.get(cursor);
    Path base=pathToOrigJar;
    if (update.getVersion() > currentVersion + 1)     base=localUpdatesDir.resolve((update.getVersion() - 1) + "String_Node_Str");
    Path next=localUpdatesDir.resolve(update.getVersion() + "String_Node_Str");
    log.info("String_Node_Str",path,base);
    byte[] preHash=sha256(readAllBytes(base));
    if (!Arrays.equals(preHash,update.getPreHash().toByteArray()))     throw new Ex.BadUpdateHash();
    if (update.getGzipped()) {
      try (RandomAccessFileSeekableSource baseSource=new RandomAccessFileSeekableSource(new RandomAccessFile(base.toFile(),"String_Node_Str"));InputStream patchStream=new GZIPInputStream(new BufferedInputStream(Files.newInputStream(path)));OutputStream nextStream=new BufferedOutputStream(Files.newOutputStream(next))){
        new GDiffPatcher().patch(baseSource,patchStream,nextStream);
      }
     }
 else {
      new GDiffPatcher().patch(base.toFile(),path.toFile(),next.toFile());
    }
    byte[] postHash=sha256(readAllBytes(next));
    if (!Arrays.equals(postHash,update.getPostHash().toByteArray()))     throw new Ex.BadUpdateHash();
    checkState(update.getVersion() > newHighestVersion);
    newHighestVersion=update.getVersion();
    cursor++;
  }
}

Fixed version (ground truth):
private void processDownloadedUpdates(List<UFXProtocol.Update> updates,List<Path> files) throws IOException, Ex.BadUpdateHash {
  int cursor=0;
  for (  Path path : files) {
    UFXProtocol.Update update=updates.get(cursor);
    Path base=pathToOrigJar;
    if (update.getVersion() > highestLocalVersion + 1)     base=localUpdatesDir.resolve((update.getVersion() - 1) + "String_Node_Str");
    Path next=localUpdatesDir.resolve(update.getVersion() + "String_Node_Str");
    log.info("String_Node_Str",path,base);
    byte[] preHash=sha256(readAllBytes(base));
    if (!Arrays.equals(preHash,update.getPreHash().toByteArray()))     throw new Ex.BadUpdateHash();
    if (update.getGzipped()) {
      try (RandomAccessFileSeekableSource baseSource=new RandomAccessFileSeekableSource(new RandomAccessFile(base.toFile(),"String_Node_Str"));InputStream patchStream=new GZIPInputStream(new BufferedInputStream(Files.newInputStream(path)));OutputStream nextStream=new BufferedOutputStream(Files.newOutputStream(next))){
        new GDiffPatcher().patch(baseSource,patchStream,nextStream);
      }
     }
 else {
      new GDiffPatcher().patch(base.toFile(),path.toFile(),next.toFile());
    }
    byte[] postHash=sha256(readAllBytes(next));
    if (!Arrays.equals(postHash,update.getPostHash().toByteArray()))     throw new Ex.BadUpdateHash();
    checkState(update.getVersion() > newHighestVersion);
    newHighestVersion=update.getVersion();
    cursor++;
  }
}
Program: 33155
Project: 33155
Buggy source:
public Updater(String updateBaseURL,String userAgent,int currentVersion,Path localUpdatesDir,Path pathToOrigJar,List<ECPoint> pubkeys,int requiredSigningThreshold){
  this.updateBaseURL=updateBaseURL.endsWith("String_Node_Str") ? updateBaseURL.substring(0,updateBaseURL.length() - 1) : updateBaseURL;
  this.userAgent=userAgent;
  this.currentVersion=currentVersion;
  this.localUpdatesDir=localUpdatesDir;
  this.pathToOrigJar=pathToOrigJar;
  this.pubkeys=pubkeys;
  this.requiredSigningThreshold=requiredSigningThreshold;
  newHighestVersion=currentVersion;
}

Fixed version (ground truth):
public Updater(String updateBaseURL,String userAgent,int currentVersion,Path localUpdatesDir,Path pathToOrigJar,List<ECPoint> pubkeys,int requiredSigningThreshold){
  this.updateBaseURL=updateBaseURL.endsWith("String_Node_Str") ? updateBaseURL.substring(0,updateBaseURL.length() - 1) : updateBaseURL;
  this.userAgent=userAgent;
  this.localUpdatesDir=localUpdatesDir;
  this.pathToOrigJar=pathToOrigJar;
  this.pubkeys=pubkeys;
  this.requiredSigningThreshold=requiredSigningThreshold;
}
Program: 33156
Project: 33156
Buggy source:
private UFXProtocol.Updates processSignedIndex(UFXProtocol.SignedUpdates signedUpdates) throws IOException, URISyntaxException, Ex, SignatureException {
  UFXProtocol.Updates updates=validateSignatures(signedUpdates);
  if (updates.getVersion() != 1)   throw new Ex.UnknownIndexVersion();
  LinkedList<UFXProtocol.Update> applicableUpdates=new LinkedList<>();
  long bytesToFetch=0;
  for (  UFXProtocol.Update update : updates.getUpdatesList()) {
    if (update.getVersion() > currentVersion) {
      applicableUpdates.add(update);
      bytesToFetch+=update.getPatchSize();
    }
  }
  if (applicableUpdates.isEmpty()) {
    log.info("String_Node_Str");
    Updater.this.updateProgress(1L,1L);
  }
 else {
    log.info("String_Node_Str",applicableUpdates.size(),bytesToFetch);
    List<Path> downloadedUpdates=downloadUpdates(applicableUpdates,bytesToFetch);
    processDownloadedUpdates(applicableUpdates,downloadedUpdates);
  }
  return updates;
}

Fixed version (ground truth):
private UFXProtocol.Updates processSignedIndex(UFXProtocol.SignedUpdates signedUpdates) throws IOException, URISyntaxException, Ex, SignatureException {
  UFXProtocol.Updates updates=validateSignatures(signedUpdates);
  if (updates.getVersion() != 1)   throw new Ex.UnknownIndexVersion();
  LinkedList<UFXProtocol.Update> applicableUpdates=new LinkedList<>();
  long bytesToFetch=0;
  for (  UFXProtocol.Update update : updates.getUpdatesList()) {
    if (update.getVersion() > highestLocalVersion) {
      applicableUpdates.add(update);
      bytesToFetch+=update.getPatchSize();
    }
  }
  if (applicableUpdates.isEmpty()) {
    log.info("String_Node_Str");
  }
 else {
    log.info("String_Node_Str",applicableUpdates.size(),bytesToFetch);
    List<Path> downloadedUpdates=downloadUpdates(applicableUpdates,bytesToFetch);
    processDownloadedUpdates(applicableUpdates,downloadedUpdates);
  }
  return updates;
}
Program: 33157
Project: 33157
Buggy source:
public TestUpdater(String updateBaseURL,String userAgent,int currentVersion,Path localUpdatesDir,Path pathToOrigJar){
  super(updateBaseURL,userAgent,currentVersion,localUpdatesDir,pathToOrigJar,pubKeys,2);
}

Fixed version (ground truth):
public TestUpdater(String updateBaseURL,String userAgent,int currentVersion,Path localUpdatesDir,Path pathToOrigJar){
  super(updateBaseURL,userAgent,currentVersion,localUpdatesDir,pathToOrigJar == null ? Paths.get("String_Node_Str") : pathToOrigJar,pubKeys,2);
}
Program: 33158
Project: 33158
Buggy source:
public static List<Result> process(Path inDir,Path outDir,int gzipFrom) throws IOException {
  List<Result> result=new ArrayList<>();
  int num=2;
  while (true) {
    Path cur=inDir.resolve(num + "String_Node_Str");
    Path prev=inDir.resolve((num - 1) + "String_Node_Str");
    if (!(isRegularFile(cur) && isRegularFile(prev))) {
      break;
    }
    println("String_Node_Str",cur,prev);
    Result deltaHashes=new Result();
    Path deltaFile=outDir.resolve(cur.getFileName().toString() + "String_Node_Str");
    deleteIfExists(deltaFile);
    deltaHashes.path=deltaFile;
    try (HashingOutputStream hashingStream=new HashingOutputStream(Hashing.sha256(),new BufferedOutputStream(newOutputStream(deltaFile,StandardOpenOption.CREATE_NEW)))){
      GZIPOutputStream zipStream=new GZIPOutputStream(hashingStream);
      boolean isGzipping=num >= gzipFrom;
      GDiffWriter writer=new GDiffWriter(isGzipping ? zipStream : hashingStream);
      Delta delta=new Delta();
      deltaHashes.preHash=sha256(readAllBytes(prev));
      delta.compute(prev.toFile(),cur.toFile(),writer);
      if (isGzipping)       zipStream.close();
      deltaHashes.patchHash=hashingStream.hash().asBytes();
      deltaHashes.postHash=sha256(readAllBytes(cur));
    }
     long size=Files.size(deltaFile);
    deltaHashes.patchSize=size;
    println("String_Node_Str",deltaFile,size / 1024.0);
    result.add(deltaHashes);
    num++;
  }
  return result;
}

Fixed version (ground truth):
public static List<Result> process(Path inDir,Path outDir,int gzipFrom) throws IOException {
  List<Result> result=new ArrayList<>();
  int num=2;
  while (true) {
    Path cur=inDir.resolve(num + "String_Node_Str");
    Path prev=inDir.resolve((num - 1) + "String_Node_Str");
    if (!(isRegularFile(cur) && isRegularFile(prev))) {
      break;
    }
    println("String_Node_Str",cur,prev);
    Result deltaHashes=new Result();
    Path deltaFile=outDir.resolve(cur.getFileName().toString() + "String_Node_Str");
    deleteIfExists(deltaFile);
    deltaHashes.path=deltaFile;
    boolean isGzipping=num >= gzipFrom;
    try (HashingOutputStream hashingStream=new HashingOutputStream(Hashing.sha256(),new BufferedOutputStream(newOutputStream(deltaFile,StandardOpenOption.CREATE_NEW)))){
      GZIPOutputStream zipStream=null;
      GDiffWriter writer;
      if (isGzipping) {
        println("String_Node_Str");
        zipStream=new GZIPOutputStream(hashingStream);
        writer=new GDiffWriter(zipStream);
      }
 else {
        writer=new GDiffWriter(hashingStream);
      }
      Delta delta=new Delta();
      deltaHashes.preHash=sha256(readAllBytes(prev));
      delta.compute(prev.toFile(),cur.toFile(),writer);
      if (isGzipping)       zipStream.close();
      deltaHashes.patchHash=hashingStream.hash().asBytes();
      deltaHashes.postHash=sha256(readAllBytes(cur));
    }
     long size=Files.size(deltaFile);
    deltaHashes.patchSize=size;
    println("String_Node_Str",deltaFile,size / 1024.0,isGzipping ? "String_Node_Str" : "String_Node_Str");
    result.add(deltaHashes);
    num++;
  }
  return result;
}
Program: 33160
Project: 33160
Buggy source:
private static void runRealMain(Path appInstallDir,String[] args,Class<?> newClass) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
  Method main=newClass.getMethod("String_Node_Str",Path.class,String[].class);
  main.invoke(null,appInstallDir,args);
}

Fixed version (ground truth):
private static void runRealMain(Path appInstallDir,String[] args,Class<?> newClass) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
  UpdateFX.appInstallDir=appInstallDir;
  UpdateFX.initArgs=args;
  Method main=newClass.getMethod("String_Node_Str",Path.class,String[].class);
  main.invoke(null,appInstallDir,args);
}