nus-yam/ex-repair huggingface dataset:
Program: 55600
Project: 55600
Buggy source:
private void showOustandingEnvelopeLog(){
  int dataAvailableCounter=0;
  final int pos=this.outstandingEnvelopesAsIntBuffer.position();
  final int limit=this.outstandingEnvelopesAsIntBuffer.limit();
  for (int i=0; i < this.outstandingEnvelopesAsIntBuffer.capacity(); ++i) {
    if (i < pos) {
      System.out.print('_');
      continue;
    }
    if (i >= limit) {
      System.out.print('_');
      continue;
    }
    final int entry=this.outstandingEnvelopesAsIntBuffer.get(i);
    final int channelIndex=getInputChannel(entry);
    final boolean dataAvailable=getDataAvailability(entry);
    if (dataAvailable) {
      ++dataAvailableCounter;
    }
    char ch=(char)(((int)'A') + channelIndex + (dataAvailable ? 0 : 32));
    System.out.print(ch);
  }
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str" + dataAvailableCounter);
}

Fixed version (ground truth):
private void showOustandingEnvelopeLog(){
  int dataAvailableCounter=0;
  final int pos=this.outstandingEnvelopesAsIntBuffer.position();
  final int limit=this.outstandingEnvelopesAsIntBuffer.limit();
  final StringBuilder sb=new StringBuilder();
  for (int i=0; i < this.outstandingEnvelopesAsIntBuffer.capacity(); ++i) {
    if (i < pos) {
      sb.append('_');
      continue;
    }
    if (i >= limit) {
      sb.append('_');
      continue;
    }
    final int entry=this.outstandingEnvelopesAsIntBuffer.get(i);
    final int channelIndex=getInputChannel(entry);
    final boolean dataAvailable=getDataAvailability(entry);
    if (dataAvailable) {
      ++dataAvailableCounter;
    }
    char ch=(char)(((int)'A') + channelIndex + (dataAvailable ? 0 : 32));
    sb.append(ch);
  }
  LOG.debug(sb.toString());
}
Program: 55603
Project: 55603
Buggy source:
RuntimeInputGateContext(final String taskName,final TransferEnvelopeDispatcher transferEnvelopeDispatcher,final InputGate<? extends Record> inputGate,final EnvelopeConsumptionTracker envelopeConsumptionTracker){
  this.taskName=taskName;
  this.localBufferPool=new LocalBufferPool(1,false);
  this.transferEnvelopeDispatcher=transferEnvelopeDispatcher;
  this.inputGate=inputGate;
  this.envelopeConsumptionTracker=envelopeConsumptionTracker;
}

Fixed version (ground truth):
RuntimeInputGateContext(final String taskName,final TransferEnvelopeDispatcher transferEnvelopeDispatcher,final InputGate<? extends Record> inputGate,final EnvelopeConsumptionTracker envelopeConsumptionTracker){
  this.taskName=taskName;
  this.localBufferPool=new LocalBufferPool(1,false);
  this.transferEnvelopeDispatcher=transferEnvelopeDispatcher;
  this.inputGate=inputGate;
  this.envelopeConsumptionTracker=envelopeConsumptionTracker;
  this.fileBufferManager=FileBufferManager.getInstance();
}
Program: 55604
Project: 55604
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public Buffer requestEmptyBufferBlocking(final int minimumSizeOfBuffer) throws IOException, InterruptedException {
  return this.localBufferPool.requestEmptyBufferBlocking(minimumSizeOfBuffer);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public Buffer requestEmptyBufferBlocking(final int minimumSizeOfBuffer) throws IOException, InterruptedException {
  final Buffer buffer=this.localBufferPool.requestEmptyBuffer(minimumSizeOfBuffer);
  if (buffer != null) {
    return buffer;
  }
  if (this.envelopeConsumptionTracker.followsLog()) {
    return BufferFactory.createFromFile(minimumSizeOfBuffer,this.inputGate.getGateID(),fileBufferManager);
  }
  return this.localBufferPool.requestEmptyBufferBlocking(minimumSizeOfBuffer);
}
Program: 55605
Project: 55605
Buggy source:
public static Buffer createFromMemory(final int bufferSize,final ByteBuffer byteBuffer,final Queue<ByteBuffer> queueForRecycledBuffers){
  final InternalBuffer internalBuffer=new MemoryBuffer(bufferSize,byteBuffer,queueForRecycledBuffers);
  return new Buffer(internalBuffer);
}

Fixed version (ground truth):
public static Buffer createFromMemory(final int bufferSize,final ByteBuffer byteBuffer,final MemoryBufferPoolConnector bufferPoolConnector){
  final InternalBuffer internalBuffer=new MemoryBuffer(bufferSize,byteBuffer,bufferPoolConnector);
  return new Buffer(internalBuffer);
}
Program: 55606
Project: 55606
Buggy source:
/** 
 * Increases the number of references to the physical buffer by one.
 */
synchronized void increaseReferenceCounter(){
  if (this.bufferAlreadyRecycled) {
    LOG.error("String_Node_Str");
  }
  ++this.referenceCounter;
}

Fixed version (ground truth):
/** 
 * Increases the number of references to the physical buffer by one.
 */
void increaseReferenceCounter(){
  if (this.referenceCounter.getAndIncrement() == 0) {
    LOG.error("String_Node_Str");
  }
}
Program: 55607
Project: 55607
Buggy source:
/** 
 * Constructs a new memory buffer recycler.
 * @param originalBuffer the original byte buffer
 * @param queueForRecycledBuffers the queue to append the buffer for recycling
 */
MemoryBufferRecycler(final ByteBuffer originalBuffer,final Queue<ByteBuffer> queueForRecycledBuffers){
  this.originalBuffer=originalBuffer;
  this.queueForRecycledBuffers=queueForRecycledBuffers;
}

Fixed version (ground truth):
/** 
 * Constructs a new memory buffer recycler.
 * @param originalBuffer the original byte buffer
 * @param bufferPoolConnector the connection to the pool from which the byte buffer has originally been taken
 */
MemoryBufferRecycler(final ByteBuffer originalBuffer,final MemoryBufferPoolConnector bufferPoolConnector){
  this.originalBuffer=originalBuffer;
  this.bufferPoolConnector=bufferPoolConnector;
}
Program: 55608
Project: 55608
Buggy source:
/** 
 * Decreases the number of references to the physical buffer by one. If the number of references becomes zero the physical buffer is recycled.
 */
synchronized void decreaseReferenceCounter(){
  if (this.bufferAlreadyRecycled) {
    LOG.error("String_Node_Str");
  }
  --this.referenceCounter;
  if (this.referenceCounter <= 0) {
    this.originalBuffer.clear();
synchronized (this.queueForRecycledBuffers) {
      this.queueForRecycledBuffers.add(this.originalBuffer);
      this.queueForRecycledBuffers.notify();
    }
    this.bufferAlreadyRecycled=true;
  }
}

Fixed version (ground truth):
/** 
 * Decreases the number of references to the physical buffer by one. If the number of references becomes zero the physical buffer is recycled.
 */
void decreaseReferenceCounter(){
  final int val=this.referenceCounter.decrementAndGet();
  if (val == 0) {
    this.originalBuffer.clear();
    this.bufferPoolConnector.recycle(this.originalBuffer);
  }
 else   if (val < 0) {
    LOG.error("String_Node_Str");
  }
}
Program: 55609
Project: 55609
Buggy source:
public LocalBufferPool(final String ownerName,final int designatedNumberOfBuffers,final boolean isShared){
  this(ownerName,designatedNumberOfBuffers,isShared,null);
}

Fixed version (ground truth):
public LocalBufferPool(final int designatedNumberOfBuffers,final boolean isShared){
  this(designatedNumberOfBuffers,isShared,null);
}
Program: 55611
Project: 55611
Buggy source:
public ByteBufferedChannelManager(final ChannelLookupProtocol channelLookupService,final InstanceConnectionInfo localInstanceConnectionInfo) throws IOException {
  this.channelLookupService=channelLookupService;
  this.localConnectionInfo=localInstanceConnectionInfo;
  FileBufferManager.getInstance();
  GlobalBufferPool.getInstance();
  this.transitBufferPool=new LocalBufferPool("String_Node_Str",128,true);
  this.networkConnectionManager=new NetworkConnectionManager(this,localInstanceConnectionInfo.getAddress(),localInstanceConnectionInfo.getDataPort());
  this.allowSenderSideSpilling=GlobalConfiguration.getBoolean("String_Node_Str",DEFAULT_ALLOW_SENDER_SIDE_SPILLING);
  this.mergeSpilledBuffers=GlobalConfiguration.getBoolean("String_Node_Str",DEFAULT_MERGE_SPILLED_BUFFERS);
  LOG.info("String_Node_Str" + (this.allowSenderSideSpilling ? "String_Node_Str" : "String_Node_Str") + (this.mergeSpilledBuffers ? "String_Node_Str" : "String_Node_Str"));
}

Fixed version (ground truth):
public ByteBufferedChannelManager(final ChannelLookupProtocol channelLookupService,final InstanceConnectionInfo localInstanceConnectionInfo) throws IOException {
  this.channelLookupService=channelLookupService;
  this.localConnectionInfo=localInstanceConnectionInfo;
  FileBufferManager.getInstance();
  GlobalBufferPool.getInstance();
  this.transitBufferPool=new LocalBufferPool(128,true);
  this.networkConnectionManager=new NetworkConnectionManager(this,localInstanceConnectionInfo.getAddress(),localInstanceConnectionInfo.getDataPort());
  this.allowSenderSideSpilling=GlobalConfiguration.getBoolean("String_Node_Str",DEFAULT_ALLOW_SENDER_SIDE_SPILLING);
  this.mergeSpilledBuffers=GlobalConfiguration.getBoolean("String_Node_Str",DEFAULT_MERGE_SPILLED_BUFFERS);
  LOG.info("String_Node_Str" + (this.allowSenderSideSpilling ? "String_Node_Str" : "String_Node_Str") + (this.mergeSpilledBuffers ? "String_Node_Str" : "String_Node_Str"));
}
Program: 55612
Project: 55612
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void clearLocalBufferPool(){
  this.localBufferPool.clear();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void clearLocalBufferPool(){
  this.localBufferPool.destroy();
}
Program: 55613
Project: 55613
Buggy source:
RuntimeInputGateContext(final String taskName,final TransferEnvelopeDispatcher transferEnvelopeDispatcher,final InputGate<? extends Record> inputGate){
  final String poolOwnerName=(taskName == null ? "String_Node_Str" : taskName + "String_Node_Str" + inputGate.getIndex()+ "String_Node_Str");
  this.localBufferPool=new LocalBufferPool(poolOwnerName,1,false);
  this.transferEnvelopeDispatcher=transferEnvelopeDispatcher;
  this.inputGate=inputGate;
}

Fixed version (ground truth):
RuntimeInputGateContext(final TransferEnvelopeDispatcher transferEnvelopeDispatcher,final InputGate<? extends Record> inputGate){
  this.localBufferPool=new LocalBufferPool(1,false);
  this.transferEnvelopeDispatcher=transferEnvelopeDispatcher;
  this.inputGate=inputGate;
}
Program: 55614
Project: 55614
Buggy source:
RuntimeTaskContext(final RuntimeTask task,final TransferEnvelopeDispatcher transferEnvelopeDispatcher,final Map<ExecutionVertexID,RuntimeTaskContext> tasksWithUndecidedCheckpoints){
  final String poolOwnerName=(task.getEnvironment().getTaskName() == null ? "String_Node_Str" : task.getEnvironment().getTaskName());
  this.localBufferPool=new LocalBufferPool(poolOwnerName,1,false,this);
  this.task=task;
  final RuntimeEnvironment environment=task.getRuntimeEnvironment();
  int nooc=0;
  boolean ephemeral=true;
  for (int i=0; i < environment.getNumberOfOutputGates(); ++i) {
    final OutputGate<? extends Record> outputGate=environment.getOutputGate(i);
    nooc+=outputGate.getNumberOfOutputChannels();
    if (outputGate.getChannelType() == ChannelType.FILE) {
      ephemeral=false;
    }
  }
  this.numberOfOutputChannels=nooc;
  this.ephemeralCheckpoint=new EphemeralCheckpoint(task,ephemeral);
  if (ephemeral) {
    tasksWithUndecidedCheckpoints.put(task.getVertexID(),this);
  }
  this.transferEnvelopeDispatcher=transferEnvelopeDispatcher;
  this.runtimeDispatcher=new RuntimeDispatcher(transferEnvelopeDispatcher);
}

Fixed version (ground truth):
RuntimeTaskContext(final RuntimeTask task,final TransferEnvelopeDispatcher transferEnvelopeDispatcher,final Map<ExecutionVertexID,RuntimeTaskContext> tasksWithUndecidedCheckpoints){
  this.localBufferPool=new LocalBufferPool(1,false,this);
  this.task=task;
  final RuntimeEnvironment environment=task.getRuntimeEnvironment();
  int nooc=0;
  boolean ephemeral=true;
  for (int i=0; i < environment.getNumberOfOutputGates(); ++i) {
    final OutputGate<? extends Record> outputGate=environment.getOutputGate(i);
    nooc+=outputGate.getNumberOfOutputChannels();
    if (outputGate.getChannelType() == ChannelType.FILE) {
      ephemeral=false;
    }
  }
  this.numberOfOutputChannels=nooc;
  this.ephemeralCheckpoint=new EphemeralCheckpoint(task,ephemeral);
  if (ephemeral) {
    tasksWithUndecidedCheckpoints.put(task.getVertexID(),this);
  }
  this.transferEnvelopeDispatcher=transferEnvelopeDispatcher;
  this.runtimeDispatcher=new RuntimeDispatcher(transferEnvelopeDispatcher);
}
Program: 55615
Project: 55615
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void clearLocalBufferPool(){
  this.localBufferPool.clear();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void clearLocalBufferPool(){
  this.localBufferPool.destroy();
}
Program: 55616
Project: 55616
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public InputGateContext createInputGateContext(final GateID gateID){
  if (gateID == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  InputGate<? extends Record> inputGate=null;
  final RuntimeEnvironment re=this.task.getRuntimeEnvironment();
  for (int i=0; i < re.getNumberOfInputGates(); ++i) {
    final InputGate<? extends Record> candidateGate=re.getInputGate(i);
    if (candidateGate.getGateID().equals(gateID)) {
      inputGate=candidateGate;
      break;
    }
  }
  if (inputGate == null) {
    throw new IllegalStateException("String_Node_Str" + gateID);
  }
  return new RuntimeInputGateContext(this.task.getEnvironment().getTaskName(),this.transferEnvelopeDispatcher,inputGate);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public InputGateContext createInputGateContext(final GateID gateID){
  if (gateID == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  InputGate<? extends Record> inputGate=null;
  final RuntimeEnvironment re=this.task.getRuntimeEnvironment();
  for (int i=0; i < re.getNumberOfInputGates(); ++i) {
    final InputGate<? extends Record> candidateGate=re.getInputGate(i);
    if (candidateGate.getGateID().equals(gateID)) {
      inputGate=candidateGate;
      break;
    }
  }
  if (inputGate == null) {
    throw new IllegalStateException("String_Node_Str" + gateID);
  }
  return new RuntimeInputGateContext(this.transferEnvelopeDispatcher,inputGate);
}
Program: 55618
Project: 55618
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public boolean isCanceled(){
  if (this.encapsulatedTask != null) {
    if (this.encapsulatedTask.isCanceled()) {
      return true;
    }
  }
  return isCanceled;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public boolean isCanceled(){
  if (this.encapsulatedRuntimeTask != null) {
    if (this.encapsulatedRuntimeTask.isCanceled()) {
      return true;
    }
  }
  return isCanceled;
}
Program: 55619
Project: 55619
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public boolean isTerminated(){
  if (this.encapsulatedTask != null) {
    if (this.encapsulatedTask.isTerminated()) {
      return true;
    }
  }
  final Thread executingThread=this.environment.getExecutingThread();
  if (executingThread.getState() == Thread.State.TERMINATED) {
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public boolean isTerminated(){
  if (this.encapsulatedTask != null) {
    if (this.encapsulatedTask.isTerminated()) {
      if (this.encapsulatedExecutionState != ExecutionState.FINISHED && this.encapsulatedExecutionState != ExecutionState.CANCELED && this.encapsulatedExecutionState != ExecutionState.FAILED) {
        return true;
      }
    }
  }
  final Thread executingThread=this.environment.getExecutingThread();
  if (executingThread.getState() == Thread.State.TERMINATED) {
    if (this.replayTaskExecutionState != ExecutionState.FINISHED && this.replayTaskExecutionState != ExecutionState.CANCELED && this.replayTaskExecutionState != ExecutionState.FAILED) {
      return true;
    }
  }
  return false;
}
Program: 55620
Project: 55620
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void userThreadFinished(final Thread userThread){
  if (this.encapsulatedTask != null) {
    this.encapsulatedTask.userThreadFinished(userThread);
  }
 else {
    LOG.error("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void userThreadFinished(final Thread userThread){
  if (this.encapsulatedRuntimeTask != null) {
    this.encapsulatedRuntimeTask.userThreadFinished(userThread);
  }
 else {
    LOG.error("String_Node_Str");
  }
}
Program: 55621
Project: 55621
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void markAsFailed(){
  this.replayTaskExecutionState=ExecutionState.FAILED;
  reportExecutionStateChange(true,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void markAsFailed(){
  if (this.encapsulatedTask != null) {
    this.encapsulatedTask.killExecution();
  }
  this.replayTaskExecutionState=ExecutionState.FAILED;
  reportExecutionStateChange(true,"String_Node_Str");
}
Program: 55622
Project: 55622
Buggy source:
private ReplayTaskExecutionObserver(final RuntimeTask encapsulatedTask){
  this.encapsulatedTask=encapsulatedTask;
}

Fixed version (ground truth):
private ReplayTaskExecutionObserver(final RuntimeTask encapsulatedRuntimeTask){
  this.encapsulatedRuntimeTask=encapsulatedRuntimeTask;
}
Program: 55623
Project: 55623
Buggy source:
private static ExecutionState determineOverallExecutionState(final ExecutionState unchangedExecutionState,final ExecutionState changedExecutionState){
  if (changedExecutionState == null) {
    return changedExecutionState;
  }
  if (changedExecutionState == ExecutionState.REPLAYING) {
    if (unchangedExecutionState == ExecutionState.RUNNING) {
      return ExecutionState.REPLAYING;
    }
 else {
      return unchangedExecutionState;
    }
  }
  if (changedExecutionState == ExecutionState.CANCELING) {
    return ExecutionState.CANCELING;
  }
  if (changedExecutionState == ExecutionState.CANCELED && unchangedExecutionState == ExecutionState.CANCELED) {
    return ExecutionState.CANCELED;
  }
  if (changedExecutionState == ExecutionState.FINISHING && unchangedExecutionState == ExecutionState.FINISHING) {
    return ExecutionState.FINISHING;
  }
  if (changedExecutionState == ExecutionState.FINISHED && unchangedExecutionState == ExecutionState.FINISHED) {
    return ExecutionState.FINISHED;
  }
  return null;
}

Fixed version (ground truth):
private static ExecutionState determineOverallExecutionState(final ExecutionState unchangedExecutionState,final ExecutionState changedExecutionState){
  if (changedExecutionState == null) {
    return changedExecutionState;
  }
  if (changedExecutionState == ExecutionState.REPLAYING) {
    if (unchangedExecutionState == ExecutionState.RUNNING) {
      return ExecutionState.REPLAYING;
    }
 else {
      return unchangedExecutionState;
    }
  }
  if (changedExecutionState == ExecutionState.CANCELING) {
    return ExecutionState.CANCELING;
  }
  if (changedExecutionState == ExecutionState.CANCELED && unchangedExecutionState == ExecutionState.CANCELED) {
    return ExecutionState.CANCELED;
  }
  if (changedExecutionState == ExecutionState.FINISHING && unchangedExecutionState == ExecutionState.FINISHING) {
    return ExecutionState.FINISHING;
  }
  if (changedExecutionState == ExecutionState.FINISHED && unchangedExecutionState == ExecutionState.FINISHED) {
    return ExecutionState.FINISHED;
  }
  if (changedExecutionState == ExecutionState.FAILED && unchangedExecutionState == ExecutionState.FAILED) {
    return ExecutionState.FAILED;
  }
  return null;
}
Program: 55624
Project: 55624
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void executionStateChanged(final ExecutionState newExecutionState,final String optionalMessage){
  if (this.encapsulatedTask == null) {
    replayTaskExecutionState=newExecutionState;
  }
 else {
    encapsulatedExecutionState=newExecutionState;
  }
  reportExecutionStateChange((this.encapsulatedTask == null),optionalMessage);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void executionStateChanged(final ExecutionState newExecutionState,final String optionalMessage){
  if (this.encapsulatedRuntimeTask == null) {
    replayTaskExecutionState=newExecutionState;
    if (newExecutionState == ExecutionState.FAILED) {
      if (encapsulatedTask != null) {
        encapsulatedTask.killExecution();
      }
    }
  }
 else {
    encapsulatedExecutionState=newExecutionState;
    if (newExecutionState == ExecutionState.FAILED) {
      killExecution();
    }
  }
  reportExecutionStateChange((this.encapsulatedRuntimeTask == null),optionalMessage);
}
Program: 55625
Project: 55625
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void userThreadStarted(final Thread userThread){
  if (this.encapsulatedTask != null) {
    this.encapsulatedTask.userThreadStarted(userThread);
  }
 else {
    LOG.error("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void userThreadStarted(final Thread userThread){
  if (this.encapsulatedRuntimeTask != null) {
    this.encapsulatedRuntimeTask.userThreadStarted(userThread);
  }
 else {
    LOG.error("String_Node_Str");
  }
}
Program: 55626
Project: 55626
Buggy source:
/** 
 * This method is periodically called by the framework to check the state of the task threads. If any task thread has unexpectedly switch to TERMINATED, this indicates that an   {@link Error} has occurredduring its execution.
 */
private void checkTaskExecution(){
  final List<Task> failedTasks=new ArrayList<Task>();
synchronized (this.runningTasks) {
    final Iterator<ExecutionVertexID> it=this.runningTasks.keySet().iterator();
    while (it.hasNext()) {
      final ExecutionVertexID executionVertexID=it.next();
      final Task task=this.runningTasks.get(executionVertexID);
      if (task.isTerminated()) {
        it.remove();
        failedTasks.add(task);
      }
    }
  }
  final Iterator<Task> it2=failedTasks.iterator();
  while (it2.hasNext()) {
    it2.next().markAsFailed();
  }
}

Fixed version (ground truth):
/** 
 * This method is periodically called by the framework to check the state of the task threads. If any task thread has unexpectedly switch to TERMINATED, this indicates that an   {@link Error} has occurredduring its execution.
 */
private void checkTaskExecution(){
  final Iterator<Task> it=this.runningTasks.values().iterator();
  while (it.hasNext()) {
    final Task task=it.next();
    if (task.isTerminated()) {
      task.markAsFailed();
    }
  }
}
Program: 55627
Project: 55627
Buggy source:
boolean hasFinished(){
  return (!this.forwardingChain.anyForwarderHasDataLeft());
}

Fixed version (ground truth):
boolean hasFinished(){
  this.incomingEventQueue.processQueuedEvents();
  return (!this.forwardingChain.anyForwarderHasDataLeft());
}
Program: 55628
Project: 55628
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public boolean hasDataLeft(){
  return (!this.closeAcknowledgementReceived);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public boolean hasDataLeft(){
  return false;
}
Program: 55629
Project: 55629
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void processEvent(final AbstractEvent event){
  if (event instanceof ByteBufferedChannelCloseEvent) {
    this.closeAcknowledgementReceived=true;
  }
 else {
    System.out.println("String_Node_Str" + event);
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void processEvent(final AbstractEvent event){
  if (event instanceof ByteBufferedChannelCloseEvent) {
    LOG.info("String_Node_Str");
  }
 else {
    LOG.warn("String_Node_Str" + event);
  }
}
Program: 55630
Project: 55630
Buggy source:
private static ExecutionState determineOverallExecutionState(final ExecutionState unchangedExecutionState,final ExecutionState changedExecutionState){
  if (changedExecutionState == null) {
    return changedExecutionState;
  }
  if (changedExecutionState == ExecutionState.REPLAYING) {
    if (unchangedExecutionState == ExecutionState.RUNNING) {
      return ExecutionState.REPLAYING;
    }
 else {
      return unchangedExecutionState;
    }
  }
  if (changedExecutionState == ExecutionState.CANCELING) {
    return ExecutionState.CANCELING;
  }
  if (changedExecutionState == ExecutionState.CANCELED && unchangedExecutionState == ExecutionState.CANCELED) {
    return ExecutionState.CANCELED;
  }
  if (changedExecutionState == ExecutionState.FINISHING && unchangedExecutionState == ExecutionState.FINISHING) {
    return ExecutionState.FINISHING;
  }
  if (changedExecutionState == ExecutionState.FINISHED && unchangedExecutionState == ExecutionState.FINISHED) {
    return ExecutionState.FINISHED;
  }
  if (changedExecutionState == ExecutionState.FAILED && unchangedExecutionState == ExecutionState.FAILED) {
    return ExecutionState.FAILED;
  }
  return null;
}

Fixed version (ground truth):
private static ExecutionState determineOverallExecutionState(final ExecutionState unchangedExecutionState,final ExecutionState changedExecutionState){
  if (changedExecutionState == null) {
    return changedExecutionState;
  }
  if (changedExecutionState == ExecutionState.REPLAYING) {
    if (unchangedExecutionState == ExecutionState.RUNNING || unchangedExecutionState == ExecutionState.FINISHING) {
      return ExecutionState.REPLAYING;
    }
 else {
      return unchangedExecutionState;
    }
  }
  if (changedExecutionState == ExecutionState.CANCELING) {
    return ExecutionState.CANCELING;
  }
  if (changedExecutionState == ExecutionState.CANCELED && unchangedExecutionState == ExecutionState.CANCELED) {
    return ExecutionState.CANCELED;
  }
  if (changedExecutionState == ExecutionState.FINISHING && (unchangedExecutionState == ExecutionState.FINISHING || unchangedExecutionState == ExecutionState.FINISHED)) {
    return ExecutionState.FINISHING;
  }
  if (changedExecutionState == ExecutionState.FINISHED && unchangedExecutionState == ExecutionState.FINISHED) {
    return ExecutionState.FINISHED;
  }
  if (changedExecutionState == ExecutionState.FAILED && unchangedExecutionState == ExecutionState.FAILED) {
    return ExecutionState.FAILED;
  }
  return null;
}
Program: 55631
Project: 55631
Buggy source:
private void waitForAllOutputBrokerToFinish() throws IOException, InterruptedException {
  while (true) {
    boolean finished=true;
    final Iterator<ReplayOutputBroker> it=this.outputBrokerMap.values().iterator();
    while (it.hasNext()) {
      if (!it.next().hasFinished()) {
        finished=false;
      }
    }
    if (finished) {
      break;
    }
    Thread.sleep(SLEEPINTERVAL);
  }
}

Fixed version (ground truth):
private void waitForAllOutputBrokerToFinish() throws IOException, InterruptedException {
  while (!this.executionObserver.isCanceled()) {
    boolean finished=true;
    final Iterator<ReplayOutputBroker> it=this.outputBrokerMap.values().iterator();
    while (it.hasNext()) {
      if (!it.next().hasFinished()) {
        finished=false;
      }
    }
    if (finished) {
      break;
    }
    Thread.sleep(SLEEPINTERVAL);
  }
}
Program: 55633
Project: 55633
Buggy source:
public void runIOLoop(){
  long interval=GlobalConfiguration.getInteger("String_Node_Str",DEFAULTPERIODICTASKSINTERVAL);
  while (!Thread.interrupted()) {
    try {
      Thread.sleep(interval);
    }
 catch (    InterruptedException e1) {
      LOG.debug("String_Node_Str");
      break;
    }
    try {
      this.jobManager.sendHeartbeat(this.localInstanceConnectionInfo,this.hardwareDescription);
    }
 catch (    IOException e) {
      LOG.debug("String_Node_Str");
    }
    checkTaskExecution();
    this.byteBufferedChannelManager.cleanUpRecentlyRemovedChannelIDSet();
  }
  shutdown();
}

Fixed version (ground truth):
public void runIOLoop(){
  long interval=GlobalConfiguration.getInteger("String_Node_Str",DEFAULTPERIODICTASKSINTERVAL);
  while (!Thread.interrupted()) {
    try {
      Thread.sleep(interval);
    }
 catch (    InterruptedException e1) {
      LOG.debug("String_Node_Str");
      break;
    }
    try {
      this.jobManager.sendHeartbeat(this.localInstanceConnectionInfo,this.hardwareDescription);
    }
 catch (    IOException e) {
      LOG.debug("String_Node_Str");
    }
    checkTaskExecution();
  }
  shutdown();
}
Program: 55634
Project: 55634
Buggy source:
private void sendReceiverNotFoundEvent(final JobID jobID,final ChannelID unknownReceiver){
  if (ChannelID.SYSTEM_ID.equals(unknownReceiver)) {
    LOG.error("String_Node_Str");
    return;
  }
  final TransferEnvelope transferEnvelope=new TransferEnvelope(0,jobID,ChannelID.SYSTEM_ID);
  final UnknownReceiverEvent unknownReceiverEvent=new UnknownReceiverEvent(unknownReceiver);
  transferEnvelope.addEvent(unknownReceiverEvent);
  final TransferEnvelopeReceiverList receiverList=getReceiverList(jobID,unknownReceiver);
  if (receiverList == null) {
    LOG.error("String_Node_Str" + unknownReceiver);
    return;
  }
  processEnvelopeEnvelopeWithoutBuffer(transferEnvelope,receiverList);
}

Fixed version (ground truth):
private void sendReceiverNotFoundEvent(final TransferEnvelope envelope,final ChannelID unknownReceiver){
  if (ChannelID.SYSTEM_ID.equals(envelope.getSource())) {
    LOG.error("String_Node_Str");
    return;
  }
  final JobID jobID=envelope.getJobID();
  final TransferEnvelope transferEnvelope=new TransferEnvelope(0,jobID,ChannelID.SYSTEM_ID);
  final ReceiverNotFoundEvent unknownReceiverEvent=new ReceiverNotFoundEvent(unknownReceiver,envelope.getSequenceNumber());
  transferEnvelope.addEvent(unknownReceiverEvent);
  final TransferEnvelopeReceiverList receiverList=getReceiverList(jobID,unknownReceiver);
  if (receiverList == null) {
    LOG.error("String_Node_Str" + unknownReceiver);
    return;
  }
  processEnvelopeEnvelopeWithoutBuffer(transferEnvelope,receiverList);
}
Program: 55638
Project: 55638
Buggy source:
private boolean processEnvelopeEnvelopeWithoutBuffer(final TransferEnvelope transferEnvelope,final TransferEnvelopeReceiverList receiverList){
  final Iterator<ChannelID> localIt=receiverList.getLocalReceivers().iterator();
  while (localIt.hasNext()) {
    final ChannelID localReceiver=localIt.next();
    final ChannelContext channelContext=this.registeredChannels.get(localReceiver);
    if (channelContext == null) {
      if (LOG.isDebugEnabled()) {
        LOG.debug("String_Node_Str" + localReceiver + "String_Node_Str"+ transferEnvelope.getJobID());
      }
      continue;
    }
    channelContext.queueTransferEnvelope(transferEnvelope);
  }
  final Iterator<InetSocketAddress> remoteIt=receiverList.getRemoteReceivers().iterator();
  while (remoteIt.hasNext()) {
    final InetSocketAddress remoteReceiver=remoteIt.next();
    this.networkConnectionManager.queueEnvelopeForTransfer(remoteReceiver,transferEnvelope);
  }
  return true;
}

Fixed version (ground truth):
private boolean processEnvelopeEnvelopeWithoutBuffer(final TransferEnvelope transferEnvelope,final TransferEnvelopeReceiverList receiverList){
  final Iterator<ChannelID> localIt=receiverList.getLocalReceivers().iterator();
  while (localIt.hasNext()) {
    final ChannelID localReceiver=localIt.next();
    final ChannelContext channelContext=this.registeredChannels.get(localReceiver);
    if (channelContext == null) {
      sendReceiverNotFoundEvent(transferEnvelope,localReceiver);
      continue;
    }
    channelContext.queueTransferEnvelope(transferEnvelope);
  }
  final Iterator<InetSocketAddress> remoteIt=receiverList.getRemoteReceivers().iterator();
  while (remoteIt.hasNext()) {
    final InetSocketAddress remoteReceiver=remoteIt.next();
    this.networkConnectionManager.queueEnvelopeForTransfer(remoteReceiver,transferEnvelope);
  }
  return true;
}
Program: 55639
Project: 55639
Buggy source:
@Override public BufferProvider getBufferProvider(final JobID jobID,final ChannelID sourceChannelID) throws IOException, InterruptedException {
  final TransferEnvelopeReceiverList receiverList=getReceiverList(jobID,sourceChannelID);
  if (receiverList.hasLocalReceivers() && !receiverList.hasRemoteReceivers()) {
    final List<ChannelID> localReceivers=receiverList.getLocalReceivers();
    if (localReceivers.size() == 1) {
      final ChannelID localReceiver=localReceivers.get(0);
      final ChannelContext cc=this.registeredChannels.get(localReceiver);
      if (cc == null) {
        if (this.recentlyRemovedChannelIDSet.contains(localReceiver)) {
          return this.transitBufferPool;
        }
 else {
          throw new IOException("String_Node_Str" + localReceiver);
        }
      }
      if (!cc.isInputChannel()) {
        throw new IOException("String_Node_Str" + localReceiver + "String_Node_Str");
      }
      final InputChannelContext icc=(InputChannelContext)cc;
      return icc;
    }
  }
  return this.transitBufferPool;
}

Fixed version (ground truth):
@Override public BufferProvider getBufferProvider(final JobID jobID,final ChannelID sourceChannelID) throws IOException, InterruptedException {
  final TransferEnvelopeReceiverList receiverList=getReceiverList(jobID,sourceChannelID);
  if (receiverList.hasLocalReceivers() && !receiverList.hasRemoteReceivers()) {
    final List<ChannelID> localReceivers=receiverList.getLocalReceivers();
    if (localReceivers.size() == 1) {
      final ChannelID localReceiver=localReceivers.get(0);
      final ChannelContext cc=this.registeredChannels.get(localReceiver);
      if (cc == null) {
        return this.transitBufferPool;
      }
      if (!cc.isInputChannel()) {
        throw new IOException("String_Node_Str" + localReceiver + "String_Node_Str");
      }
      final InputChannelContext icc=(InputChannelContext)cc;
      return icc;
    }
  }
  return this.transitBufferPool;
}
Program: 55640
Project: 55640
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public boolean hasDataLeft(){
  return (!this.closeAcknowledgementReceived);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public boolean hasDataLeft(){
  if (this.closeAcknowledgementReceived) {
    return false;
  }
  if ((this.lastSequenceNumberWithReceiverNotFound + 1) == this.sequenceNumber) {
    return false;
  }
  return true;
}
Program: 55641
Project: 55641
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void processEvent(final AbstractEvent event){
  if (event instanceof ByteBufferedChannelCloseEvent) {
    this.closeAcknowledgementReceived=true;
  }
 else   if (event instanceof AbstractTaskEvent) {
    this.byteBufferedOutputChannel.processEvent(event);
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void processEvent(final AbstractEvent event){
  if (event instanceof ByteBufferedChannelCloseEvent) {
    this.closeAcknowledgementReceived=true;
  }
 else   if (event instanceof ReceiverNotFoundEvent) {
    this.lastSequenceNumberWithReceiverNotFound=((ReceiverNotFoundEvent)event).getSequenceNumber();
  }
 else   if (event instanceof AbstractTaskEvent) {
    this.byteBufferedOutputChannel.processEvent(event);
  }
}
Program: 55642
Project: 55642
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public List<TaskSubmissionResult> submitTasks(final List<TaskSubmissionWrapper> tasks) throws IOException {
  final List<TaskSubmissionResult> submissionResultList=new SerializableArrayList<TaskSubmissionResult>();
  final List<Task> tasksToStart=new ArrayList<Task>();
  for (  final TaskSubmissionWrapper tsw : tasks) {
    final RuntimeEnvironment re=tsw.getEnvironment();
    final ExecutionVertexID id=tsw.getVertexID();
    final Configuration jobConfiguration=tsw.getConfiguration();
    final Set<ChannelID> activeOutputChannels=tsw.getActiveOutputChannels();
    final Task task=createAndRegisterTask(id,jobConfiguration,re,activeOutputChannels);
    if (task == null) {
      final TaskSubmissionResult result=new TaskSubmissionResult(id,AbstractTaskResult.ReturnCode.TASK_NOT_FOUND);
      result.setDescription("String_Node_Str" + id + "String_Node_Str");
      LOG.error(result.getDescription());
      submissionResultList.add(result);
    }
 else {
      submissionResultList.add(new TaskSubmissionResult(id,AbstractTaskResult.ReturnCode.SUCCESS));
    }
    tasksToStart.add(task);
  }
  for (  final Task task : tasksToStart) {
    task.startExecution();
  }
  return submissionResultList;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public List<TaskSubmissionResult> submitTasks(final List<TaskSubmissionWrapper> tasks) throws IOException {
  final List<TaskSubmissionResult> submissionResultList=new SerializableArrayList<TaskSubmissionResult>();
  final List<Task> tasksToStart=new ArrayList<Task>();
  for (  final TaskSubmissionWrapper tsw : tasks) {
    final RuntimeEnvironment re=tsw.getEnvironment();
    final ExecutionVertexID id=tsw.getVertexID();
    final Configuration jobConfiguration=tsw.getConfiguration();
    final Set<ChannelID> activeOutputChannels=tsw.getActiveOutputChannels();
    final Task task=createAndRegisterTask(id,jobConfiguration,re,activeOutputChannels);
    if (task == null) {
      final TaskSubmissionResult result=new TaskSubmissionResult(id,AbstractTaskResult.ReturnCode.TASK_NOT_FOUND);
      result.setDescription("String_Node_Str" + re.getTaskNameWithIndex() + "String_Node_Str"+ id+ "String_Node_Str");
      LOG.error(result.getDescription());
      submissionResultList.add(result);
    }
 else {
      submissionResultList.add(new TaskSubmissionResult(id,AbstractTaskResult.ReturnCode.SUCCESS));
      tasksToStart.add(task);
    }
  }
  for (  final Task task : tasksToStart) {
    task.startExecution();
  }
  return submissionResultList;
}
Program: 55643
Project: 55643
Buggy source:
private void waitForAllOutputBrokerToFinish() throws IOException, InterruptedException {
  while (true) {
    boolean finished=true;
    final Iterator<ReplayOutputBroker> it=this.outputBrokerMap.values().iterator();
    while (it.hasNext()) {
      if (it.next().hasFinished()) {
        finished=false;
      }
    }
    if (finished) {
      break;
    }
    Thread.sleep(SLEEPINTERVAL);
  }
}

Fixed version (ground truth):
private void waitForAllOutputBrokerToFinish() throws IOException, InterruptedException {
  while (true) {
    boolean finished=true;
    final Iterator<ReplayOutputBroker> it=this.outputBrokerMap.values().iterator();
    while (it.hasNext()) {
      if (!it.next().hasFinished()) {
        finished=false;
      }
    }
    if (finished) {
      break;
    }
    Thread.sleep(SLEEPINTERVAL);
  }
}
Program: 55646
Project: 55646
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void vertexAssignmentChanged(final ExecutionVertexID id,final AllocatedResource newAllocatedResource){
  final ManagementVertexID managementVertexID=id.toManagementVertexID();
  final long timestamp=System.currentTimeMillis();
  final AbstractInstance instance=newAllocatedResource.getInstance();
  VertexAssignmentEvent event;
  if (instance == null) {
    event=new VertexAssignmentEvent(timestamp,managementVertexID,"String_Node_Str","String_Node_Str");
  }
 else {
    event=new VertexAssignmentEvent(timestamp,managementVertexID,instance.getName(),instance.getType().getIdentifier());
  }
  this.eventCollector.updateManagementGraph(jobID,event);
  this.eventCollector.addEvent(this.jobID,event);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void vertexAssignmentChanged(final ExecutionVertexID id,final AllocatedResource newAllocatedResource){
  final ManagementVertexID managementVertexID=id.toManagementVertexID();
  final long timestamp=System.currentTimeMillis();
  final AbstractInstance instance=newAllocatedResource.getInstance();
  VertexAssignmentEvent event;
  if (instance == null) {
    event=new VertexAssignmentEvent(timestamp,managementVertexID,"String_Node_Str","String_Node_Str");
  }
 else {
    String instanceName=null;
    if (instance.getInstanceConnectionInfo() != null) {
      instanceName=instance.getInstanceConnectionInfo().toString();
    }
 else {
      instanceName=instance.toString();
    }
    event=new VertexAssignmentEvent(timestamp,managementVertexID,instanceName,instance.getType().getIdentifier());
  }
  this.eventCollector.updateManagementGraph(jobID,event);
  this.eventCollector.addEvent(this.jobID,event);
}
Program: 55648
Project: 55648
Buggy source:
/** 
 * Cancels all the tasks in the current and upper stages of the given execution graph.
 * @param eg the execution graph representing the job to cancel.
 * @return <code>null</code> no error occurred during the cancel attempt,otherwise the returned object will describe the error
 */
private TaskCancelResult cancelJob(final ExecutionGraph eg){
  TaskCancelResult errorResult=null;
  final Iterator<ExecutionVertex> it=new ExecutionGraphIterator(eg,eg.getIndexOfCurrentExecutionStage(),false,true);
  while (it.hasNext()) {
    final ExecutionVertex vertex=it.next();
    final TaskCancelResult result=vertex.cancelTask();
    if (result.getReturnCode() == AbstractTaskResult.ReturnCode.ERROR) {
      errorResult=result;
    }
  }
  return errorResult;
}

Fixed version (ground truth):
/** 
 * Cancels all the tasks in the current and upper stages of the given execution graph.
 * @param eg the execution graph representing the job to cancel.
 * @return <code>null</code> if no error occurred during the cancel attempt,otherwise the returned object will describe the error
 */
private TaskCancelResult cancelJob(final ExecutionGraph eg){
  TaskCancelResult errorResult=null;
  final Iterator<ExecutionVertex> it=new ExecutionGraphIterator(eg,eg.getIndexOfCurrentExecutionStage(),false,true);
  while (it.hasNext()) {
    final ExecutionVertex vertex=it.next();
    final TaskCancelResult result=vertex.cancelTask();
    if (result.getReturnCode() == AbstractTaskResult.ReturnCode.ERROR) {
      errorResult=result;
    }
  }
  return errorResult;
}
Program: 55649
Project: 55649
Buggy source:
/** 
 * Returns the associated   {@link Contract} type for the given {@link Stub} class.
 * @param stubClass the stub class
 * @return the associated Contract type
 */
@SuppressWarnings({"String_Node_Str"}) public static Class<? extends Contract> getContractClass(final Class<?> stubClass){
  final Class<?> contract=STUB_CONTRACTS.get(stubClass);
  if (contract == null && stubClass != null)   return getContractClass(stubClass.getSuperclass());
  return (Class<? extends Contract>)contract;
}

Fixed version (ground truth):
/** 
 * Returns the associated   {@link Contract} type for the given {@link Stub} class.
 * @param stubClass the stub class
 * @return the associated Contract type
 */
@SuppressWarnings({"String_Node_Str"}) public static Class<? extends Contract> getContractClass(final Class<?> stubClass){
  if (stubClass == null)   return null;
  final Class<?> contract=STUB_CONTRACTS.get(stubClass);
  if (contract != null)   return (Class<? extends Contract>)contract;
  Iterator<Entry<Class<?>,Class<? extends Contract>>> stubContracts=STUB_CONTRACTS.entrySet().iterator();
  while (stubContracts.hasNext()) {
    Map.Entry<Class<?>,Class<? extends Contract>> entry=stubContracts.next();
    if (entry.getKey().isAssignableFrom(stubClass))     return entry.getValue();
  }
  return null;
}
Program: 55650
Project: 55650
Buggy source:
private void initAdhocInputs() throws IOException {
  for (  final FileDataSource source : this.sources) {
    final TestPairs input=this.getInput(source);
    if (input.isAdhoc())     input.saveToFile(source.getFilePath());
  }
}

Fixed version (ground truth):
private void initAdhocInputs() throws IOException {
  for (  final FileDataSource source : this.sources) {
    final TestRecords input=this.getInput(source);
    if (input.isAdhoc())     input.saveToFile(source.getFilePath());
  }
}
Program: 55651
Project: 55651
Buggy source:
/** 
 * Returns the input   {@link TestPairs} associated with the <i>i</i>th inputof the TestPlan. If multiple contracts are tested in the TestPlan, it is recommended to use the  {@link #getInput(GenericDataSource<?>)} method tounambiguously set the values.
 * @param number the number of the input.
 * @return the <i>i</i>th input of the TestPlan
 */
public TestPairs getInput(final int number){
  return this.getInput(this.getDataSources().get(number));
}

Fixed version (ground truth):
/** 
 * Returns the input   {@link TestPairs} associated with the <i>i</i>th inputof the TestPlan. If multiple contracts are tested in the TestPlan, it is recommended to use the  {@link #getInput(GenericDataSource<?>)} method tounambiguously set the values.
 * @param number the number of the input.
 * @return the <i>i</i>th input of the TestPlan
 */
public TestRecords getInput(final int number){
  return this.getInput(this.getDataSources().get(number));
}
Program: 55652
Project: 55652
Buggy source:
/** 
 * Returns the output   {@link TestPairs} associated with the <i>i</i>thoutput of the TestPlan. If multiple contracts are tested in the TestPlan, it is recommended to use the  {@link #getActualOutput(GenericDataSink)} method to unambiguously get thevalues.<br> The values are only meaningful after a  {@link #run()}.
 * @param number the number of the output.
 * @return the <i>i</i>th output of the TestPlan
 */
public TestPairs getActualOutput(final int number){
  return this.getActualOutput(this.getDataSinks().get(number));
}

Fixed version (ground truth):
/** 
 * Returns the output   {@link TestPairs} associated with the <i>i</i>thoutput of the TestPlan. If multiple contracts are tested in the TestPlan, it is recommended to use the  {@link #getActualOutput(GenericDataSink)} method to unambiguously get thevalues.<br> The values are only meaningful after a  {@link #run()}.
 * @param number the number of the output.
 * @return the <i>i</i>th output of the TestPlan
 */
public TestRecords getActualOutput(final int number){
  return this.getActualOutput(this.getDataSinks().get(number));
}
Program: 55653
Project: 55653
Buggy source:
/** 
 * Returns the expected output   {@link TestPairs} associated with the<i>i</i>th expected output of the TestPlan. If multiple contracts are tested in the TestPlan, it is recommended to use the  {@link #getExpectedOutput(GenericDataSink)} method tounambiguously set the values.
 * @param number the number of the expected output.
 * @return the <i>i</i>th expected output of the TestPlan
 */
public TestPairs getExpectedOutput(final int number,Class<? extends Value>[] schema){
  return this.getExpectedOutput(this.getDataSinks().get(number),schema);
}

Fixed version (ground truth):
/** 
 * Returns the expected output   {@link TestPairs} associated with the<i>i</i>th expected output of the TestPlan. If multiple contracts are tested in the TestPlan, it is recommended to use the  {@link #getExpectedOutput(GenericDataSink)} method tounambiguously set the values.
 * @param number the number of the expected output.
 * @return the <i>i</i>th expected output of the TestPlan
 */
public TestRecords getExpectedOutput(final int number,Class<? extends Value>[] schema){
  return this.getExpectedOutput(this.getDataSinks().get(number),schema);
}
Program: 55654
Project: 55654
Buggy source:
@Override public void close() throws IOException {
  ClosableManager closableManager=new ClosableManager();
  for (  TestPairs pairs : this.inputs.values())   closableManager.add(pairs);
  for (  TestPairs pairs : this.actualOutputs.values())   closableManager.add(pairs);
  for (  TestPairs pairs : this.expectedOutputs.values())   closableManager.add(pairs);
  closableManager.close();
}

Fixed version (ground truth):
@Override public void close() throws IOException {
  ClosableManager closableManager=new ClosableManager();
  for (  TestRecords pairs : this.inputs.values())   closableManager.add(pairs);
  for (  TestRecords pairs : this.actualOutputs.values())   closableManager.add(pairs);
  for (  TestRecords pairs : this.expectedOutputs.values())   closableManager.add(pairs);
  closableManager.close();
}