nus-yam/ex-repair huggingface dataset:
Program: 88065
Project: 88065
Buggy source:
private void writeObject(final ObjectOutputStream oos) throws IOException {
  oos.defaultWriteObject();
  new JsonNode(this.initialAggregate).write(oos);
}

Fixed version (ground truth):
private void writeObject(final ObjectOutputStream oos) throws IOException {
  oos.defaultWriteObject();
  this.initialAggregate.write(oos);
}
Program: 88066
Project: 88066
Buggy source:
@Override public void initialize(){
  try {
    final ByteArrayOutputStream cloneBuffer=new ByteArrayOutputStream();
    final JsonNode cloner=new JsonNode(this.initialAggregate);
    cloner.write(new DataOutputStream(cloneBuffer));
    cloner.read(new DataInputStream(new ByteArrayInputStream(cloneBuffer.toByteArray())));
    this.aggregate=cloner;
  }
 catch (  final IOException e) {
    throw new IllegalStateException("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override public void initialize(){
  try {
    final ByteArrayOutputStream cloneBuffer=new ByteArrayOutputStream();
    final JsonNode cloner=this.initialAggregate;
    cloner.write(new DataOutputStream(cloneBuffer));
    cloner.read(new DataInputStream(new ByteArrayInputStream(cloneBuffer.toByteArray())));
    this.aggregate=cloner;
  }
 catch (  final IOException e) {
    throw new IllegalStateException("String_Node_Str");
  }
}
Program: 88067
Project: 88067
Buggy source:
private void readObject(final ObjectInputStream ois) throws IOException, ClassNotFoundException {
  ois.defaultReadObject();
  final JsonNode pactJsonObject=new JsonNode();
  pactJsonObject.read(ois);
  this.initialAggregate=pactJsonObject;
}

Fixed version (ground truth):
private void readObject(final ObjectInputStream ois) throws IOException, ClassNotFoundException {
  ois.defaultReadObject();
  final JsonNode jsonObject=new ObjectNode();
  jsonObject.read(ois);
  this.initialAggregate=jsonObject;
}
Program: 88068
Project: 88068
Buggy source:
public void writeTree(JsonNode value) throws IOException {
  if (value != null) {
    this.writer.write(value.toString());
    this.writer.flush();
  }
}

Fixed version (ground truth):
public void writeTree(JsonNode value) throws IOException {
  if (value != null) {
    if (!this.isFirst) {
      this.writer.write("String_Node_Str");
    }
    this.writer.write(value.toString());
    this.writer.flush();
    this.isFirst=false;
  }
}
Program: 88069
Project: 88069
Buggy source:
public void writeEndArray() throws IOException {
  JsonToken.END_ARRAY.write(this.writer);
}

Fixed version (ground truth):
public void writeEndArray() throws IOException {
  JsonToken.END_ARRAY.write(this.writer);
  this.writer.flush();
}
Program: 88070
Project: 88070
Buggy source:
public void writeStartArray() throws IOException {
  JsonToken.START_ARRAY.write(this.writer);
}

Fixed version (ground truth):
public void writeStartArray() throws IOException {
  JsonToken.START_ARRAY.write(this.writer);
  this.writer.flush();
}
Program: 88071
Project: 88071
Buggy source:
@Override public int compareTo(Key o){
  return 0;
}

Fixed version (ground truth):
@Override public int compareTo(Key other){
  ArrayNode node=(ArrayNode)other;
  if (node.size() != this.size()) {
    return 1;
  }
  for (int i=0; i < this.size(); i++) {
    int comp=this.get(i).compareTo(node.get(i));
    if (comp != 0) {
      return comp;
    }
  }
  return 0;
}
Program: 88072
Project: 88072
Buggy source:
@Override public KeyValuePair<JsonNode,JsonNode> createPair(){
  return new KeyValuePair<JsonNode,JsonNode>(NullNode.getInstance(),new PactJsonObject());
}

Fixed version (ground truth):
@Override public KeyValuePair<JsonNode,JsonNode> createPair(){
  return new KeyValuePair<JsonNode,JsonNode>(NullNode.getInstance(),new ObjectNode());
}
Program: 88074
Project: 88074
Buggy source:
/** 
 * @param pair
 * @param hashCode
 * @throws IOException
 */
protected final void insertIntoTable(final PactRecord record,final int hashCode) throws IOException {
  final int posHashCode=hashCode % this.numBuckets;
  final int bucketArrayPos=posHashCode >> this.bucketsPerSegmentBits;
  final int bucketInSegmentPos=(posHashCode & this.bucketsPerSegmentMask) << NUM_INTRA_BUCKET_BITS;
  final MemorySegment bucket=this.buckets[bucketArrayPos];
  final int partitionNumber=bucket.get(bucketInSegmentPos + HEADER_PARTITION_OFFSET);
  if (partitionNumber < 0 || partitionNumber >= this.partitionsBeingBuilt.size()) {
    throw new RuntimeException("String_Node_Str");
  }
  final Partition p=this.partitionsBeingBuilt.get(partitionNumber);
  long pointer=p.insertIntoBuildBuffer(record);
  if (pointer == -1) {
    MemorySegment nextSeg=getNextBuffer();
    if (nextSeg == null) {
      spillPartition();
      nextSeg=getNextBuffer();
      if (nextSeg == null) {
        throw new RuntimeException("String_Node_Str");
      }
    }
    p.addBuildSideBuffer(nextSeg);
    pointer=p.insertIntoBuildBuffer(record);
    if (pointer == -1) {
      throw new IOException("String_Node_Str");
    }
  }
  if (p.isInMemory()) {
    insertBucketEntry(p,bucket,bucketInSegmentPos,hashCode,pointer);
  }
 else {
    return;
  }
}

Fixed version (ground truth):
/** 
 * @param pair
 * @param hashCode
 * @throws IOException
 */
protected final void insertIntoTable(final PactRecord record,final int hashCode) throws IOException {
  final int posHashCode=hashCode % this.numBuckets;
  final int bucketArrayPos=posHashCode >> this.bucketsPerSegmentBits;
  final int bucketInSegmentPos=(posHashCode & this.bucketsPerSegmentMask) << NUM_INTRA_BUCKET_BITS;
  final MemorySegment bucket=this.buckets[bucketArrayPos];
  final int partitionNumber=bucket.get(bucketInSegmentPos + HEADER_PARTITION_OFFSET);
  if (partitionNumber < 0 || partitionNumber >= this.partitionsBeingBuilt.size()) {
    throw new RuntimeException("String_Node_Str");
  }
  final Partition p=this.partitionsBeingBuilt.get(partitionNumber);
  long pointer=p.insertIntoBuildBuffer(record);
  if (pointer == -1) {
    MemorySegment nextSeg=getNextBuffer();
    if (nextSeg == null) {
      int spilledPartitionNum=spillPartition();
      if (spilledPartitionNum != partitionNumber) {
        nextSeg=getNextBuffer();
        if (nextSeg == null) {
          throw new RuntimeException("String_Node_Str");
        }
        p.addBuildSideBuffer(nextSeg);
      }
    }
 else {
      p.addBuildSideBuffer(nextSeg);
    }
    pointer=p.insertIntoBuildBuffer(record);
    if (pointer == -1) {
      throw new IOException("String_Node_Str");
    }
  }
  if (p.isInMemory()) {
    insertBucketEntry(p,bucket,bucketInSegmentPos,hashCode,pointer);
  }
 else {
    return;
  }
}
Program: 88075
Project: 88075
Buggy source:
/** 
 * Checks whether there is a floating instance with the specific type. If there are instances available, they will be removed from the list and returned...
 * @param awsAccessId the access ID into AWS
 * @param awsSecretKey the secret key used to generate signatures for authentication
 * @param type the type of the floating instance, which is checked
 * @return a list of suitable floating instances.
 * @throws InstanceException something wrong happens to the global configuration
 */
private LinkedList<FloatingInstance> anyFloatingInstancesAvailable(final String awsAccessId,final String awsSecretKey,final InstanceType type,final int count) throws InstanceException {
  LOG.info("String_Node_Str" + count + "String_Node_Str"+ type.getIdentifier());
  final LinkedList<FloatingInstance> foundfloatinginstances=new LinkedList<FloatingInstance>();
synchronized (this.floatingInstances) {
    final Iterator<Map.Entry<InstanceConnectionInfo,FloatingInstance>> it=this.floatingInstances.entrySet().iterator();
    while (it.hasNext()) {
      final FloatingInstance i=it.next().getValue();
      if (i.isFromThisOwner(awsAccessId,awsSecretKey)) {
        if (i.getType().equals(type)) {
          it.remove();
          foundfloatinginstances.add(i);
        }
      }
    }
  }
  LOG.info("String_Node_Str" + foundfloatinginstances.size() + "String_Node_Str");
  return foundfloatinginstances;
}

Fixed version (ground truth):
/** 
 * Checks whether there is a floating instance with the specific type. If there are instances available, they will be removed from the list and returned...
 * @param awsAccessId the access ID into AWS
 * @param awsSecretKey the secret key used to generate signatures for authentication
 * @param type the type of the floating instance, which is checked
 * @return a list of suitable floating instances.
 * @throws InstanceException something wrong happens to the global configuration
 */
private LinkedList<FloatingInstance> anyFloatingInstancesAvailable(final String awsAccessId,final String awsSecretKey,final InstanceType type,final int count) throws InstanceException {
  LOG.info("String_Node_Str" + count + "String_Node_Str"+ type.getIdentifier());
  final LinkedList<FloatingInstance> foundfloatinginstances=new LinkedList<FloatingInstance>();
synchronized (this.floatingInstances) {
    final Iterator<Map.Entry<InstanceConnectionInfo,FloatingInstance>> it=this.floatingInstances.entrySet().iterator();
    while (it.hasNext()) {
      final FloatingInstance i=it.next().getValue();
      if (i.isFromThisOwner(awsAccessId,awsSecretKey)) {
        if (i.getType().equals(type)) {
          it.remove();
          foundfloatinginstances.add(i);
          if (foundfloatinginstances.size() >= count) {
            break;
          }
        }
      }
    }
  }
  LOG.info("String_Node_Str" + foundfloatinginstances.size() + "String_Node_Str");
  return foundfloatinginstances;
}
Program: 88076
Project: 88076
Buggy source:
void flushQueuedOutgoingEnvelopes() throws IOException, InterruptedException {
  System.out.println("String_Node_Str" + this.queuedOutgoingEnvelopes.size() + "String_Node_Str");
  while (!this.queuedOutgoingEnvelopes.isEmpty()) {
    this.outputGateContext.processEnvelope(this,this.queuedOutgoingEnvelopes.poll());
  }
}

Fixed version (ground truth):
void flushQueuedOutgoingEnvelopes() throws IOException, InterruptedException {
  while (!this.queuedOutgoingEnvelopes.isEmpty()) {
    this.outputGateContext.processEnvelope(this,this.queuedOutgoingEnvelopes.poll());
  }
}
Program: 88077
Project: 88077
Buggy source:
public FSDataOutputStream getFSDataOutputStream() throws Exception {
  long start=System.currentTimeMillis();
  long remaining=this.timeoutMillies;
  if (this.exception != null) {
    throw this.exception;
  }
  if (this.fdos != null) {
    return this.fdos;
  }
synchronized (this.lock) {
    do {
      try {
        this.lock.wait(remaining);
      }
 catch (      InterruptedException iex) {
        this.canceled=true;
        if (this.fdos != null) {
          try {
            this.fdos.close();
          }
 catch (          Throwable t) {
          }
        }
        throw new Exception("String_Node_Str");
      }
    }
 while (this.exception == null && this.fdos == null && (remaining=this.timeoutMillies + start - System.currentTimeMillis()) > 0);
    if (this.exception != null) {
      if (this.fdos != null) {
        try {
          this.fdos.close();
        }
 catch (        Throwable t) {
        }
      }
      throw this.exception;
    }
    if (this.fdos != null) {
      return this.fdos;
    }
  }
  throw new Exception("String_Node_Str");
}

Fixed version (ground truth):
public FSDataOutputStream getFSDataOutputStream() throws Exception {
  long start=System.currentTimeMillis();
  long remaining=this.timeoutMillies;
synchronized (this.lock) {
    boolean success=false;
    try {
      while (this.exception == null && this.fdos == null && (remaining=this.timeoutMillies + start - System.currentTimeMillis()) > 0) {
        this.lock.wait(remaining);
      }
      if (this.exception != null) {
        throw this.exception;
      }
      if (this.fdos != null) {
        success=true;
        return this.fdos;
      }
    }
  finally {
      if (!success) {
        this.canceled=true;
      }
    }
  }
  throw new Exception("String_Node_Str");
}
Program: 88078
Project: 88078
Buggy source:
@Override public void run(){
  try {
    final FileSystem fs=path.getFileSystem();
    Path p=this.path;
    if (fs.exists(this.path) && fs.getFileStatus(this.path).isDir()) {
      p=this.path.suffix("String_Node_Str" + this.taskIndex);
    }
    final FSDataOutputStream stream=fs.create(p,true);
synchronized (this.lock) {
      this.lock.notifyAll();
      if (!this.canceled) {
        this.fdos=stream;
      }
 else {
        this.fdos=null;
        stream.close();
      }
    }
  }
 catch (  Exception t) {
synchronized (this.lock) {
      this.canceled=true;
      this.exception=t;
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    final FileSystem fs=path.getFileSystem();
    Path p=this.path;
    if (fs.exists(this.path) && fs.getFileStatus(this.path).isDir()) {
      p=this.path.suffix("String_Node_Str" + this.taskIndex);
    }
    final FSDataOutputStream stream=fs.create(p,true);
synchronized (this.lock) {
      if (canceled) {
        try {
          stream.close();
        }
 catch (        Throwable t) {
        }
      }
 else {
        this.fdos=stream;
      }
      this.lock.notifyAll();
    }
  }
 catch (  Exception t) {
synchronized (this.lock) {
      this.exception=t;
      this.lock.notifyAll();
    }
  }
catch (  Throwable t) {
synchronized (this.lock) {
      this.exception=new Exception(t);
      this.lock.notifyAll();
    }
  }
}
Program: 88081
Project: 88081
Buggy source:
@Override public void reportPersistenCheckpoint(ExecutionVertexID executionVertexID,JobID jobID){
}

Fixed version (ground truth):
@Override public void reportPersistenCheckpoint(ExecutionVertexID executionVertexID,JobID jobID){
  getExecutionGraphByID(jobID).getVertexByID(executionVertexID).setCheckpoint();
}
Program: 88082
Project: 88082
Buggy source:
@Override public void reportPersistenCheckpoint(ExecutionVertexID executionVertexID,JobID jobID){
}

Fixed version (ground truth):
@Override public void reportPersistenCheckpoint(ExecutionVertexID executionVertexID,JobID jobID){
  this.scheduler.reportPersistenCheckpoint(executionVertexID,jobID);
}
Program: 88083
Project: 88083
Buggy source:
@Override public void reportPersistenCheckpoint(ExecutionVertexID executionVertexID,JobID jobID){
}

Fixed version (ground truth):
@Override public void reportPersistenCheckpoint(ExecutionVertexID executionVertexID,JobID jobID){
  getExecutionGraphByID(jobID).getVertexByID(executionVertexID).setCheckpoint();
}
Program: 88084
Project: 88084
Buggy source:
/** 
 * Private constructor used to duplicate execution vertices.
 * @param vertexID the ID of the new execution vertex.
 * @param invokableClass the task that is assigned to this execution vertex
 * @param executionGraph the execution graph the new vertex belongs to
 * @param groupVertex the group vertex the new vertex belongs to
 */
private ExecutionVertex(ExecutionVertexID vertexID,Class<? extends AbstractInvokable> invokableClass,ExecutionGraph executionGraph,ExecutionGroupVertex groupVertex){
  this.vertexID=vertexID;
  this.invokableClass=invokableClass;
  this.executionGraph=executionGraph;
  this.groupVertex=groupVertex;
}

Fixed version (ground truth):
/** 
 * Private constructor used to duplicate execution vertices.
 * @param vertexID the ID of the new execution vertex.
 * @param invokableClass the task that is assigned to this execution vertex
 * @param executionGraph the execution graph the new vertex belongs to
 * @param groupVertex the group vertex the new vertex belongs to
 */
private ExecutionVertex(ExecutionVertexID vertexID,Class<? extends AbstractInvokable> invokableClass,ExecutionGraph executionGraph,ExecutionGroupVertex groupVertex){
  this.vertexID=vertexID;
  this.invokableClass=invokableClass;
  this.executionGraph=executionGraph;
  this.groupVertex=groupVertex;
  registerExecutionListener(this.executionGraph);
}
Program: 88085
Project: 88085
Buggy source:
/** 
 * Updates the vertex's current execution state.
 * @param newExecutionState the new execution state
 * @param optionalMessage an optional message related to the state change
 */
public synchronized void updateExecutionState(final ExecutionState newExecutionState,final String optionalMessage){
  if (this.executionState == newExecutionState) {
    return;
  }
  ExecutionStateTransition.checkTransition(getName(),this.executionState,newExecutionState);
  final Iterator<ExecutionListener> it=this.executionListeners.iterator();
  while (it.hasNext()) {
    it.next().executionStateChanged(this.executionGraph.getJobID(),this.vertexID,newExecutionState,optionalMessage);
  }
  this.executionState=newExecutionState;
}

Fixed version (ground truth):
/** 
 * Updates the vertex's current execution state.
 * @param newExecutionState the new execution state
 * @param optionalMessage an optional message related to the state change
 */
public synchronized void updateExecutionState(final ExecutionState newExecutionState,final String optionalMessage){
  if (this.executionState == newExecutionState) {
    return;
  }
  ExecutionStateTransition.checkTransition(getName(),this.executionState,newExecutionState);
  this.executionState=newExecutionState;
  final Iterator<ExecutionListener> it=this.executionListeners.iterator();
  while (it.hasNext()) {
    it.next().executionStateChanged(this.executionGraph.getJobID(),this.vertexID,newExecutionState,optionalMessage);
  }
}
Program: 88088
Project: 88088
Buggy source:
/** 
 * Sets the maximum number of members this group vertex can have.
 * @param maxSize the maximum number of members this group vertex can have
 */
void setMaxMemberSize(final int maxSize){
  if (maxSize < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.maxMemberSize=maxSize;
}

Fixed version (ground truth):
/** 
 * Sets the maximum number of members this group vertex can have.
 * @param maxSize the maximum number of members this group vertex can have
 */
void setMaxMemberSize(final int maxSize){
  this.maxMemberSize=maxSize;
}
Program: 88089
Project: 88089
Buggy source:
/** 
 * Sets the minimum number of members this group vertex must have.
 * @param minSize the minimum number of members this group vertex must have
 */
void setMinMemberSize(final int minSize){
  if (minSize < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.minMemberSize=minSize;
}

Fixed version (ground truth):
/** 
 * Sets the minimum number of members this group vertex must have.
 * @param minSize the minimum number of members this group vertex must have
 */
void setMinMemberSize(final int minSize){
  this.minMemberSize=minSize;
}
Program: 88090
Project: 88090
Buggy source:
/** 
 * Cancels and removes the task represented by this vertex from the instance it is currently running on. If the task is not currently running, its execution state is simply updated to <code>CANCELLED</code>.
 * @return the result of the task cancel attempt
 */
public TaskCancelResult cancelTask(){
  if (this.groupVertex.getStageNumber() != this.executionGraph.getIndexOfCurrentExecutionStage()) {
    updateExecutionState(ExecutionState.CANCELED,null);
    return new TaskCancelResult(getID(),AbstractTaskResult.ReturnCode.SUCCESS);
  }
  if (this.executionState == ExecutionState.FINISHED || this.executionState == ExecutionState.FAILED) {
    return new TaskCancelResult(getID(),AbstractTaskResult.ReturnCode.SUCCESS);
  }
  if (this.executionState != ExecutionState.RUNNING && this.executionState != ExecutionState.FINISHING) {
    updateExecutionState(ExecutionState.CANCELED,null);
    return new TaskCancelResult(getID(),AbstractTaskResult.ReturnCode.SUCCESS);
  }
  if (this.allocatedResource == null) {
    final TaskCancelResult result=new TaskCancelResult(getID(),AbstractTaskResult.ReturnCode.ERROR);
    result.setDescription("String_Node_Str" + this.toString() + "String_Node_Str");
    return result;
  }
  try {
    return this.allocatedResource.getInstance().cancelTask(this.vertexID);
  }
 catch (  IOException e) {
    final TaskCancelResult result=new TaskCancelResult(getID(),AbstractTaskResult.ReturnCode.ERROR);
    result.setDescription(StringUtils.stringifyException(e));
    return result;
  }
}

Fixed version (ground truth):
/** 
 * Cancels and removes the task represented by this vertex from the instance it is currently running on. If the task is not currently running, its execution state is simply updated to <code>CANCELLED</code>.
 * @return the result of the task cancel attempt
 */
public TaskCancelResult cancelTask(){
  if (this.groupVertex.getStageNumber() != this.executionGraph.getIndexOfCurrentExecutionStage()) {
    updateExecutionState(ExecutionState.CANCELED,null);
    return new TaskCancelResult(getID(),AbstractTaskResult.ReturnCode.SUCCESS);
  }
  if (this.executionState == ExecutionState.FINISHED || this.executionState == ExecutionState.FAILED) {
    return new TaskCancelResult(getID(),AbstractTaskResult.ReturnCode.SUCCESS);
  }
  if (this.executionState != ExecutionState.RUNNING && this.executionState != ExecutionState.STARTING && this.executionState != ExecutionState.FINISHING) {
    updateExecutionState(ExecutionState.CANCELED,null);
    return new TaskCancelResult(getID(),AbstractTaskResult.ReturnCode.SUCCESS);
  }
  if (this.allocatedResource == null) {
    final TaskCancelResult result=new TaskCancelResult(getID(),AbstractTaskResult.ReturnCode.ERROR);
    result.setDescription("String_Node_Str" + this.toString() + "String_Node_Str");
    return result;
  }
  try {
    return this.allocatedResource.getInstance().cancelTask(this.vertexID);
  }
 catch (  IOException e) {
    final TaskCancelResult result=new TaskCancelResult(getID(),AbstractTaskResult.ReturnCode.ERROR);
    result.setDescription(StringUtils.stringifyException(e));
    return result;
  }
}
Program: 88091
Project: 88091
Buggy source:
private void reassignGraphFragment(final ExecutionVertex vertex,final AllocatedResource oldResource,final AllocatedResource newResource){
  if (oldResource.equals(vertex.getAllocatedResource())) {
    vertex.setAllocatedResource(newResource);
    if (vertex.getExecutionState() == ExecutionState.SCHEDULED) {
      vertex.updateExecutionState(ExecutionState.ASSIGNED);
    }
    final int numberOfOutputGates=vertex.getEnvironment().getNumberOfOutputGates();
    for (int i=0; i < numberOfOutputGates; ++i) {
      final OutputGate<? extends Record> outputGate=vertex.getEnvironment().getOutputGate(i);
      if (outputGate.getChannelType() == ChannelType.NETWORK) {
        continue;
      }
      final int numberOfOutputChannels=outputGate.getNumberOfOutputChannels();
      for (int j=0; j < numberOfOutputChannels; ++j) {
        final AbstractOutputChannel<? extends Record> outputChannel=outputGate.getOutputChannel(j);
        final ExecutionVertex connectedVertex=vertex.getExecutionGraph().getVertexByChannelID(outputChannel.getConnectedChannelID());
        reassignGraphFragment(connectedVertex,oldResource,newResource);
      }
    }
  }
}

Fixed version (ground truth):
private void reassignGraphFragment(final ExecutionVertex vertex,final AllocatedResource oldResource,final AllocatedResource newResource){
synchronized (vertex.getExecutionGraph()) {
    if (oldResource.equals(vertex.getAllocatedResource())) {
      vertex.setAllocatedResource(newResource);
      if (vertex.getExecutionState() == ExecutionState.SCHEDULED) {
        vertex.updateExecutionState(ExecutionState.ASSIGNED);
      }
      final int numberOfOutputGates=vertex.getEnvironment().getNumberOfOutputGates();
      for (int i=0; i < numberOfOutputGates; ++i) {
        final OutputGate<? extends Record> outputGate=vertex.getEnvironment().getOutputGate(i);
        if (outputGate.getChannelType() == ChannelType.NETWORK) {
          continue;
        }
        final int numberOfOutputChannels=outputGate.getNumberOfOutputChannels();
        for (int j=0; j < numberOfOutputChannels; ++j) {
          final AbstractOutputChannel<? extends Record> outputChannel=outputGate.getOutputChannel(j);
          final ExecutionVertex connectedVertex=vertex.getExecutionGraph().getVertexByChannelID(outputChannel.getConnectedChannelID());
          reassignGraphFragment(connectedVertex,oldResource,newResource);
        }
      }
    }
  }
}
Program: 88096
Project: 88096
Buggy source:
@Override public void run() throws Exception {
  final KeyGroupedIterator it=new KeyGroupedIterator(closeableInput.getIterator(),keyPositions,keyClasses);
  while (this.running && it.nextKey()) {
    System.out.println("String_Node_Str" + it.getKeys()[0]);
    crossValues(it.getValues(),output);
  }
}

Fixed version (ground truth):
@Override public void run() throws Exception {
  final KeyGroupedIterator it=new KeyGroupedIterator(closeableInput.getIterator(),keyPositions,keyClasses);
  while (this.running && it.nextKey()) {
    crossValues(it.getValues(),output);
  }
}
Program: 88099
Project: 88099
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void close() throws IOException, InterruptedException {
  this.deserializationBuffer.clear();
  if (this.uncompressedDataBuffer != null) {
    releasedConsumedReadBuffer();
  }
  if (this.getType() == ChannelType.NETWORK) {
synchronized (this.synchronisationObject) {
      if (!this.brokerAggreedToCloseChannel) {
        while (!this.brokerAggreedToCloseChannel) {
          requestReadBuffersFromBroker();
          if (this.uncompressedDataBuffer != null || this.compressedDataBuffer != null) {
            releasedConsumedReadBuffer();
          }
          this.synchronisationObject.wait(500);
        }
        this.bufferedRecord=null;
      }
    }
  }
  if (getType() == ChannelType.NETWORK) {
    transferEvent(new ByteBufferedChannelCloseEvent());
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void close() throws IOException, InterruptedException {
  this.deserializationBuffer.clear();
  if (this.uncompressedDataBuffer != null) {
    releasedConsumedReadBuffer();
  }
  if (this.getType() == ChannelType.NETWORK) {
synchronized (this.synchronisationObject) {
      if (!this.brokerAggreedToCloseChannel) {
        while (!this.brokerAggreedToCloseChannel) {
          requestReadBuffersFromBroker();
          if (this.uncompressedDataBuffer != null || this.compressedDataBuffer != null) {
            releasedConsumedReadBuffer();
          }
          this.synchronisationObject.wait(500);
        }
        this.bufferedRecord=null;
      }
    }
  }
  final ChannelType type=getType();
  if (type == ChannelType.NETWORK || type == ChannelType.INMEMORY) {
    transferEvent(new ByteBufferedChannelCloseEvent());
  }
}
Program: 88101
Project: 88101
Buggy source:
public SerializableHashSet<ChannelID> constructInitialActiveOutputChannelsSet(){
  final SerializableHashSet<ChannelID> activeOutputChannels=new SerializableHashSet<ChannelID>();
synchronized (this) {
    final int numberOfOutputGates=this.environment.getNumberOfOutputGates();
    for (int i=0; i < numberOfOutputGates; ++i) {
      final OutputGate<? extends Record> outputGate=this.environment.getOutputGate(i);
      final ChannelType channelType=outputGate.getChannelType();
      final int numberOfOutputChannels=outputGate.getNumberOfOutputChannels();
      for (int j=0; j < numberOfOutputChannels; ++j) {
        final AbstractOutputChannel<? extends Record> outputChannel=outputGate.getOutputChannel(j);
        if (channelType == ChannelType.FILE) {
          continue;
        }
        if (channelType == ChannelType.INMEMORY) {
          activeOutputChannels.add(outputChannel.getID());
          continue;
        }
        if (channelType == ChannelType.NETWORK) {
          final ExecutionVertex connectedVertex=this.executionGraph.getVertexByChannelID(outputChannel.getConnectedChannelID());
          final ExecutionState state=connectedVertex.getExecutionState();
          if (state == ExecutionState.READY || state == ExecutionState.STARTING || state == ExecutionState.RUNNING) {
            activeOutputChannels.add(outputChannel.getID());
          }
        }
      }
    }
  }
  return activeOutputChannels;
}

Fixed version (ground truth):
public SerializableHashSet<ChannelID> constructInitialActiveOutputChannelsSet(){
  final SerializableHashSet<ChannelID> activeOutputChannels=new SerializableHashSet<ChannelID>();
synchronized (this) {
    final int numberOfOutputGates=this.environment.getNumberOfOutputGates();
    for (int i=0; i < numberOfOutputGates; ++i) {
      final OutputGate<? extends Record> outputGate=this.environment.getOutputGate(i);
      final ChannelType channelType=outputGate.getChannelType();
      final int numberOfOutputChannels=outputGate.getNumberOfOutputChannels();
      for (int j=0; j < numberOfOutputChannels; ++j) {
        final AbstractOutputChannel<? extends Record> outputChannel=outputGate.getOutputChannel(j);
        if (channelType == ChannelType.FILE) {
          activeOutputChannels.add(outputChannel.getID());
          continue;
        }
        if (channelType == ChannelType.INMEMORY) {
          activeOutputChannels.add(outputChannel.getID());
          continue;
        }
        if (channelType == ChannelType.NETWORK) {
          final ExecutionVertex connectedVertex=this.executionGraph.getVertexByChannelID(outputChannel.getConnectedChannelID());
          final ExecutionState state=connectedVertex.getExecutionState();
          if (state == ExecutionState.READY || state == ExecutionState.STARTING || state == ExecutionState.RUNNING) {
            activeOutputChannels.add(outputChannel.getID());
          }
        }
      }
    }
  }
  return activeOutputChannels;
}
Program: 88102
Project: 88102
Buggy source:
public InstanceSummaryProfilingEvent getInstanceSummaryProfilingData(long timestamp){
  final Set<AbstractInstance> tempSet=new HashSet<AbstractInstance>();
  final ExecutionGroupVertexIterator it=new ExecutionGroupVertexIterator(this.executionGraph,true,this.executionGraph.getIndexOfCurrentExecutionStage());
  while (it.hasNext()) {
    final ExecutionGroupVertex groupVertex=it.next();
    for (int i=0; i < groupVertex.getCurrentNumberOfGroupMembers(); i++) {
      final ExecutionVertex executionVertex=groupVertex.getGroupMember(i);
      tempSet.add(executionVertex.getAllocatedResource().getInstance());
    }
  }
  if (tempSet.size() != this.collectedInstanceProfilingData.size()) {
    return null;
  }
  return constructInstanceSummary(timestamp);
}

Fixed version (ground truth):
public InstanceSummaryProfilingEvent getInstanceSummaryProfilingData(long timestamp){
  final Set<AbstractInstance> tempSet=new HashSet<AbstractInstance>();
  final ExecutionGroupVertexIterator it=new ExecutionGroupVertexIterator(this.executionGraph,true,this.executionGraph.getIndexOfCurrentExecutionStage());
  while (it.hasNext()) {
    final ExecutionGroupVertex groupVertex=it.next();
    for (int i=0; i < groupVertex.getCurrentNumberOfGroupMembers(); i++) {
      final ExecutionVertex executionVertex=groupVertex.getGroupMember(i);
      final AbstractInstance instance=executionVertex.getAllocatedResource().getInstance();
      if (!(instance instanceof DummyInstance)) {
        tempSet.add(instance);
      }
    }
  }
  if (tempSet.size() != this.collectedInstanceProfilingData.size()) {
    return null;
  }
  return constructInstanceSummary(timestamp);
}
Program: 88103
Project: 88103
Buggy source:
public SerializableHashSet<ChannelID> constructInitialActiveOutputChannelsSet(){
  final SerializableHashSet<ChannelID> activeOutputChannels=new SerializableHashSet<ChannelID>();
synchronized (this) {
    final int numberOfOutputGates=this.environment.getNumberOfOutputGates();
    for (int i=0; i < numberOfOutputGates; ++i) {
      final OutputGate<? extends Record> outputGate=this.environment.getOutputGate(i);
      final ChannelType channelType=outputGate.getChannelType();
      final int numberOfOutputChannels=outputGate.getNumberOfOutputChannels();
      for (int j=0; j < numberOfOutputChannels; ++j) {
        final AbstractOutputChannel<? extends Record> outputChannel=outputGate.getOutputChannel(j);
        if (channelType == ChannelType.FILE) {
          continue;
        }
        if (channelType == ChannelType.INMEMORY) {
          activeOutputChannels.add(outputChannel.getID());
          continue;
        }
        if (channelType == ChannelType.NETWORK) {
          final ExecutionVertex connectedVertex=this.executionGraph.getVertexByChannelID(outputChannel.getConnectedChannelID());
          final ExecutionState state=connectedVertex.getExecutionState();
          if (state == ExecutionState.READY || state == ExecutionState.RUNNING) {
            activeOutputChannels.add(outputChannel.getID());
          }
        }
      }
    }
  }
  return activeOutputChannels;
}

Fixed version (ground truth):
public SerializableHashSet<ChannelID> constructInitialActiveOutputChannelsSet(){
  final SerializableHashSet<ChannelID> activeOutputChannels=new SerializableHashSet<ChannelID>();
synchronized (this) {
    final int numberOfOutputGates=this.environment.getNumberOfOutputGates();
    for (int i=0; i < numberOfOutputGates; ++i) {
      final OutputGate<? extends Record> outputGate=this.environment.getOutputGate(i);
      final ChannelType channelType=outputGate.getChannelType();
      final int numberOfOutputChannels=outputGate.getNumberOfOutputChannels();
      for (int j=0; j < numberOfOutputChannels; ++j) {
        final AbstractOutputChannel<? extends Record> outputChannel=outputGate.getOutputChannel(j);
        if (channelType == ChannelType.FILE) {
          continue;
        }
        if (channelType == ChannelType.INMEMORY) {
          activeOutputChannels.add(outputChannel.getID());
          continue;
        }
        if (channelType == ChannelType.NETWORK) {
          final ExecutionVertex connectedVertex=this.executionGraph.getVertexByChannelID(outputChannel.getConnectedChannelID());
          final ExecutionState state=connectedVertex.getExecutionState();
          if (state == ExecutionState.READY || state == ExecutionState.STARTING || state == ExecutionState.RUNNING) {
            activeOutputChannels.add(outputChannel.getID());
          }
        }
      }
    }
  }
  return activeOutputChannels;
}
Program: 88104
Project: 88104
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void userThreadFinished(Environment ee,Thread userThread){
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void userThreadFinished(final Environment ee,final Thread userThread){
}
Program: 88105
Project: 88105
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void userThreadStarted(Environment ee,Thread userThread){
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void userThreadStarted(final Environment ee,final Thread userThread){
}
Program: 88109
Project: 88109
Buggy source:
/** 
 * @param stubClass
 * @param dop
 * @return
 */
private JobTaskVertex generateTempVertex(Class<?> stubClass,int dop){
  JobTaskVertex tempVertex=new JobTaskVertex("String_Node_Str",this.jobGraph);
  tempVertex.setTaskClass(TempTask.class);
  TaskConfig tempConfig=new TaskConfig(tempVertex.getConfiguration());
  tempConfig.setStubClass(stubClass);
  assignMemory(tempConfig,PactCompiler.DEFAULT_TEMP_TASK_MEMORY);
  tempVertex.setNumberOfSubtasks(dop);
  return tempVertex;
}

Fixed version (ground truth):
/** 
 * @param stubClass
 * @param dop
 * @return
 */
private JobTaskVertex generateTempVertex(Class<?> stubClass,int dop,int instancesPerMachine){
  JobTaskVertex tempVertex=new JobTaskVertex("String_Node_Str",this.jobGraph);
  tempVertex.setTaskClass(TempTask.class);
  TaskConfig tempConfig=new TaskConfig(tempVertex.getConfiguration());
  tempConfig.setStubClass(stubClass);
  assignMemory(tempConfig,PactCompiler.DEFAULT_TEMP_TASK_MEMORY);
  tempVertex.setNumberOfSubtasks(dop);
  tempVertex.setNumberOfSubtasksPerInstance(instancesPerMachine);
  return tempVertex;
}
Program: 88110
Project: 88110
Buggy source:
/** 
 * Unregisters the given job represented by its   {@link ExecutionGraph} with the input split manager.
 * @param executionGraph the job to be unregistered
 */
public void unregisterJob(final ExecutionGraph executionGraph){
  final Iterator<ExecutionGroupVertex> it=new ExecutionGroupVertexIterator(executionGraph,true,-1);
  while (it.hasNext()) {
    final ExecutionGroupVertex groupVertex=it.next();
    final InputSplitAssigner assigner=this.assignerCache.remove(groupVertex);
    if (assigner == null) {
      LOG.error("String_Node_Str" + groupVertex.getName() + "String_Node_Str");
      continue;
    }
    assigner.unregisterGroupVertex(groupVertex);
  }
}

Fixed version (ground truth):
/** 
 * Unregisters the given job represented by its   {@link ExecutionGraph} with the input split manager.
 * @param executionGraph the job to be unregistered
 */
public void unregisterJob(final ExecutionGraph executionGraph){
  final Iterator<ExecutionGroupVertex> it=new ExecutionGroupVertexIterator(executionGraph,true,-1);
  while (it.hasNext()) {
    final ExecutionGroupVertex groupVertex=it.next();
    final InputSplit[] inputSplits=groupVertex.getInputSplits();
    if (inputSplits == null) {
      continue;
    }
    if (inputSplits.length == 0) {
      continue;
    }
    final InputSplitAssigner assigner=this.assignerCache.remove(groupVertex);
    if (assigner == null) {
      LOG.error("String_Node_Str" + groupVertex.getName() + "String_Node_Str");
      continue;
    }
    assigner.unregisterGroupVertex(groupVertex);
  }
}
Program: 88111
Project: 88111
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void close() throws IOException, InterruptedException {
  this.deserializationBuffer.clear();
  if (this.uncompressedDataBuffer != null) {
    releasedConsumedReadBuffer();
  }
synchronized (this.synchronisationObject) {
    if (!this.brokerAggreedToCloseChannel) {
      while (!this.brokerAggreedToCloseChannel) {
        requestReadBuffersFromBroker();
        if (this.uncompressedDataBuffer != null || this.compressedDataBuffer != null) {
          releasedConsumedReadBuffer();
        }
        this.synchronisationObject.wait(500);
      }
      this.bufferedRecord=null;
    }
  }
  if (getType() == ChannelType.NETWORK) {
    transferEvent(new ByteBufferedChannelCloseEvent());
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void close() throws IOException, InterruptedException {
  this.deserializationBuffer.clear();
  if (this.uncompressedDataBuffer != null) {
    releasedConsumedReadBuffer();
  }
  if (this.getType() == ChannelType.NETWORK) {
synchronized (this.synchronisationObject) {
      if (!this.brokerAggreedToCloseChannel) {
        while (!this.brokerAggreedToCloseChannel) {
          requestReadBuffersFromBroker();
          if (this.uncompressedDataBuffer != null || this.compressedDataBuffer != null) {
            releasedConsumedReadBuffer();
          }
          this.synchronisationObject.wait(500);
        }
        this.bufferedRecord=null;
      }
    }
  }
  if (getType() == ChannelType.NETWORK) {
    transferEvent(new ByteBufferedChannelCloseEvent());
  }
}
Program: 88112
Project: 88112
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void close() throws IOException, InterruptedException {
  this.deserializationBuffer.clear();
  if (this.uncompressedDataBuffer != null) {
    releasedConsumedReadBuffer();
  }
  if (getType() == ChannelType.NETWORK) {
    transferEvent(new ByteBufferedChannelCloseEvent());
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void close() throws IOException, InterruptedException {
  this.deserializationBuffer.clear();
  if (this.uncompressedDataBuffer != null) {
    releasedConsumedReadBuffer();
  }
synchronized (this.synchronisationObject) {
    if (!this.brokerAggreedToCloseChannel) {
      while (!this.brokerAggreedToCloseChannel) {
        requestReadBuffersFromBroker();
        if (this.uncompressedDataBuffer != null || this.compressedDataBuffer != null) {
          releasedConsumedReadBuffer();
        }
        this.synchronisationObject.wait(500);
      }
      this.bufferedRecord=null;
    }
  }
  if (getType() == ChannelType.NETWORK) {
    transferEvent(new ByteBufferedChannelCloseEvent());
  }
}
Program: 88113
Project: 88113
Buggy source:
@Override public void copyToBuffer(final Buffer destinationBuffer) throws IOException {
  if (destinationBuffer.isBackedByMemory()) {
    final long tbr=this.totalBytesRead;
    if (this.fileChannel != null) {
      this.fileBufferManager.releaseFileChannelForReading(this.gateID,this.fileID);
    }
    this.totalBytesRead=0;
    destinationBuffer.write(this);
    destinationBuffer.finishWritePhase();
    if (this.fileChannel != null) {
      this.fileBufferManager.releaseFileChannelForReading(this.gateID,this.fileID);
    }
    this.fileChannel=null;
    this.totalBytesRead=tbr;
    return;
  }
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
@Override public void copyToBuffer(final Buffer destinationBuffer) throws IOException {
  if (destinationBuffer.isBackedByMemory()) {
    final long tbr=this.totalBytesRead;
    if (this.fileChannel != null) {
      this.fileBufferManager.releaseFileChannelForReading(this.gateID,this.fileID);
    }
    this.totalBytesRead=0;
    while (remaining() > 0) {
      destinationBuffer.write(this);
    }
    destinationBuffer.finishWritePhase();
    if (this.fileChannel != null) {
      this.fileBufferManager.releaseFileChannelForReading(this.gateID,this.fileID);
    }
    this.fileChannel=null;
    this.totalBytesRead=tbr;
    return;
  }
  throw new UnsupportedOperationException("String_Node_Str");
}
Program: 88114
Project: 88114
Buggy source:
@Override public void copyToBuffer(Buffer destinationBuffer) throws IOException {
  final int oldPos=this.byteBuffer.position();
  while (remaining() > 0) {
    destinationBuffer.write(this);
  }
  this.byteBuffer.position(oldPos);
  if (!this.writeMode) {
    destinationBuffer.finishWritePhase();
  }
}

Fixed version (ground truth):
@Override public void copyToBuffer(Buffer destinationBuffer) throws IOException {
  final int oldPos=this.byteBuffer.position();
  this.byteBuffer.position(0);
  while (remaining() > 0) {
    destinationBuffer.write(this);
  }
  this.byteBuffer.position(oldPos);
  destinationBuffer.finishWritePhase();
}
Program: 88115
Project: 88115
Buggy source:
@Override public InternalBuffer duplicate() throws IOException, InterruptedException {
  this.fileBufferManager.increaseFileCounter(this.gateID,this.fileID);
  final FileBuffer dup=new FileBuffer((int)this.bufferSize,this.gateID,this.fileBufferManager);
  dup.writeMode=this.writeMode;
  dup.fileID=this.fileID;
  dup.offset=this.offset;
  return dup;
}

Fixed version (ground truth):
@Override public InternalBuffer duplicate() throws IOException, InterruptedException {
  this.fileBufferManager.increaseBufferCounter(this.gateID,this.fileID);
  final FileBuffer dup=new FileBuffer((int)this.bufferSize,this.gateID,this.fileBufferManager);
  dup.writeMode=this.writeMode;
  dup.fileID=this.fileID;
  dup.offset=this.offset;
  return dup;
}
Program: 88116
Project: 88116
Buggy source:
@Override public void recycleBuffer(){
  this.fileBufferManager.releaseFileChannelForReading(this.gateID,this.fileID,true);
}

Fixed version (ground truth):
@Override public void recycleBuffer(){
  try {
    if (this.fileChannel != null) {
      this.fileBufferManager.releaseFileChannelForReading(this.gateID,this.fileID);
      this.fileChannel=null;
    }
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
  this.fileBufferManager.decreaseBufferCounter(this.gateID,this.fileID);
}
Program: 88117
Project: 88117
Buggy source:
@Override public void copyToBuffer(final Buffer destinationBuffer) throws IOException {
  if (destinationBuffer.isBackedByMemory()) {
    final long tbr=this.totalBytesRead;
    if (this.fileChannel != null) {
      this.fileBufferManager.releaseFileChannelForReading(this.gateID,this.fileID,false);
    }
    this.totalBytesRead=0;
    destinationBuffer.write(this);
    destinationBuffer.finishWritePhase();
    this.fileBufferManager.releaseFileChannelForReading(this.gateID,this.fileID,false);
    this.fileChannel=null;
    this.totalBytesRead=tbr;
    return;
  }
  throw new UnsupportedOperationException("String_Node_Str");
}

Fixed version (ground truth):
@Override public void copyToBuffer(final Buffer destinationBuffer) throws IOException {
  if (destinationBuffer.isBackedByMemory()) {
    final long tbr=this.totalBytesRead;
    if (this.fileChannel != null) {
      this.fileBufferManager.releaseFileChannelForReading(this.gateID,this.fileID);
    }
    this.totalBytesRead=0;
    destinationBuffer.write(this);
    destinationBuffer.finishWritePhase();
    if (this.fileChannel != null) {
      this.fileBufferManager.releaseFileChannelForReading(this.gateID,this.fileID);
    }
    this.fileChannel=null;
    this.totalBytesRead=tbr;
    return;
  }
  throw new UnsupportedOperationException("String_Node_Str");
}
Program: 88118
Project: 88118
Buggy source:
@Override public int read(ByteBuffer dst) throws IOException {
  if (this.writeMode) {
    throw new IOException("String_Node_Str");
  }
  if (this.fileChannel == null) {
    try {
      this.fileChannel=this.fileBufferManager.getFileChannelForReading(this.gateID,this.fileID);
    }
 catch (    InterruptedException e) {
      return -1;
    }
    if (this.fileChannel.position() != this.offset) {
      this.fileChannel.position(this.offset);
    }
  }
  if (this.totalBytesRead >= this.bufferSize) {
    return -1;
  }
  final int rem=remaining();
  int bytesRead;
  if (dst.remaining() > rem) {
    final int excess=dst.remaining() - rem;
    dst.limit(dst.limit() - excess);
    bytesRead=this.fileChannel.read(dst);
    dst.limit(dst.limit() + excess);
  }
 else {
    bytesRead=this.fileChannel.read(dst);
  }
  if (bytesRead < 0) {
    return -1;
  }
  this.totalBytesRead+=bytesRead;
  return bytesRead;
}

Fixed version (ground truth):
@Override public int read(ByteBuffer dst) throws IOException {
  if (this.writeMode) {
    throw new IOException("String_Node_Str");
  }
  if (this.fileChannel == null) {
    try {
      this.fileChannel=this.fileBufferManager.getFileChannelForReading(this.gateID,this.fileID);
    }
 catch (    InterruptedException e) {
      return -1;
    }
    if (this.fileChannel.position() != (this.offset + this.totalBytesRead)) {
      this.fileChannel.position(this.offset + this.totalBytesRead);
    }
  }
  if (this.totalBytesRead >= this.bufferSize) {
    return -1;
  }
  final int rem=remaining();
  int bytesRead;
  if (dst.remaining() > rem) {
    final int excess=dst.remaining() - rem;
    dst.limit(dst.limit() - excess);
    bytesRead=this.fileChannel.read(dst);
    dst.limit(dst.limit() + excess);
  }
 else {
    bytesRead=this.fileChannel.read(dst);
  }
  if (bytesRead < 0) {
    return -1;
  }
  this.totalBytesRead+=bytesRead;
  return bytesRead;
}
Program: 88119
Project: 88119
Buggy source:
@Override public void finishWritePhase() throws IOException {
  if (this.writeMode) {
    final long currentFileSize=this.offset + this.totalBytesWritten;
    this.fileChannel=null;
    this.bufferSize=this.totalBytesWritten;
    this.writeMode=false;
    this.fileID=this.fileBufferManager.reportEndOfWritePhase(this.gateID,currentFileSize);
  }
}

Fixed version (ground truth):
@Override public void finishWritePhase() throws IOException {
  if (this.writeMode) {
    final long currentFileSize=this.offset + this.totalBytesWritten;
    if (this.fileChannel != null) {
      this.fileChannel.position(currentFileSize);
    }
    this.fileChannel=null;
    this.bufferSize=this.totalBytesWritten;
    this.writeMode=false;
    this.fileID=this.fileBufferManager.reportEndOfWritePhase(this.gateID,currentFileSize);
  }
}
Program: 88120
Project: 88120
Buggy source:
@Override public void recycleBuffer(){
  this.fileBufferManager.reportFileBufferAsConsumed(this.gateID,this.fileID);
}

Fixed version (ground truth):
@Override public void recycleBuffer(){
  this.fileBufferManager.releaseFileChannelForReading(this.gateID,this.fileID,true);
}