nus-yam/ex-repair huggingface dataset:
Program: 59638
Project: 59638
Buggy source:
<TOutput extends Serializable>Tasklet taskletCompleted(final Integer taskletId,final TOutput result){
  final Tasklet<?,TOutput> tasklet=runningTasklets.remove(taskletId);
  assert(tasklet != null);
  tasklet.completed(result);
  return tasklet;
}

Fixed version (ground truth):
<TOutput extends Serializable>Tasklet taskletCompleted(final Integer taskletId,final TOutput result){
}
Program: 59639
Project: 59639
Buggy source:
Tasklet taskletThrewException(final Integer taskletId,final Exception exception){
  final Tasklet tasklet=runningTasklets.remove(taskletId);
  assert(tasklet != null);
  tasklet.threwException(exception);
  return tasklet;
}

Fixed version (ground truth):
Tasklet taskletThrewException(final Integer taskletId,final Exception exception){
}
Program: 59640
Project: 59640
Buggy source:
<TInput extends Serializable,TOutput extends Serializable>void launchTasklet(final Tasklet<TInput,TOutput> tasklet){
  assert(!runningTasklets.containsKey(tasklet.getId()));
  runningTasklets.put(tasklet.getId(),tasklet);
  final TaskletExecutionRequest<TInput,TOutput> taskletExecutionRequest=new TaskletExecutionRequest<>(tasklet.getId(),tasklet.getUserFunction(),tasklet.getInput());
  vortexRequestor.send(reefTask,taskletExecutionRequest);
}

Fixed version (ground truth):
<TInput extends Serializable,TOutput extends Serializable>void launchTasklet(final Tasklet<TInput,TOutput> tasklet){
}
Program: 59642
Project: 59642
Buggy source:
/** 
 * Compare the <b>State</b> of two LauncherStatus objects. Note that it does NOT compare the exceptions - just the states.
 * @return True if both LauncherStatus objects are in the same state.
 */
@Override public boolean equals(final Object other){
  return this == other || (other instanceof LauncherStatus && ((LauncherStatus)other).state == this.state);
}

Fixed version (ground truth):
/** 
 * Compare the <b>State</b> of two LauncherStatus objects. Note that it does NOT compare the exceptions - just the states.
 * @return True if both LauncherStatus objects are in the same state.
 */
@Override public boolean equals(final Object other){
  return this == other || other instanceof LauncherStatus && ((LauncherStatus)other).state == this.state;
}
Program: 59643
Project: 59643
Buggy source:
/** 
 * @param messageSourceID The message's sourceID. This will be accessible in the Driver for routing.
 * @param theBytes        The actual content of the message, serialized into a byte[]
 * @return a new EvaluatorMessage with the given content.
 */
public static ContextMessage from(final String messageSourceID,final byte[] theBytes){
  assert(theBytes != null && messageSourceID != null);
  return new ContextMessage(messageSourceID,theBytes);
}

Fixed version (ground truth):
/** 
 * @param messageSourceID The message's sourceID. This will be accessible in the Driver for routing.
 * @param theBytes        The actual content of the message, serialized into a byte[]
 * @return a new EvaluatorMessage with the given content.
 */
public static ContextMessage from(final String messageSourceID,final byte[] theBytes){
}
Program: 59644
Project: 59644
Buggy source:
public ServiceRuntimeException(final Throwable cause){
  super(cause);
  this.isWrappedServiceException=(cause instanceof ServiceException);
}

Fixed version (ground truth):
public ServiceRuntimeException(final Throwable cause){
  super(cause);
  this.isWrappedServiceException=cause instanceof ServiceException;
}
Program: 59645
Project: 59645
Buggy source:
/** 
 * Inform the client of a failed job.
 * @param jobStatusProto
 */
private synchronized void onJobFailure(final JobStatusProto jobStatusProto){
  assert(jobStatusProto.getState() == ReefServiceProtos.State.FAILED);
  final String id=this.jobId;
  final Optional<byte[]> data=jobStatusProto.hasException() ? Optional.of(jobStatusProto.getException().toByteArray()) : Optional.<byte[]>empty();
  final Optional<Throwable> cause=this.exceptionCodec.fromBytes(data);
  final String message=cause.isPresent() ? cause.get().getMessage() : "String_Node_Str";
  final Optional<String> description=Optional.of(message);
  final FailedJob failedJob=new FailedJob(id,message,description,cause,data);
  this.failedJobEventHandler.onNext(failedJob);
}

Fixed version (ground truth):
/** 
 * Inform the client of a failed job.
 * @param jobStatusProto status of the failed job
 */
private synchronized void onJobFailure(final JobStatusProto jobStatusProto){
}
Program: 59646
Project: 59646
Buggy source:
@Override public synchronized void onJobStatusMessage(final RemoteMessage<ReefServiceProtos.JobStatusProto> message){
  final ReefServiceProtos.JobStatusProto status=message.getMessage();
  final String jobIdentifier=status.getIdentifier();
  LOG.log(Level.FINE,"String_Node_Str" + jobIdentifier);
  if (status.getState() == ReefServiceProtos.State.INIT) {
    try {
      final RunningJobImpl runningJob=this.newRunningJob(status.getIdentifier(),message.getIdentifier().toString());
      this.put(runningJob);
    }
 catch (    final BindException|InjectionException configError) {
      throw new RuntimeException("String_Node_Str" + status,configError);
    }
  }
  this.get(jobIdentifier).onNext(status);
  if ((status.getState() != ReefServiceProtos.State.RUNNING) && (status.getState() != ReefServiceProtos.State.INIT)) {
    this.remove(status.getIdentifier());
  }
  LOG.log(Level.FINE,"String_Node_Str" + jobIdentifier);
}

Fixed version (ground truth):
@Override public synchronized void onJobStatusMessage(final RemoteMessage<ReefServiceProtos.JobStatusProto> message){
  final ReefServiceProtos.JobStatusProto status=message.getMessage();
  final String jobIdentifier=status.getIdentifier();
  LOG.log(Level.FINE,"String_Node_Str" + jobIdentifier);
  if (status.getState() == ReefServiceProtos.State.INIT) {
    try {
      final RunningJobImpl runningJob=this.newRunningJob(status.getIdentifier(),message.getIdentifier().toString());
      this.put(runningJob);
    }
 catch (    final BindException|InjectionException configError) {
      throw new RuntimeException("String_Node_Str" + status,configError);
    }
  }
  this.get(jobIdentifier).onNext(status);
  if (status.getState() != ReefServiceProtos.State.RUNNING && status.getState() != ReefServiceProtos.State.INIT) {
    this.remove(status.getIdentifier());
  }
  LOG.log(Level.FINE,"String_Node_Str" + jobIdentifier);
}
Program: 59647
Project: 59647
Buggy source:
/** 
 * Process a message with status READY from a context.
 * @param contextStatusProto
 * @param notifyClientOnNewActiveContext whether or not to inform the application when this in fact refers to a newcontext.
 */
private synchronized void onContextReady(final ReefServiceProtos.ContextStatusProto contextStatusProto,final boolean notifyClientOnNewActiveContext){
  assert(ReefServiceProtos.ContextStatusProto.State.READY == contextStatusProto.getContextState());
  final String contextID=contextStatusProto.getContextId();
  if (this.isUnknownContextId(contextID)) {
    this.onNewContext(contextStatusProto,notifyClientOnNewActiveContext);
  }
  for (  final ReefServiceProtos.ContextStatusProto.ContextMessageProto contextMessageProto : contextStatusProto.getContextMessageList()) {
    final byte[] theMessage=contextMessageProto.getMessage().toByteArray();
    final String sourceID=contextMessageProto.getSourceId();
    this.messageDispatcher.onContextMessage(new ContextMessageImpl(theMessage,contextID,sourceID));
  }
}

Fixed version (ground truth):
/** 
 * Process a message with status READY from a context.
 * @param contextStatusProto
 * @param notifyClientOnNewActiveContext whether or not to inform the application when this in fact refers to a newcontext.
 */
private synchronized void onContextReady(final ReefServiceProtos.ContextStatusProto contextStatusProto,final boolean notifyClientOnNewActiveContext){
}
Program: 59648
Project: 59648
Buggy source:
private synchronized void onContextFailed(final ReefServiceProtos.ContextStatusProto contextStatusProto){
  assert(ReefServiceProtos.ContextStatusProto.State.FAIL == contextStatusProto.getContextState());
  final String contextID=contextStatusProto.getContextId();
  LOG.log(Level.FINE,"String_Node_Str",contextID);
  if (this.isUnknownContextId(contextID)) {
    this.onNewContext(contextStatusProto,false);
  }
  final EvaluatorContext context=getContext(contextID);
  this.removeContext(context);
  this.messageDispatcher.onContextFailed(context.getFailedContext(contextStatusProto));
}

Fixed version (ground truth):
private synchronized void onContextFailed(final ReefServiceProtos.ContextStatusProto contextStatusProto){
}
Program: 59649
Project: 59649
Buggy source:
private synchronized void onContextDone(final ReefServiceProtos.ContextStatusProto contextStatusProto){
  assert(ReefServiceProtos.ContextStatusProto.State.DONE == contextStatusProto.getContextState());
  final String contextID=contextStatusProto.getContextId();
  if (isUnknownContextId(contextID)) {
    throw new RuntimeException("String_Node_Str" + contextID + "String_Node_Str");
  }
 else {
    LOG.log(Level.FINE,"String_Node_Str",contextID);
    final EvaluatorContext context=getContext(contextID);
    removeContext(context);
    if (context.isRootContext()) {
      LOG.log(Level.FINE,"String_Node_Str",contextID);
    }
 else {
      final EvaluatorContext parentContext=this.getContext(context.getParentId().get());
      this.messageDispatcher.onContextClose(context.getClosedContext(parentContext));
    }
  }
}

Fixed version (ground truth):
private synchronized void onContextDone(final ReefServiceProtos.ContextStatusProto contextStatusProto){
}
Program: 59650
Project: 59650
Buggy source:
public synchronized FailedContext getFailedContext(final ReefServiceProtos.ContextStatusProto contextStatusProto){
  assert(ReefServiceProtos.ContextStatusProto.State.FAIL == contextStatusProto.getContextState());
  final String id=this.getId();
  final Optional<String> description=Optional.empty();
  final Optional<byte[]> data=contextStatusProto.hasError() ? Optional.of(contextStatusProto.getError().toByteArray()) : Optional.<byte[]>empty();
  final Optional<Throwable> cause=data.isPresent() ? this.exceptionCodec.fromBytes(data) : Optional.<Throwable>empty();
  final String message=cause.isPresent() ? cause.get().getMessage() : "String_Node_Str";
  final Optional<ActiveContext> parentContext=getParentId().isPresent() ? Optional.<ActiveContext>of(this.contextRepresenters.getContext(getParentId().get())) : Optional.<ActiveContext>empty();
  final String evaluatorID=getEvaluatorId();
  return new FailedContextImpl(id,message,description,cause,data,parentContext,this.evaluatorDescriptor,evaluatorID);
}

Fixed version (ground truth):
public synchronized FailedContext getFailedContext(final ReefServiceProtos.ContextStatusProto contextStatusProto){
}
Program: 59651
Project: 59651
Buggy source:
/** 
 * Merges the Configurations provided by the evaluatorConfigurationProviders into the given serviceConfiguration, if any.
 */
private Optional<Configuration> makeRootServiceConfiguration(final Optional<Configuration> serviceConfiguration){
  final EvaluatorType evaluatorType=this.evaluatorManager.getEvaluatorDescriptor().getProcess().getType();
  if (EvaluatorType.CLR == evaluatorType) {
    LOG.log(Level.FINE,"String_Node_Str",evaluatorType);
    return serviceConfiguration;
  }
  if ((!serviceConfiguration.isPresent()) && this.evaluatorConfigurationProviders.isEmpty()) {
    LOG.info("String_Node_Str");
    return Optional.empty();
  }
 else {
    final ConfigurationBuilder configurationBuilder=getConfigurationBuilder(serviceConfiguration);
    for (    final ConfigurationProvider configurationProvider : this.evaluatorConfigurationProviders) {
      configurationBuilder.addConfiguration(configurationProvider.getConfiguration());
    }
    return Optional.of(configurationBuilder.build());
  }
}

Fixed version (ground truth):
/** 
 * Merges the Configurations provided by the evaluatorConfigurationProviders into the given serviceConfiguration, if any.
 */
private Optional<Configuration> makeRootServiceConfiguration(final Optional<Configuration> serviceConfiguration){
  final EvaluatorType evaluatorType=this.evaluatorManager.getEvaluatorDescriptor().getProcess().getType();
  if (EvaluatorType.CLR == evaluatorType) {
    LOG.log(Level.FINE,"String_Node_Str",evaluatorType);
    return serviceConfiguration;
  }
  if (!serviceConfiguration.isPresent() && this.evaluatorConfigurationProviders.isEmpty()) {
    LOG.info("String_Node_Str");
    return Optional.empty();
  }
 else {
    final ConfigurationBuilder configurationBuilder=getConfigurationBuilder(serviceConfiguration);
    for (    final ConfigurationProvider configurationProvider : this.evaluatorConfigurationProviders) {
      configurationBuilder.addConfiguration(configurationProvider.getConfiguration());
    }
    return Optional.of(configurationBuilder.build());
  }
}
Program: 59652
Project: 59652
Buggy source:
/** 
 * Process an evaluator message that indicates a crash.
 * @param evaluatorStatusProto
 */
private synchronized void onEvaluatorFailed(final ReefServiceProtos.EvaluatorStatusProto evaluatorStatusProto){
  assert(evaluatorStatusProto.getState() == ReefServiceProtos.State.FAILED);
  final EvaluatorException evaluatorException;
  if (evaluatorStatusProto.hasError()) {
    final Optional<Throwable> exception=this.exceptionCodec.fromBytes(evaluatorStatusProto.getError().toByteArray());
    if (exception.isPresent()) {
      evaluatorException=new EvaluatorException(getId(),exception.get());
    }
 else {
      evaluatorException=new EvaluatorException(getId(),new Exception("String_Node_Str"));
    }
  }
 else {
    evaluatorException=new EvaluatorException(getId(),new Exception("String_Node_Str"));
  }
  onEvaluatorException(evaluatorException);
}

Fixed version (ground truth):
/** 
 * Process an evaluator message that indicates a crash.
 * @param evaluatorStatusProto
 */
private synchronized void onEvaluatorFailed(final ReefServiceProtos.EvaluatorStatusProto evaluatorStatusProto){
}
Program: 59653
Project: 59653
Buggy source:
/** 
 * Process an evaluator message that indicates that the evaluator shut down cleanly.
 * @param message
 */
private synchronized void onEvaluatorDone(final ReefServiceProtos.EvaluatorStatusProto message){
  assert(message.getState() == ReefServiceProtos.State.DONE);
  LOG.log(Level.FINEST,"String_Node_Str",getId());
  this.stateManager.setDone();
  this.messageDispatcher.onEvaluatorCompleted(new CompletedEvaluatorImpl(this.evaluatorId));
  close();
}

Fixed version (ground truth):
/** 
 * Process an evaluator message that indicates that the evaluator shut down cleanly.
 * @param message
 */
private synchronized void onEvaluatorDone(final ReefServiceProtos.EvaluatorStatusProto message){
}
Program: 59654
Project: 59654
Buggy source:
/** 
 * Return true if the state is DONE, FAILED, or KILLED, <em>and</em> there are no messages queued or in processing.
 */
public boolean isClosed(){
  return this.messageDispatcher.isEmpty() && (this.stateManager.isDoneOrFailedOrKilled());
}

Fixed version (ground truth):
/** 
 * Return true if the state is DONE, FAILED, or KILLED, <em>and</em> there are no messages queued or in processing.
 */
public boolean isClosed(){
  return this.messageDispatcher.isEmpty() && this.stateManager.isDoneOrFailedOrKilled();
}
Program: 59655
Project: 59655
Buggy source:
synchronized boolean isAllocatedOrSubmittedOrRunning(){
  return (this.state == EvaluatorState.ALLOCATED || this.state == EvaluatorState.SUBMITTED || this.state == EvaluatorState.RUNNING);
}

Fixed version (ground truth):
synchronized boolean isAllocatedOrSubmittedOrRunning(){
  return this.state == EvaluatorState.ALLOCATED || this.state == EvaluatorState.SUBMITTED || this.state == EvaluatorState.RUNNING;
}
Program: 59656
Project: 59656
Buggy source:
@Inject Evaluators(){
  LOG.log(Level.FINE,"String_Node_Str");
  assert(SingletonAsserter.assertSingleton(Evaluators.class));
}

Fixed version (ground truth):
@Inject Evaluators(){
}
Program: 59657
Project: 59657
Buggy source:
private synchronized void onRMRunning(final RuntimeStatusEvent runtimeStatusEvent){
  assert(runtimeStatusEvent.getState() == ReefServiceProtos.State.RUNNING);
  if (this.isIdle()) {
    this.driverIdleManager.get().onPotentiallyIdle(IDLE_MESSAGE);
  }
}

Fixed version (ground truth):
private synchronized void onRMRunning(final RuntimeStatusEvent runtimeStatusEvent){
}
Program: 59658
Project: 59658
Buggy source:
private synchronized void onRMFailure(final RuntimeStatusEvent runtimeStatusEvent){
  assert(runtimeStatusEvent.getState() == ReefServiceProtos.State.FAILED);
  this.resourceManagerErrorHandler.onNext(runtimeStatusEvent.getError().get());
}

Fixed version (ground truth):
private synchronized void onRMFailure(final RuntimeStatusEvent runtimeStatusEvent){
}
Program: 59659
Project: 59659
Buggy source:
private synchronized void onRMDone(final RuntimeStatusEvent runtimeStatusEvent){
  assert(runtimeStatusEvent.getState() == ReefServiceProtos.State.DONE);
  LOG.log(Level.INFO,"String_Node_Str");
  this.driverStatusManager.onComplete();
}

Fixed version (ground truth):
private synchronized void onRMDone(final RuntimeStatusEvent runtimeStatusEvent){
}
Program: 59660
Project: 59660
Buggy source:
private void onTaskDone(final ReefServiceProtos.TaskStatusProto taskStatusProto){
  assert(ReefServiceProtos.State.DONE == taskStatusProto.getState());
  assert(this.isKnown());
  this.messageDispatcher.onTaskCompleted(new CompletedTaskImpl(this.context,getResult(taskStatusProto),this.taskId));
  this.setState(ReefServiceProtos.State.DONE);
}

Fixed version (ground truth):
private void onTaskDone(final ReefServiceProtos.TaskStatusProto taskStatusProto){
}
Program: 59661
Project: 59661
Buggy source:
private void onTaskSuspend(final ReefServiceProtos.TaskStatusProto taskStatusProto){
  assert(ReefServiceProtos.State.SUSPEND == taskStatusProto.getState());
  assert(this.isKnown());
  this.messageDispatcher.onTaskSuspended(new SuspendedTaskImpl(this.context,getResult(taskStatusProto),this.taskId));
  this.setState(ReefServiceProtos.State.SUSPEND);
}

Fixed version (ground truth):
private void onTaskSuspend(final ReefServiceProtos.TaskStatusProto taskStatusProto){
}
Program: 59662
Project: 59662
Buggy source:
private void onTaskFailed(final ReefServiceProtos.TaskStatusProto taskStatusProto){
  assert(ReefServiceProtos.State.FAILED == taskStatusProto.getState());
  final Optional<ActiveContext> evaluatorContext=Optional.<ActiveContext>of(this.context);
  final Optional<byte[]> bytes=Optional.ofNullable(getResult(taskStatusProto));
  final Optional<Throwable> exception=this.exceptionCodec.fromBytes(bytes);
  final String message=exception.isPresent() ? exception.get().getMessage() : "String_Node_Str";
  final Optional<String> description=Optional.empty();
  final FailedTask failedTask=new FailedTask(this.taskId,message,description,exception,bytes,evaluatorContext);
  this.messageDispatcher.onTaskFailed(failedTask);
  this.setState(ReefServiceProtos.State.FAILED);
}

Fixed version (ground truth):
private void onTaskFailed(final ReefServiceProtos.TaskStatusProto taskStatusProto){
}
Program: 59663
Project: 59663
Buggy source:
private void onTaskInit(final ReefServiceProtos.TaskStatusProto taskStatusProto){
  assert((ReefServiceProtos.State.INIT == taskStatusProto.getState()));
  if (this.isKnown()) {
    LOG.log(Level.WARNING,"String_Node_Str" + "String_Node_Str",this.taskId);
  }
 else {
    final RunningTask runningTask=new RunningTaskImpl(this.evaluatorManager,this.taskId,this.context,this);
    this.messageDispatcher.onTaskRunning(runningTask);
    this.setState(ReefServiceProtos.State.RUNNING);
  }
}

Fixed version (ground truth):
private void onTaskInit(final ReefServiceProtos.TaskStatusProto taskStatusProto){
}
Program: 59664
Project: 59664
Buggy source:
private void onTaskRunning(final ReefServiceProtos.TaskStatusProto taskStatusProto){
  assert(taskStatusProto.getState() == ReefServiceProtos.State.RUNNING);
  if (this.isNotRunning()) {
    throw new IllegalStateException("String_Node_Str" + this.taskId + "String_Node_Str"+ this.state);
  }
  if (driverRestartManager.getEvaluatorRestartState(evaluatorManager.getId()) == EvaluatorRestartState.REREGISTERED) {
    final RunningTask runningTask=new RunningTaskImpl(this.evaluatorManager,this.taskId,this.context,this);
    this.driverRestartManager.setEvaluatorProcessed(evaluatorManager.getId());
    this.messageDispatcher.onDriverRestartTaskRunning(runningTask);
  }
  for (  final ReefServiceProtos.TaskStatusProto.TaskMessageProto taskMessageProto : taskStatusProto.getTaskMessageList()) {
    this.messageDispatcher.onTaskMessage(new TaskMessageImpl(taskMessageProto.getMessage().toByteArray(),this.taskId,this.context.getId(),taskMessageProto.getSourceId()));
  }
}

Fixed version (ground truth):
private void onTaskRunning(final ReefServiceProtos.TaskStatusProto taskStatusProto){
}
Program: 59665
Project: 59665
Buggy source:
public static void copy(final Iterable<FileResource> files,final File destinationFolder){
  if (!destinationFolder.exists()) {
    destinationFolder.mkdirs();
  }
  for (  final FileResource fileProto : files) {
    final File sourceFile=toFile(fileProto);
    final File destinationFile=new File(destinationFolder,fileProto.getName());
    if (destinationFile.exists()) {
      LOG.log(Level.FINEST,"String_Node_Str",sourceFile.getAbsolutePath());
    }
 else {
      try {
        java.nio.file.Files.copy(sourceFile.toPath(),destinationFile.toPath());
      }
 catch (      final IOException e) {
        final String message=new StringBuilder("String_Node_Str").append(sourceFile.getAbsolutePath()).append("String_Node_Str").append(destinationFile.getAbsolutePath()).append("String_Node_Str").toString();
        throw new RuntimeException(message,e);
      }
    }
  }
}

Fixed version (ground truth):
public static void copy(final Iterable<FileResource> files,final File destinationFolder){
  if (!destinationFolder.exists()) {
    destinationFolder.mkdirs();
  }
  for (  final FileResource fileProto : files) {
    final File sourceFile=toFile(fileProto);
    final File destinationFile=new File(destinationFolder,fileProto.getName());
    if (destinationFile.exists()) {
      LOG.log(Level.FINEST,"String_Node_Str",sourceFile.getAbsolutePath());
    }
 else {
      try {
        Files.copy(sourceFile.toPath(),destinationFile.toPath());
      }
 catch (      final IOException e) {
        final String message=new StringBuilder("String_Node_Str").append(sourceFile.getAbsolutePath()).append("String_Node_Str").append(destinationFile.getAbsolutePath()).append("String_Node_Str").toString();
        throw new RuntimeException(message,e);
      }
    }
  }
}
Program: 59668
Project: 59668
Buggy source:
/** 
 * Gets parameters from C#: <p/> args[0]: Driver folder. args[1]: Job ID. args[2]: Number of Evaluators. args[3]: First port to open. args[4]: Port range size. args[5]: Port open trial count.
 */
static LocalSubmissionFromCS fromCommandLine(final String[] args){
  final File driverFolder=new File(args[0]);
  final String jobId=args[1];
  final int numberOfEvaluators=Integer.valueOf(args[2]);
  final int tcpBeginPort=Integer.valueOf(args[3]);
  final int tcpRangeCount=Integer.valueOf(args[4]);
  final int tcpTryCount=Integer.valueOf(args[5]);
  return new LocalSubmissionFromCS(driverFolder,jobId,numberOfEvaluators,tcpBeginPort,tcpRangeCount,tcpTryCount);
}

Fixed version (ground truth):
/** 
 * Gets parameters from C#: <p/> args[0]: Driver folder. args[1]: Job ID. args[2]: Number of Evaluators. args[3]: First port to open. args[4]: Port range size. args[5]: Port open trial count.
 */
static LocalSubmissionFromCS fromCommandLine(final String[] args){
  final File driverFolder=new File(args[0]);
  final String jobId=args[1];
  final int numberOfEvaluators=Integer.parseInt(args[2]);
  final int tcpBeginPort=Integer.parseInt(args[3]);
  final int tcpRangeCount=Integer.parseInt(args[4]);
  final int tcpTryCount=Integer.parseInt(args[5]);
  return new LocalSubmissionFromCS(driverFolder,jobId,numberOfEvaluators,tcpBeginPort,tcpRangeCount,tcpTryCount);
}
Program: 59670
Project: 59670
Buggy source:
/** 
 * Takes 5 parameters from the C# side: [0]: String. Driver folder. [1]: String. Driver identifier. [2]: int. Driver memory. [3~5]: int. TCP configurations. [6]: int. Max application submissions. [7]: int. Evaluator recovery timeout for driver restart. > 0 => restart is enabled.
 */
static YarnSubmissionFromCS fromCommandLine(final String[] args){
  final File driverFolder=new File(args[0]);
  final String jobId=args[1];
  final int driverMemory=Integer.valueOf(args[2]);
  final int tcpBeginPort=Integer.valueOf(args[3]);
  final int tcpRangeCount=Integer.valueOf(args[4]);
  final int tcpTryCount=Integer.valueOf(args[5]);
  final int maxApplicationSubmissions=Integer.valueOf(args[6]);
  final int driverRecoveryTimeout=Integer.valueOf(args[7]);
  final int priority=1;
  final String queue="String_Node_Str";
  return new YarnSubmissionFromCS(driverFolder,jobId,driverMemory,tcpBeginPort,tcpRangeCount,tcpTryCount,maxApplicationSubmissions,driverRecoveryTimeout,priority,queue);
}

Fixed version (ground truth):
/** 
 * Takes 5 parameters from the C# side: [0]: String. Driver folder. [1]: String. Driver identifier. [2]: int. Driver memory. [3~5]: int. TCP configurations. [6]: int. Max application submissions. [7]: int. Evaluator recovery timeout for driver restart. > 0 => restart is enabled.
 */
static YarnSubmissionFromCS fromCommandLine(final String[] args){
  final File driverFolder=new File(args[0]);
  final String jobId=args[1];
  final int driverMemory=Integer.parseInt(args[2]);
  final int tcpBeginPort=Integer.parseInt(args[3]);
  final int tcpRangeCount=Integer.parseInt(args[4]);
  final int tcpTryCount=Integer.parseInt(args[5]);
  final int maxApplicationSubmissions=Integer.parseInt(args[6]);
  final int driverRecoveryTimeout=Integer.parseInt(args[7]);
  final int priority=1;
  final String queue="String_Node_Str";
  return new YarnSubmissionFromCS(driverFolder,jobId,driverMemory,tcpBeginPort,tcpRangeCount,tcpTryCount,maxApplicationSubmissions,driverRecoveryTimeout,priority,queue);
}
Program: 59671
Project: 59671
Buggy source:
public String getFailedTaskString(){
  final String description=jfailedTask.getDescription().isPresent() ? jfailedTask.getDescription().get().replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str") : "String_Node_Str";
  final String cause=jfailedTask.getReason().isPresent() ? jfailedTask.getReason().get().toString().replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str") : "String_Node_Str";
  final String data=jfailedTask.getData().isPresent() ? new String(jfailedTask.getData().get()).replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str") : "String_Node_Str";
  final String poorSerializedString="String_Node_Str" + jfailedTask.getId().replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str") + "String_Node_Str"+ jfailedTask.getMessage().replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str")+ "String_Node_Str"+ description+ "String_Node_Str"+ cause+ "String_Node_Str"+ data;
  LOG.log(Level.INFO,"String_Node_Str" + poorSerializedString);
  return poorSerializedString;
}

Fixed version (ground truth):
public String getFailedTaskString(){
  final String description=jfailedTask.getDescription().isPresent() ? jfailedTask.getDescription().get().replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str") : "String_Node_Str";
  final String cause=jfailedTask.getReason().isPresent() ? jfailedTask.getReason().get().toString().replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str") : "String_Node_Str";
  final String data=jfailedTask.getData().isPresent() ? new String(jfailedTask.getData().get(),StandardCharsets.UTF_8).replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str") : "String_Node_Str";
  final String poorSerializedString="String_Node_Str" + jfailedTask.getId().replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str") + "String_Node_Str"+ jfailedTask.getMessage().replace("String_Node_Str","String_Node_Str").replace("String_Node_Str","String_Node_Str")+ "String_Node_Str"+ description+ "String_Node_Str"+ cause+ "String_Node_Str"+ data;
  LOG.log(Level.INFO,"String_Node_Str" + poorSerializedString);
  return poorSerializedString;
}
Program: 59672
Project: 59672
Buggy source:
public void addCLRFiles(final File folder) throws BindException {
  try (final LoggingScope ls=this.loggingScopeFactory.getNewLoggingScope("String_Node_Str")){
    ConfigurationModule result=this.driverConfigModule;
    for (    final File f : folder.listFiles()) {
      if (f.canRead() && f.exists() && f.isFile()) {
        result=result.set(DriverConfiguration.GLOBAL_FILES,f.getAbsolutePath());
      }
    }
    this.driverConfigModule=result.set(DriverConfiguration.DRIVER_MEMORY,this.driverMemory).set(DriverConfiguration.DRIVER_IDENTIFIER,this.driverId).set(DriverConfiguration.DRIVER_JOB_SUBMISSION_DIRECTORY,this.jobSubmissionDirectory);
    final Path globalLibFile=Paths.get(NativeInterop.GLOBAL_LIBRARIES_FILENAME);
    if (!Files.exists(globalLibFile)) {
      LOG.log(Level.FINE,"String_Node_Str",globalLibFile.toAbsolutePath());
    }
 else {
      String globalLibString="String_Node_Str";
      try {
        globalLibString=new String(Files.readAllBytes(globalLibFile));
      }
 catch (      final Exception e) {
        LOG.log(Level.WARNING,"String_Node_Str" + globalLibFile.toAbsolutePath());
      }
      for (      final String s : globalLibString.split("String_Node_Str")) {
        final File f=new File(s);
        this.driverConfigModule=this.driverConfigModule.set(DriverConfiguration.GLOBAL_LIBRARIES,f.getPath());
      }
    }
    this.driverConfiguration=Configurations.merge(this.driverConfigModule.build(),getHTTPConfiguration(),getNameServerConfiguration());
  }
 }

Fixed version (ground truth):
public void addCLRFiles(final File folder) throws BindException {
  try (final LoggingScope ls=this.loggingScopeFactory.getNewLoggingScope("String_Node_Str")){
    ConfigurationModule result=this.driverConfigModule;
    for (    final File f : folder.listFiles()) {
      if (f.canRead() && f.exists() && f.isFile()) {
        result=result.set(DriverConfiguration.GLOBAL_FILES,f.getAbsolutePath());
      }
    }
    this.driverConfigModule=result.set(DriverConfiguration.DRIVER_MEMORY,this.driverMemory).set(DriverConfiguration.DRIVER_IDENTIFIER,this.driverId).set(DriverConfiguration.DRIVER_JOB_SUBMISSION_DIRECTORY,this.jobSubmissionDirectory);
    final Path globalLibFile=Paths.get(NativeInterop.GLOBAL_LIBRARIES_FILENAME);
    if (!Files.exists(globalLibFile)) {
      LOG.log(Level.FINE,"String_Node_Str",globalLibFile.toAbsolutePath());
    }
 else {
      String globalLibString="String_Node_Str";
      try {
        globalLibString=new String(Files.readAllBytes(globalLibFile),StandardCharsets.UTF_8);
      }
 catch (      final Exception e) {
        LOG.log(Level.WARNING,"String_Node_Str" + globalLibFile.toAbsolutePath());
      }
      for (      final String s : globalLibString.split("String_Node_Str")) {
        final File f=new File(s);
        this.driverConfigModule=this.driverConfigModule.set(DriverConfiguration.GLOBAL_LIBRARIES,f.getPath());
      }
    }
    this.driverConfiguration=Configurations.merge(this.driverConfigModule.build(),getHTTPConfiguration(),getNameServerConfiguration());
  }
 }
Program: 59673
Project: 59673
Buggy source:
private void evaluatorFailedHandlerWaitForCLRBridgeSetup(final long handle,final FailedEvaluator eval,final boolean isRestartFailed){
  if (handle == 0) {
    if (JobDriver.this.clrBridgeSetup) {
      final String message="String_Node_Str";
      LOG.log(Level.WARNING,message);
      JobDriver.this.jobMessageObserver.sendMessageToClient(message.getBytes());
      return;
    }
 else {
      clock.scheduleAlarm(0,new EventHandler<Alarm>(){
        @Override public void onNext(        final Alarm time){
          if (JobDriver.this.clrBridgeSetup) {
            handleFailedEvaluatorInCLR(eval,isRestartFailed);
          }
 else {
            LOG.log(Level.INFO,"String_Node_Str");
            clock.scheduleAlarm(5000,this);
          }
        }
      }
);
    }
  }
 else {
    handleFailedEvaluatorInCLR(eval,isRestartFailed);
  }
}

Fixed version (ground truth):
private void evaluatorFailedHandlerWaitForCLRBridgeSetup(final long handle,final FailedEvaluator eval,final boolean isRestartFailed){
  if (handle == 0) {
    if (JobDriver.this.clrBridgeSetup) {
      final String message="String_Node_Str";
      LOG.log(Level.WARNING,message);
      JobDriver.this.jobMessageObserver.sendMessageToClient(message.getBytes(StandardCharsets.UTF_8));
    }
 else {
      clock.scheduleAlarm(0,new EventHandler<Alarm>(){
        @Override public void onNext(        final Alarm time){
          if (JobDriver.this.clrBridgeSetup) {
            handleFailedEvaluatorInCLR(eval,isRestartFailed);
          }
 else {
            LOG.log(Level.INFO,"String_Node_Str");
            clock.scheduleAlarm(5000,this);
          }
        }
      }
);
    }
  }
 else {
    handleFailedEvaluatorInCLR(eval,isRestartFailed);
  }
}
Program: 59674
Project: 59674
Buggy source:
private void handleFailedEvaluatorInCLR(final FailedEvaluator eval,final boolean isRestartFailed){
  final String message="String_Node_Str";
  LOG.log(Level.INFO,message);
  final FailedEvaluatorBridge failedEvaluatorBridge=new FailedEvaluatorBridge(eval,JobDriver.this.evaluatorRequestor,JobDriver.this.isRestarted,loggingScopeFactory);
  if (isRestartFailed) {
    NativeInterop.clrSystemDriverRestartFailedEvaluatorHandlerOnNext(JobDriver.this.driverRestartFailedEvaluatorHandler,failedEvaluatorBridge,JobDriver.this.interopLogger);
  }
 else {
    NativeInterop.clrSystemFailedEvaluatorHandlerOnNext(JobDriver.this.failedEvaluatorHandler,failedEvaluatorBridge,JobDriver.this.interopLogger);
  }
  final int additionalRequestedEvaluatorNumber=failedEvaluatorBridge.getNewlyRequestedEvaluatorNumber();
  if (additionalRequestedEvaluatorNumber > 0) {
    LOG.log(Level.INFO,"String_Node_Str" + additionalRequestedEvaluatorNumber);
  }
  JobDriver.this.jobMessageObserver.sendMessageToClient(message.getBytes());
}

Fixed version (ground truth):
private void handleFailedEvaluatorInCLR(final FailedEvaluator eval,final boolean isRestartFailed){
  final String message="String_Node_Str";
  LOG.log(Level.INFO,message);
  final FailedEvaluatorBridge failedEvaluatorBridge=new FailedEvaluatorBridge(eval,JobDriver.this.evaluatorRequestor,JobDriver.this.isRestarted,loggingScopeFactory);
  if (isRestartFailed) {
    NativeInterop.clrSystemDriverRestartFailedEvaluatorHandlerOnNext(JobDriver.this.driverRestartFailedEvaluatorHandler,failedEvaluatorBridge,JobDriver.this.interopLogger);
  }
 else {
    NativeInterop.clrSystemFailedEvaluatorHandlerOnNext(JobDriver.this.failedEvaluatorHandler,failedEvaluatorBridge,JobDriver.this.interopLogger);
  }
  final int additionalRequestedEvaluatorNumber=failedEvaluatorBridge.getNewlyRequestedEvaluatorNumber();
  if (additionalRequestedEvaluatorNumber > 0) {
    LOG.log(Level.INFO,"String_Node_Str" + additionalRequestedEvaluatorNumber);
  }
  JobDriver.this.jobMessageObserver.sendMessageToClient(message.getBytes(StandardCharsets.UTF_8));
}
Program: 59675
Project: 59675
Buggy source:
/** 
 * process http request.
 */
@Override public void onHttpRequest(final ParsedHttpRequest parsedHttpRequest,final HttpServletResponse response) throws IOException, ServletException {
  LOG.log(Level.INFO,"String_Node_Str",parsedHttpRequest.getRequestUri());
  try (final LoggingScope ls=loggingScopeFactory.httpRequest(parsedHttpRequest.getRequestUri())){
    final AvroHttpSerializer httpSerializer=new AvroHttpSerializer();
    final AvroHttpRequest avroHttpRequest=httpSerializer.toAvro(parsedHttpRequest);
    final String requestString=httpSerializer.toString(avroHttpRequest);
    final byte[] requestBytes=requestString.getBytes();
    try {
      final HttpServerEventBridge httpServerEventBridge=new HttpServerEventBridge(requestBytes);
      NativeInterop.clrSystemHttpServerHandlerOnNext(JobDriver.this.httpServerEventHandler,httpServerEventBridge,JobDriver.this.interopLogger);
      final String responseBody=new String(httpServerEventBridge.getQueryResponseData(),"String_Node_Str");
      response.getWriter().println(responseBody);
      LOG.log(Level.INFO,"String_Node_Str",responseBody);
    }
 catch (    final Exception ex) {
      LOG.log(Level.SEVERE,"String_Node_Str",ex);
      throw new RuntimeException(ex);
    }
  }
 }

Fixed version (ground truth):
/** 
 * process http request.
 */
@Override public void onHttpRequest(final ParsedHttpRequest parsedHttpRequest,final HttpServletResponse response) throws IOException, ServletException {
  LOG.log(Level.INFO,"String_Node_Str",parsedHttpRequest.getRequestUri());
  try (final LoggingScope ls=loggingScopeFactory.httpRequest(parsedHttpRequest.getRequestUri())){
    final AvroHttpSerializer httpSerializer=new AvroHttpSerializer();
    final AvroHttpRequest avroHttpRequest=httpSerializer.toAvro(parsedHttpRequest);
    final String requestString=httpSerializer.toString(avroHttpRequest);
    final byte[] requestBytes=requestString.getBytes(Charset.forName(AvroHttpSerializer.JSON_CHARSET));
    try {
      final HttpServerEventBridge httpServerEventBridge=new HttpServerEventBridge(requestBytes);
      NativeInterop.clrSystemHttpServerHandlerOnNext(JobDriver.this.httpServerEventHandler,httpServerEventBridge,JobDriver.this.interopLogger);
      final String responseBody=new String(httpServerEventBridge.getQueryResponseData(),"String_Node_Str");
      response.getWriter().println(responseBody);
      LOG.log(Level.INFO,"String_Node_Str",responseBody);
    }
 catch (    final Exception ex) {
      LOG.log(Level.SEVERE,"String_Node_Str",ex);
      throw new RuntimeException(ex);
    }
  }
 }
Program: 59677
Project: 59677
Buggy source:
private void handleFailedEvaluator(final FailedEvaluator eval,final boolean isRestartFailed){
  try (final LoggingScope ls=loggingScopeFactory.evaluatorFailed(eval.getId())){
synchronized (JobDriver.this) {
      LOG.log(Level.SEVERE,"String_Node_Str",eval);
      for (      final FailedContext failedContext : eval.getFailedContextList()) {
        final String failedContextId=failedContext.getId();
        LOG.log(Level.INFO,"String_Node_Str" + failedContextId + "String_Node_Str");
        JobDriver.this.contexts.remove(failedContextId);
      }
      String message="String_Node_Str" + eval.getId() + "String_Node_Str"+ eval.getEvaluatorException().getMessage();
      JobDriver.this.jobMessageObserver.sendMessageToClient(message.getBytes());
      if (isRestartFailed) {
        evaluatorFailedHandlerWaitForCLRBridgeSetup(driverRestartFailedEvaluatorHandler,eval,isRestartFailed);
      }
 else {
        evaluatorFailedHandlerWaitForCLRBridgeSetup(failedEvaluatorHandler,eval,isRestartFailed);
      }
    }
  }
 }

Fixed version (ground truth):
private void handleFailedEvaluator(final FailedEvaluator eval,final boolean isRestartFailed){
  try (final LoggingScope ls=loggingScopeFactory.evaluatorFailed(eval.getId())){
synchronized (JobDriver.this) {
      LOG.log(Level.SEVERE,"String_Node_Str",eval);
      for (      final FailedContext failedContext : eval.getFailedContextList()) {
        final String failedContextId=failedContext.getId();
        LOG.log(Level.INFO,"String_Node_Str" + failedContextId + "String_Node_Str");
        JobDriver.this.contexts.remove(failedContextId);
      }
      String message="String_Node_Str" + eval.getId() + "String_Node_Str"+ eval.getEvaluatorException().getMessage();
      JobDriver.this.jobMessageObserver.sendMessageToClient(message.getBytes(StandardCharsets.UTF_8));
      if (isRestartFailed) {
        evaluatorFailedHandlerWaitForCLRBridgeSetup(driverRestartFailedEvaluatorHandler,eval,isRestartFailed);
      }
 else {
        evaluatorFailedHandlerWaitForCLRBridgeSetup(failedEvaluatorHandler,eval,isRestartFailed);
      }
    }
  }
 }
Program: 59678
Project: 59678
Buggy source:
@Override public void onNext(final ContextMessage message){
  LOG.log(Level.SEVERE,"String_Node_Str",message.get());
  try (final LoggingScope ls=loggingScopeFactory.contextMessageReceived(message.get().toString())){
    if (JobDriver.this.contextMessageHandler != 0) {
      final ContextMessageBridge contextMessageBridge=new ContextMessageBridge(message);
      LOG.log(Level.INFO,"String_Node_Str");
      NativeInterop.clrSystemContextMessageHandlerOnNext(JobDriver.this.contextMessageHandler,contextMessageBridge);
    }
  }
 }

Fixed version (ground truth):
@Override public void onNext(final ContextMessage message){
  LOG.log(Level.SEVERE,"String_Node_Str",message.get());
  try (final LoggingScope ls=loggingScopeFactory.contextMessageReceived(new String(message.get(),StandardCharsets.UTF_8))){
    if (JobDriver.this.contextMessageHandler != 0) {
      final ContextMessageBridge contextMessageBridge=new ContextMessageBridge(message);
      LOG.log(Level.INFO,"String_Node_Str");
      NativeInterop.clrSystemContextMessageHandlerOnNext(JobDriver.this.contextMessageHandler,contextMessageBridge);
    }
  }
 }
Program: 59679
Project: 59679
Buggy source:
@Override public void onNext(final byte[] bytes){
  throw new RuntimeException("String_Node_Str" + new String(bytes));
}

Fixed version (ground truth):
@Override public void onNext(final byte[] bytes){
  throw new RuntimeException("String_Node_Str" + new String(bytes,StandardCharsets.UTF_8));
}
Program: 59680
Project: 59680
Buggy source:
@Override public void onNext(final byte[] bytes){
  LOG.log(Level.INFO,"String_Node_Str",new String(bytes));
}

Fixed version (ground truth):
@Override public void onNext(final byte[] bytes){
  LOG.log(Level.INFO,"String_Node_Str",new String(bytes,StandardCharsets.UTF_8));
}
Program: 59681
Project: 59681
Buggy source:
@Override public void onNext(final StartTime startTime){
  final long pid=OSUtils.getPID();
  final File outfile=new File(PID_FILE_NAME);
  LOG.log(Level.FINEST,"String_Node_Str" + pid + "String_Node_Str"+ outfile.getAbsolutePath());
  try (final PrintWriter p=new PrintWriter((new FileOutputStream(PID_FILE_NAME)))){
    p.write(String.valueOf(pid));
    p.write("String_Node_Str");
  }
 catch (  final FileNotFoundException e) {
    LOG.log(Level.WARNING,"String_Node_Str",e);
  }
}

Fixed version (ground truth):
@Override public void onNext(final StartTime startTime){
  final long pid=OSUtils.getPID();
  final File outfile=new File(PID_FILE_NAME);
  LOG.log(Level.FINEST,"String_Node_Str" + pid + "String_Node_Str"+ outfile.getAbsolutePath());
  try (final PrintWriter p=new PrintWriter(PID_FILE_NAME,"String_Node_Str")){
    p.write(String.valueOf(pid));
    p.write("String_Node_Str");
  }
 catch (  final FileNotFoundException|UnsupportedEncodingException e) {
    LOG.log(Level.WARNING,"String_Node_Str",e);
  }
}
Program: 59682
Project: 59682
Buggy source:
@Override public void onNext(final StopTime stopTime){
  try (final PrintWriter out=new PrintWriter("String_Node_Str" + launchID + "String_Node_Str")){
    out.print(profiler.objectGraphToString());
  }
 catch (  final FileNotFoundException e) {
    LOG.log(Level.WARNING,"String_Node_Str",e);
  }
}

Fixed version (ground truth):
@Override public void onNext(final StopTime stopTime){
  try (final PrintWriter out=new PrintWriter("String_Node_Str" + launchID + "String_Node_Str","String_Node_Str")){
    out.print(profiler.objectGraphToString());
  }
 catch (  final FileNotFoundException|UnsupportedEncodingException e) {
    LOG.log(Level.WARNING,"String_Node_Str",e);
  }
}
Program: 59683
Project: 59683
Buggy source:
public static String runCommand(final String command){
  final StringBuilder sb=new StringBuilder();
  try {
    final String cmd=OSUtils.isWindows() ? "String_Node_Str" + command : command;
    final Process proc=Runtime.getRuntime().exec(cmd);
    try (final BufferedReader input=new BufferedReader(new InputStreamReader(proc.getInputStream()))){
      String line;
      while ((line=input.readLine()) != null) {
        sb.append(line).append('\n');
      }
    }
   }
 catch (  final IOException ex) {
    LOG.log(Level.SEVERE,"String_Node_Str" + command,ex);
    sb.append(ex);
  }
  return sb.toString();
}

Fixed version (ground truth):
public static String runCommand(final String command){
  final StringBuilder sb=new StringBuilder();
  try {
    final String cmd=OSUtils.isWindows() ? "String_Node_Str" + command : command;
    final Process proc=Runtime.getRuntime().exec(cmd);
    try (final BufferedReader input=new BufferedReader(new InputStreamReader(proc.getInputStream(),StandardCharsets.UTF_8))){
      String line;
      while ((line=input.readLine()) != null) {
        sb.append(line).append('\n');
      }
    }
   }
 catch (  final IOException ex) {
    LOG.log(Level.SEVERE,"String_Node_Str" + command,ex);
    sb.append(ex);
  }
  return sb.toString();
}
Program: 59684
Project: 59684
Buggy source:
/** 
 * @return the process ID of the JVM, if running on Linux. This returns -1 for other OSs.
 */
public static long getPID(){
  if (isLinux()) {
    try {
      final Process process=new ProcessBuilder().command("String_Node_Str","String_Node_Str","String_Node_Str").start();
      final byte[] returnBytes=new byte[128];
      process.getInputStream().read(returnBytes);
      final Long result=Long.valueOf(new String(returnBytes).trim());
      process.destroy();
      return result;
    }
 catch (    final IOException e) {
      LOG.log(Level.SEVERE,"String_Node_Str",e);
      return -1;
    }
  }
 else {
    return -1;
  }
}

Fixed version (ground truth):
/** 
 * @return the process ID of the JVM, if running on Linux. This returns -1 for other OSs.
 */
public static long getPID(){
  if (isLinux()) {
    try {
      final Process process=new ProcessBuilder().command("String_Node_Str","String_Node_Str","String_Node_Str").start();
      final byte[] returnBytes=new byte[128];
      process.getInputStream().read(returnBytes);
      final Long result=Long.valueOf(new String(returnBytes,StandardCharsets.UTF_8).trim());
      process.destroy();
      return result;
    }
 catch (    final IOException e) {
      LOG.log(Level.SEVERE,"String_Node_Str",e);
      return -1;
    }
  }
 else {
    return -1;
  }
}
Program: 59685
Project: 59685
Buggy source:
/** 
 * Load CLR libraries
 */
public void loadLib() throws IOException {
  LOG.log(Level.INFO,"String_Node_Str" + new Date().toString());
  try (final LoggingScope lb=loggingScopeFactory.loadLib()){
    this.loadBridgeDLL();
    this.loadAllManagedDLLs(this.reefFileNames.getLocalFolder());
    this.loadAllManagedDLLs(this.reefFileNames.getGlobalFolder());
  }
   LOG.log(Level.INFO,"String_Node_Str" + new Date().toString());
}

Fixed version (ground truth):
/** 
 * Load CLR libraries.
 */
public void loadLib() throws IOException {
  LOG.log(Level.INFO,"String_Node_Str" + new Date().toString());
  try (final LoggingScope lb=loggingScopeFactory.loadLib()){
    this.loadBridgeDLL();
    this.loadAllManagedDLLs(this.reefFileNames.getLocalFolder());
    this.loadAllManagedDLLs(this.reefFileNames.getGlobalFolder());
  }
   LOG.log(Level.INFO,"String_Node_Str" + new Date().toString());
}
Program: 59686
Project: 59686
Buggy source:
/** 
 * load assembly
 * @param fileOut
 * @param managed
 */
private void loadAssembly(final File fileOut,final boolean managed){
  if (managed) {
    NativeInterop.loadClrAssembly(fileOut.toString());
    LOG.log(Level.INFO,"String_Node_Str");
  }
 else {
    System.load(fileOut.toString());
    LOG.log(Level.INFO,"String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * load assembly.
 * @param fileOut
 * @param managed
 */
private void loadAssembly(final File fileOut,final boolean managed){
  if (managed) {
    NativeInterop.loadClrAssembly(fileOut.toString());
    LOG.log(Level.INFO,"String_Node_Str");
  }
 else {
    System.load(fileOut.toString());
    LOG.log(Level.INFO,"String_Node_Str");
  }
}