nus-yam/ex-repair huggingface dataset:
Program: 87598
Project: 87598
Buggy source:
@Override protected void coGroup(final IArrayNode representationsNode,final IArrayNode pointsNode,final JsonCollector out){
  if (representationsNode.size() != 1)   throw new IllegalStateException("String_Node_Str" + representationsNode.size());
  final ObjectNode representationNode=(ObjectNode)representationsNode.get(0);
  final String id=JsonUtil2.getField(representationNode,"String_Node_Str",TextNode.class).getJavaValue();
  final Point oldClustroid=new Point();
  oldClustroid.read(representationNode.get("String_Node_Str"));
  final ClusterRepresentation representation=new ClusterRepresentation(id,oldClustroid,this.representationDetail);
  for (  final IJsonNode memberNode : pointsNode) {
    final Point point=new Point();
    point.read(memberNode);
    representation.add(point);
  }
  this.emitRepresentation(representation,oldClustroid,out);
}

Fixed version (ground truth):
@Override protected void coGroup(final IArrayNode representationsNode,final IArrayNode pointsNode,final JsonCollector out){
  if (representationsNode.size() != 1)   throw new IllegalStateException("String_Node_Str" + representationsNode.size());
  final ObjectNode representationNode=(ObjectNode)representationsNode.get(0);
  final String id=JsonUtil2.getField(representationNode,RepresentationNodes.ID,TextNode.class).getJavaValue();
  final Point oldClustroid=new Point();
  oldClustroid.read(representationNode.get(RepresentationNodes.CLUSTROID));
  final ClusterRepresentation representation=new ClusterRepresentation(id,oldClustroid,this.representationDetail);
  for (  final IJsonNode memberNode : pointsNode) {
    final Point point=new Point();
    point.read(memberNode);
    representation.add(point);
  }
  this.emitRepresentation(representation,oldClustroid,out);
}
Program: 87599
Project: 87599
Buggy source:
private void emit(final String id,final Point clustroid,final int flag,final String oldId,final JsonCollector collector){
  this.outputNode.clear();
  if (clustroid == null)   throw new IllegalArgumentException("String_Node_Str" + id);
  this.idNode.setValue(id);
  this.outputNode.put("String_Node_Str",this.idNode);
  this.outputNode.put("String_Node_Str",clustroid.write(this.pointNode));
  this.flagNode.setValue(flag);
  this.outputNode.put("String_Node_Str",this.flagNode);
  this.oldIdNode.setValue(oldId);
  this.outputNode.put("String_Node_Str",this.oldIdNode);
  collector.collect(this.outputNode);
}

Fixed version (ground truth):
private void emit(final String id,final Point clustroid,final int flag,final String oldId,final JsonCollector collector){
  this.outputNode.clear();
  if (clustroid == null)   throw new IllegalArgumentException("String_Node_Str" + id);
  this.idNode.setValue(id);
  this.flagNode.setValue(flag);
  this.oldIdNode.setValue(oldId);
  clustroid.write(this.pointNode);
  RepresentationNodes.write(outputNode,idNode,oldIdNode,pointNode);
  RepresentationNodes.setFlag(outputNode,flagNode);
  collector.collect(this.outputNode);
}
Program: 87600
Project: 87600
Buggy source:
@Override protected void coGroup(final IArrayNode representationNodes,final IArrayNode pointNodes,final JsonCollector out){
  if (representationNodes.size() != 2)   throw new IllegalArgumentException("String_Node_Str" + representationNodes.size());
  final ObjectNode representationNode1=(ObjectNode)representationNodes.get(0);
  final ObjectNode representationNode2=(ObjectNode)representationNodes.get(1);
  this.representation1=RepresentationNodes.read(representationNode1,this.representationDetail);
  this.representation2=RepresentationNodes.read(representationNode2,this.representationDetail);
  this.parentId=RepresentationNodes.getParentId(representationNode1).getTextValue();
  this.addAll(pointNodes);
  this.emitRepresentations(out);
}

Fixed version (ground truth):
@Override protected void coGroup(final IArrayNode representationNodes,final IArrayNode pointNodes,final JsonCollector out){
  final int representationCount=representationNodes.size();
  if (representationCount == 0)   return;
 else   if (representationCount != 2)   throw new IllegalArgumentException("String_Node_Str" + representationCount + "String_Node_Str"+ pointNodes.size()+ "String_Node_Str");
  final ObjectNode representationNode1=(ObjectNode)representationNodes.get(0);
  final ObjectNode representationNode2=(ObjectNode)representationNodes.get(1);
  this.representation1=RepresentationNodes.read(representationNode1,this.representationDetail);
  this.representation2=RepresentationNodes.read(representationNode2,this.representationDetail);
  this.parentId=RepresentationNodes.getParentId(representationNode1).getTextValue();
  this.addAll(pointNodes);
  this.emitRepresentations(out);
}
Program: 87601
Project: 87601
Buggy source:
@Override public void read(final IJsonNode node){
  this.degree=JsonUtil2.getField(node,JSON_KEY_DEGREE,IntNode.class).getIntValue();
  this.root=this.createInnerNode();
  this.root.read(JsonUtil2.getField(node,JSON_KEY_ROOT,ObjectNode.class));
}

Fixed version (ground truth):
@Override public void read(final IJsonNode node){
  try {
    this.degree=JsonUtil2.getField(node,JSON_KEY_DEGREE,IntNode.class).getIntValue();
  }
 catch (  ClassCastException e) {
    System.out.println("String_Node_Str" + node);
    throw e;
  }
  this.root=this.createInnerNode();
  this.root.read(JsonUtil2.getField(node,JSON_KEY_ROOT,ObjectNode.class));
}
Program: 87602
Project: 87602
Buggy source:
@Override protected void map(final IJsonNode value,final JsonCollector out){
  System.out.println("String_Node_Str" + value);
  final ObjectNode clusterNode=(ObjectNode)value;
  final TextNode idNode=ClusterNodes.getId(clusterNode);
  final ObjectNode clustroidNode=ClusterNodes.getClustroid(clusterNode);
  RepresentationNodes.write(this.outputNode,idNode,clustroidNode);
  AnnotatorNodes.flatAnnotate(this.outputNode,DUMMY_ANNOTATION);
  out.collect(this.outputNode);
}

Fixed version (ground truth):
@Override protected void map(final IJsonNode value,final JsonCollector out){
  final ObjectNode clusterNode=(ObjectNode)value;
  final TextNode idNode=ClusterNodes.getId(clusterNode);
  final ObjectNode clustroidNode=ClusterNodes.getClustroid(clusterNode);
  RepresentationNodes.write(this.outputNode,idNode,clustroidNode);
  AnnotatorNodes.flatAnnotate(this.outputNode,DUMMY_ANNOTATION);
  out.collect(this.outputNode);
}
Program: 87603
Project: 87603
Buggy source:
/** 
 * Creates an instance that wraps the plan defined in the jar file using the given arguments. For generating the plan the class defined in the className parameter is used.
 * @param jarFile The jar file which contains the plan.
 * @param className Name of the class which generates the plan. Overrides the class defined in the jar file manifest
 * @param args Optional. The arguments used to create the pact plan, depend on implementation of the pact plan. See getDescription().
 * @throws ProgramInvocationException This invocation is thrown if the PlanAssembler can't be properly loaded. Causes may be a missing / wrong class or manifest files.
 */
public PactProgram(File jarFile,String className,String... args) throws ProgramInvocationException {
  this.jarFile=jarFile;
  this.args=args;
  this.assemblerClass=getPactAssemblerFromJar(jarFile,className);
}

Fixed version (ground truth):
/** 
 * Creates an instance that wraps the plan defined in the jar file using the given arguments. For generating the plan the class defined in the className parameter is used.
 * @param jarFile The jar file which contains the plan.
 * @param className Name of the class which generates the plan. Overrides the class defined in the jar file manifest
 * @param args Optional. The arguments used to create the pact plan, depend on implementation of the pact plan. See getDescription().
 * @throws ProgramInvocationException This invocation is thrown if the PlanAssembler can't be properly loaded. Causes may be a missing / wrong class or manifest files.
 */
public PactProgram(File jarFile,String className,String... args) throws ProgramInvocationException {
  this.jarFile=jarFile;
  this.args=args == null ? new String[0] : args;
  this.assemblerClass=getPactAssemblerFromJar(jarFile,className);
}
Program: 87604
Project: 87604
Buggy source:
@Override public boolean readRecord(PactRecord target,byte[] bytes,int offset,int numBytes){
  this.keyString.setValueAscii(bytes,0,1);
  this.valueString.setValueAscii(bytes,2,1);
  target.setField(0,keyString);
  target.setField(1,valueString);
  LOG.debug("String_Node_Str" + keyString.getValue() + "String_Node_Str"+ valueString.getValue()+ "String_Node_Str");
  return true;
}

Fixed version (ground truth):
@Override public boolean readRecord(PactRecord target,byte[] bytes,int offset,int numBytes){
  this.keyString.setValueAscii(bytes,offset,1);
  this.valueString.setValueAscii(bytes,offset + 2,1);
  target.setField(0,keyString);
  target.setField(1,valueString);
  LOG.debug("String_Node_Str" + keyString.getValue() + "String_Node_Str"+ valueString.getValue()+ "String_Node_Str");
  return true;
}
Program: 87605
Project: 87605
Buggy source:
@Override public boolean readRecord(PactRecord target,byte[] bytes,int offset,int numBytes){
  this.keyString.setValueAscii(bytes,0,1);
  this.valueString.setValueAscii(bytes,2,1);
  target.setField(0,keyString);
  target.setField(1,valueString);
  LOG.debug("String_Node_Str" + keyString.getValue() + "String_Node_Str"+ valueString.getValue()+ "String_Node_Str");
  return true;
}

Fixed version (ground truth):
@Override public boolean readRecord(PactRecord target,byte[] bytes,int offset,int numBytes){
  this.keyString.setValueAscii(bytes,offset,1);
  this.valueString.setValueAscii(bytes,offset + 2,1);
  target.setField(0,keyString);
  target.setField(1,valueString);
  LOG.debug("String_Node_Str" + keyString.getValue() + "String_Node_Str"+ valueString.getValue()+ "String_Node_Str");
  return true;
}
Program: 87606
Project: 87606
Buggy source:
@Override public boolean readRecord(PactRecord target,byte[] line,int offset,int numBytes){
  final int limit=offset + numBytes;
  int readPos=offset;
  short[] offsets=new short[MAX_COLUMNS];
  int col=1;
  int countInWrapBuffer=0;
  int startPos=readPos;
  while (readPos < limit) {
    if (line[readPos++] == DELIMITER) {
      offsets[col++]=(short)(countInWrapBuffer + readPos - startPos);
    }
  }
  Tuple value=new Tuple(line,offsets,col - 1);
  PactInteger key=new PactInteger((int)value.getLongValueAt(0));
  target.setField(0,key);
  target.setField(1,value);
  return true;
}

Fixed version (ground truth):
@Override public boolean readRecord(PactRecord target,byte[] line,int offset,int numBytes){
  final int limit=offset + numBytes;
  int readPos=offset;
  final short[] offsets=this.offsets;
  offsets[0]=(short)offset;
  int col=1;
  while (readPos < limit) {
    if (line[readPos++] == DELIMITER) {
      offsets[col++]=(short)(readPos);
    }
  }
  final Tuple value=new Tuple(line,offsets,col - 1);
  this.key.setValue((int)value.getLongValueAt(0));
  target.setField(0,this.key);
  target.setField(1,value);
  return true;
}
Program: 87608
Project: 87608
Buggy source:
/** 
 * Converts a long to a byte array.
 * @param l the long variable to be converted
 * @param ba the byte array to store the result the of the conversion
 * @param offset the offset indicating at what position inside the byte array the result of the conversion shall be stored
 */
private static void longToByteArray(final long l,final byte[] ba,final int offset){
  for (int i=0; i < Long.SIZE; ++i) {
    final int shift=i << 3;
    ba[offset + Long.SIZE - 1 - i]=(byte)((l & (0xffL << shift)) >>> shift);
  }
}

Fixed version (ground truth):
/** 
 * Converts a long to a byte array.
 * @param l the long variable to be converted
 * @param ba the byte array to store the result the of the conversion
 * @param offset the offset indicating at what position inside the byte array the result of the conversion shall be stored
 */
private static void longToByteArray(final long l,final byte[] ba,final int offset){
  for (int i=0; i < SIZE_OF_LONG; ++i) {
    final int shift=i << 3;
    ba[offset + SIZE_OF_LONG - 1 - i]=(byte)((l & (0xffL << shift)) >>> shift);
  }
}
Program: 87609
Project: 87609
Buggy source:
/** 
 * Converts the given byte array to a long.
 * @param ba the byte array to be converted
 * @param offset the offset indicating at which byte inside the array the conversion shall begin
 * @return the long variable
 */
private static long byteArrayToLong(final byte[] ba,final int offset){
  long l=0;
  for (int i=0; i < Long.SIZE; ++i) {
    l|=(ba[offset + Long.SIZE - 1 - i] & 0xffL) << (i << 3);
  }
  return l;
}

Fixed version (ground truth):
/** 
 * Converts the given byte array to a long.
 * @param ba the byte array to be converted
 * @param offset the offset indicating at which byte inside the array the conversion shall begin
 * @return the long variable
 */
private static long byteArrayToLong(final byte[] ba,final int offset){
  long l=0;
  for (int i=0; i < SIZE_OF_LONG; ++i) {
    l|=(ba[offset + SIZE_OF_LONG - 1 - i] & 0xffL) << (i << 3);
  }
  return l;
}
Program: 87610
Project: 87610
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public String toString(){
  final byte[] ba=new byte[SIZE];
  longToByteArray(this.lowerPart,ba,0);
  longToByteArray(this.upperPart,ba,Long.SIZE);
  return StringUtils.byteToHexString(ba);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public String toString(){
  final byte[] ba=new byte[SIZE];
  longToByteArray(this.lowerPart,ba,0);
  longToByteArray(this.upperPart,ba,SIZE_OF_LONG);
  return StringUtils.byteToHexString(ba);
}
Program: 87611
Project: 87611
Buggy source:
@Override protected boolean readBufferData(final ReadableByteChannel readableByteChannel) throws IOException {
  final ByteBuffer tempBuffer=getTempBuffer();
  if (!this.bufferDataSerializationStarted) {
    tempBuffer.clear();
    this.bufferDataSerializationStarted=true;
  }
  readableByteChannel.read(tempBuffer);
  if (tempBuffer.hasRemaining()) {
    return true;
  }
  final long offset=byteBufferToLong(tempBuffer);
  final Buffer fileBuffer=BufferFactory.createFromCheckpoint(getSizeOfBuffer(),offset,this.ownerID,this.fileBufferManager,this.distributed);
  setBuffer(fileBuffer);
  this.bufferDataSerializationStarted=false;
  return false;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override protected boolean readBufferData(final ReadableByteChannel readableByteChannel) throws IOException {
  final ByteBuffer tempBuffer=getTempBuffer();
  if (!this.bufferDataSerializationStarted) {
    tempBuffer.clear();
    this.bufferDataSerializationStarted=true;
  }
  readableByteChannel.read(tempBuffer);
  if (tempBuffer.hasRemaining()) {
    return true;
  }
  final long offset=byteBufferToLong(tempBuffer);
  final Buffer fileBuffer=BufferFactory.createFromCheckpoint(getSizeOfBuffer(),offset,this.ownerID,this.fileBufferManager,this.distributed);
  setBuffer(fileBuffer);
  this.bufferDataSerializationStarted=false;
  return false;
}
Program: 87612
Project: 87612
Buggy source:
private long byteBufferToLong(final ByteBuffer byteBuffer) throws IOException {
  long l=0;
  if (Long.SIZE > byteBuffer.limit()) {
    throw new IOException("String_Node_Str" + byteBuffer.limit() + "String_Node_Str");
  }
  for (int i=0; i < Long.SIZE; ++i) {
    l|=(byteBuffer.get((Long.SIZE - 1) - i) & 0xffL) << (i << 3);
  }
  return l;
}

Fixed version (ground truth):
private long byteBufferToLong(final ByteBuffer byteBuffer) throws IOException {
  long l=0;
  if (SIZE_OF_LONG > byteBuffer.limit()) {
    throw new IOException("String_Node_Str" + byteBuffer.limit() + "String_Node_Str");
  }
  for (int i=0; i < SIZE_OF_LONG; ++i) {
    l|=(byteBuffer.get((SIZE_OF_LONG - 1) - i) & 0xffL) << (i << 3);
  }
  return l;
}
Program: 87613
Project: 87613
Buggy source:
private void longToByteBuffer(long longToSerialize,ByteBuffer byteBuffer) throws IOException {
  if (Long.SIZE > byteBuffer.capacity()) {
    throw new IOException("String_Node_Str" + byteBuffer.limit() + "String_Node_Str"+ Long.SIZE+ "String_Node_Str");
  }
  byteBuffer.limit(Long.SIZE);
  for (int i=0; i < Long.SIZE; ++i) {
    final int shift=i << 3;
    byteBuffer.put((Long.SIZE - 1) - i,(byte)((longToSerialize & (0xffL << shift)) >>> shift));
  }
}

Fixed version (ground truth):
private void longToByteBuffer(long longToSerialize,ByteBuffer byteBuffer) throws IOException {
  if (SIZE_OF_LONG > byteBuffer.capacity()) {
    throw new IOException("String_Node_Str" + byteBuffer.limit() + "String_Node_Str"+ SIZE_OF_LONG+ "String_Node_Str");
  }
  byteBuffer.limit(SIZE_OF_LONG);
  for (int i=0; i < SIZE_OF_LONG; ++i) {
    final int shift=i << 3;
    byteBuffer.put((SIZE_OF_LONG - 1) - i,(byte)((longToSerialize & (0xffL << shift)) >>> shift));
  }
}
Program: 87614
Project: 87614
Buggy source:
@Override public ElementarySopremoModule asElementaryOperators(){
  final ElementarySopremoModule module=new ElementarySopremoModule(this.getName(),this.getInputs().size(),this.getOutputs().size());
  final Operator<Self> clone=this.clone();
  for (int index=0; index < this.getInputs().size(); index++)   clone.setInput(index,module.getInput(index));
  for (int index=0; index < this.getOutputs().size(); index++)   module.getOutput(index).setInput(index,clone.getOutput(index));
  return module;
}

Fixed version (ground truth):
@Override public ElementarySopremoModule asElementaryOperators(){
  final ElementarySopremoModule module=new ElementarySopremoModule(this.getName(),this.getInputs().size(),this.getOutputs().size());
  final Operator<Self> clone=this.clone();
  for (int index=0; index < this.getInputs().size(); index++)   clone.setInput(index,module.getInput(index));
  final List<JsonStream> outputs=clone.getOutputs();
  for (int index=0; index < outputs.size(); index++)   module.getOutput(index).setInput(index,outputs.get(index));
  return module;
}
Program: 87615
Project: 87615
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void registerOutputGate(final OutputGate<? extends Record> outputGate){
  throw new IllegalStateException("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void registerOutputGate(final OutputGate<? extends Record> outputGate){
}
Program: 87616
Project: 87616
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void registerInputGate(final InputGate<? extends Record> inputGate){
  throw new IllegalStateException("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void registerInputGate(final InputGate<? extends Record> inputGate){
}
Program: 87618
Project: 87618
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void bufferAvailable(){
synchronized (this.pendingReadEventSubscribeRequests) {
    this.pendingReadEventSubscribeRequests.add(this.canceledKey);
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void bufferAvailable(){
synchronized (this.pendingReadEventSubscribeRequests) {
    this.pendingReadEventSubscribeRequests.add(this.key);
  }
}
Program: 87619
Project: 87619
Buggy source:
private IncomingConnectionBufferAvailListener(final Queue<SelectionKey> pendingReadEventSubscribeRequests,final SelectionKey canceledKey){
  this.pendingReadEventSubscribeRequests=pendingReadEventSubscribeRequests;
  this.canceledKey=canceledKey;
}

Fixed version (ground truth):
private IncomingConnectionBufferAvailListener(final Queue<SelectionKey> pendingReadEventSubscribeRequests,final SelectionKey key){
  this.pendingReadEventSubscribeRequests=pendingReadEventSubscribeRequests;
  this.key=key;
}
Program: 87620
Project: 87620
Buggy source:
private void doRead(SelectionKey key){
  final IncomingConnection incomingConnection=(IncomingConnection)key.attachment();
  try {
    incomingConnection.read();
  }
 catch (  EOFException eof) {
    if (incomingConnection.isCloseUnexpected()) {
      final SocketChannel socketChannel=(SocketChannel)key.channel();
      LOG.error("String_Node_Str" + socketChannel.socket().getRemoteSocketAddress() + "String_Node_Str");
      incomingConnection.reportTransmissionProblem(key,eof);
    }
 else {
      incomingConnection.closeConnection(key);
    }
  }
catch (  IOException ioe) {
    incomingConnection.reportTransmissionProblem(key,ioe);
  }
catch (  InterruptedException e) {
  }
catch (  NoBufferAvailableException e) {
    key.cancel();
    final BufferAvailabilityListener bal=new IncomingConnectionBufferAvailListener(this.pendingReadEventSubscribeRequests,key);
    if (!e.getBufferProvider().registerBufferAvailabilityListener(bal)) {
      final SocketChannel socketChannel=(SocketChannel)key.channel();
      try {
        final SelectionKey newKey=socketChannel.register(this.selector,SelectionKey.OP_READ);
        newKey.attach(incomingConnection);
      }
 catch (      ClosedChannelException e1) {
        incomingConnection.reportTransmissionProblem(key,e1);
      }
    }
  }
}

Fixed version (ground truth):
private void doRead(SelectionKey key){
  final IncomingConnection incomingConnection=(IncomingConnection)key.attachment();
  try {
    incomingConnection.read();
  }
 catch (  EOFException eof) {
    if (incomingConnection.isCloseUnexpected()) {
      final SocketChannel socketChannel=(SocketChannel)key.channel();
      LOG.error("String_Node_Str" + socketChannel.socket().getRemoteSocketAddress() + "String_Node_Str");
      incomingConnection.reportTransmissionProblem(key,eof);
    }
 else {
      incomingConnection.closeConnection(key);
    }
  }
catch (  IOException ioe) {
    incomingConnection.reportTransmissionProblem(key,ioe);
  }
catch (  InterruptedException e) {
  }
catch (  NoBufferAvailableException e) {
    final SocketChannel socketChannel=(SocketChannel)key.channel();
    try {
      final SelectionKey newKey=socketChannel.register(this.selector,0);
      newKey.attach(incomingConnection);
    }
 catch (    ClosedChannelException e1) {
      incomingConnection.reportTransmissionProblem(key,e1);
    }
    final BufferAvailabilityListener bal=new IncomingConnectionBufferAvailListener(this.pendingReadEventSubscribeRequests,key);
    if (!e.getBufferProvider().registerBufferAvailabilityListener(bal)) {
      try {
        final SelectionKey newKey=socketChannel.register(this.selector,SelectionKey.OP_READ);
        newKey.attach(incomingConnection);
      }
 catch (      ClosedChannelException e1) {
        incomingConnection.reportTransmissionProblem(key,e1);
      }
    }
  }
}
Program: 87622
Project: 87622
Buggy source:
/** 
 * Removes the checkpoint of the vertex with the given ID. All files contained in the checkpoint are deleted.
 * @param vertexID the vertex whose checkpoint shall be removed
 */
public static void removeCheckpoint(final ExecutionVertexID vertexID){
  final Path localChPath=getLocalCheckpointPath();
  try {
    if (!removeCheckpointMetaData(new Path(localChPath + Path.SEPARATOR + METADATA_PREFIX+ "String_Node_Str"+ vertexID))) {
      final Path distributedChPath=getDistributedCheckpointPath();
      if (distributedChPath != null) {
        removeCheckpointMetaData(new Path(distributedChPath + Path.SEPARATOR + METADATA_PREFIX+ "String_Node_Str"+ vertexID));
      }
    }
    FileBufferManager.deleteFile(vertexID);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * Removes the checkpoint of the vertex with the given ID. All files contained in the checkpoint are deleted.
 * @param vertexID the vertex whose checkpoint shall be removed
 */
public static void removeCheckpoint(final ExecutionVertexID vertexID){
  final Path localChPath=getLocalCheckpointPath();
  try {
    if (!removeCheckpointMetaData(new Path(localChPath + Path.SEPARATOR + METADATA_PREFIX+ "String_Node_Str"+ vertexID))) {
      final Path distributedChPath=getDistributedCheckpointPath();
      if (distributedChPath != null && allowDistributedCheckpoints()) {
        removeCheckpointMetaData(new Path(distributedChPath + Path.SEPARATOR + METADATA_PREFIX+ "String_Node_Str"+ vertexID));
      }
    }
    FileBufferManager.deleteFile(vertexID);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}
Program: 87623
Project: 87623
Buggy source:
private static boolean checkForCheckpoint(final ExecutionVertexID vertexID,final String suffix){
  try {
    final Path local=new Path(getLocalCheckpointPath() + Path.SEPARATOR + METADATA_PREFIX+ "String_Node_Str"+ vertexID+ suffix);
    final FileSystem localFs=local.getFileSystem();
    if (localFs.exists(local)) {
      return true;
    }
    final Path distributedCheckpointPath=getDistributedCheckpointPath();
    if (distributedCheckpointPath == null) {
      return false;
    }
    final Path distributed=new Path(distributedCheckpointPath + Path.SEPARATOR + METADATA_PREFIX+ "String_Node_Str"+ vertexID+ suffix);
    final FileSystem distFs=distributed.getFileSystem();
    return distFs.exists(distributed);
  }
 catch (  IOException ioe) {
    LOG.warn(StringUtils.stringifyException(ioe));
  }
  return false;
}

Fixed version (ground truth):
private static boolean checkForCheckpoint(final ExecutionVertexID vertexID,final String suffix){
  try {
    final Path local=new Path(getLocalCheckpointPath() + Path.SEPARATOR + METADATA_PREFIX+ "String_Node_Str"+ vertexID+ suffix);
    final FileSystem localFs=local.getFileSystem();
    if (localFs.exists(local)) {
      return true;
    }
    if (!allowDistributedCheckpoints()) {
      return false;
    }
    final Path distributedCheckpointPath=getDistributedCheckpointPath();
    if (distributedCheckpointPath == null) {
      return false;
    }
    final Path distributed=new Path(distributedCheckpointPath + Path.SEPARATOR + METADATA_PREFIX+ "String_Node_Str"+ vertexID+ suffix);
    final FileSystem distFs=distributed.getFileSystem();
    return distFs.exists(distributed);
  }
 catch (  IOException ioe) {
    LOG.warn(StringUtils.stringifyException(ioe));
  }
  return false;
}
Program: 87624
Project: 87624
Buggy source:
WriteThread(final FileBufferManager fileBufferManager,final ExecutionVertexID vertexID,final int numberOfConnectedChannels){
  super("String_Node_Str" + vertexID);
  this.fileBufferManager=fileBufferManager;
  this.vertexID=vertexID;
  this.numberOfConnectedChannels=numberOfConnectedChannels;
  this.queuedEnvelopes=new ArrayBlockingQueue<TransferEnvelope>(256);
  final boolean dist=CheckpointUtils.createDistributedCheckpoint();
  if (dist) {
    final Path p=CheckpointUtils.getDistributedCheckpointPath();
    if (p == null) {
      LOG.error("String_Node_Str");
      this.checkpointPath=CheckpointUtils.getLocalCheckpointPath();
      this.distributed=false;
    }
 else {
      this.checkpointPath=p;
      this.distributed=true;
    }
  }
 else {
    this.checkpointPath=CheckpointUtils.getLocalCheckpointPath();
    this.distributed=false;
  }
}

Fixed version (ground truth):
WriteThread(final FileBufferManager fileBufferManager,final ExecutionVertexID vertexID,final int numberOfConnectedChannels){
  super("String_Node_Str" + vertexID);
  this.fileBufferManager=fileBufferManager;
  this.vertexID=vertexID;
  this.numberOfConnectedChannels=numberOfConnectedChannels;
  this.queuedEnvelopes=new ArrayBlockingQueue<TransferEnvelope>(256);
  final boolean dist=CheckpointUtils.allowDistributedCheckpoints();
  if (dist) {
    final Path p=CheckpointUtils.getDistributedCheckpointPath();
    if (p == null) {
      LOG.error("String_Node_Str");
      this.checkpointPath=CheckpointUtils.getLocalCheckpointPath();
      this.distributed=false;
    }
 else {
      this.checkpointPath=p;
      this.distributed=true;
    }
  }
 else {
    this.checkpointPath=CheckpointUtils.getLocalCheckpointPath();
    this.distributed=false;
  }
}
Program: 87625
Project: 87625
Buggy source:
public static boolean deleteFile(final AbstractID ownerID){
  final FileBufferManager fbm=getInstance();
  final File f=fbm.constructLocalFile(ownerID);
  if (f.exists()) {
    System.out.println("String_Node_Str" + f);
    f.delete();
    return true;
  }
  if (fbm.distributedTempPath != null) {
    final Path p=fbm.constructDistributedPath(ownerID);
    try {
      final FileSystem fs=p.getFileSystem();
      if (fs.exists(p)) {
        fs.delete(p,false);
        return true;
      }
    }
 catch (    IOException ioe) {
      if (LOG.isDebugEnabled()) {
        LOG.debug(StringUtils.stringifyException(ioe));
      }
    }
  }
  return false;
}

Fixed version (ground truth):
public static boolean deleteFile(final AbstractID ownerID){
  final FileBufferManager fbm=getInstance();
  final File f=fbm.constructLocalFile(ownerID);
  if (f.exists()) {
    f.delete();
    return true;
  }
  if (fbm.distributedTempPath != null) {
    final Path p=fbm.constructDistributedPath(ownerID);
    try {
      final FileSystem fs=p.getFileSystem();
      if (fs.exists(p)) {
        fs.delete(p,false);
        return true;
      }
    }
 catch (    IOException ioe) {
      if (LOG.isDebugEnabled()) {
        LOG.debug(StringUtils.stringifyException(ioe));
      }
    }
  }
  return false;
}
Program: 87626
Project: 87626
Buggy source:
/** 
 * Constructs a new file buffer manager object.
 */
private FileBufferManager(){
  this.tmpDirs=GlobalConfiguration.getString(ConfigConstants.TASK_MANAGER_TMP_DIR_KEY,ConfigConstants.DEFAULT_TASK_MANAGER_TMP_PATH).split("String_Node_Str");
  for (int i=0; i < this.tmpDirs.length; i++) {
    File f=new File(this.tmpDirs[i]);
    if (!(f.exists() && f.isDirectory() && f.canWrite())) {
      LOG.error("String_Node_Str" + f.getAbsolutePath() + "String_Node_Str"+ "String_Node_Str"+ ConfigConstants.DEFAULT_TASK_MANAGER_TMP_PATH);
      this.tmpDirs[i]=ConfigConstants.DEFAULT_TASK_MANAGER_TMP_PATH;
    }
    this.tmpDirs[i]=this.tmpDirs[i] + File.separator + FILE_BUFFER_PREFIX;
  }
  this.bufferSize=GlobalConfiguration.getInteger("String_Node_Str",64 * 1024);
  this.fileMap=new ConcurrentHashMap<AbstractID,ChannelWithAccessInfo>(2048,0.8f,64);
  this.distributedTempPath=CheckpointUtils.getDistributedCheckpointPath();
  FileSystem distFS=null;
  if (this.distributedTempPath != null) {
    try {
      distFS=this.distributedTempPath.getFileSystem();
      if (!distFS.exists(this.distributedTempPath)) {
        distFS.mkdirs(this.distributedTempPath);
      }
    }
 catch (    IOException e) {
      LOG.error(StringUtils.stringifyException(e));
    }
  }
  this.distributedFileSystem=distFS;
}

Fixed version (ground truth):
/** 
 * Constructs a new file buffer manager object.
 */
private FileBufferManager(){
  this.tmpDirs=GlobalConfiguration.getString(ConfigConstants.TASK_MANAGER_TMP_DIR_KEY,ConfigConstants.DEFAULT_TASK_MANAGER_TMP_PATH).split("String_Node_Str");
  for (int i=0; i < this.tmpDirs.length; i++) {
    File f=new File(this.tmpDirs[i]);
    if (!(f.exists() && f.isDirectory() && f.canWrite())) {
      LOG.error("String_Node_Str" + f.getAbsolutePath() + "String_Node_Str"+ "String_Node_Str"+ ConfigConstants.DEFAULT_TASK_MANAGER_TMP_PATH);
      this.tmpDirs[i]=ConfigConstants.DEFAULT_TASK_MANAGER_TMP_PATH;
    }
    this.tmpDirs[i]=this.tmpDirs[i] + File.separator + FILE_BUFFER_PREFIX;
  }
  this.bufferSize=GlobalConfiguration.getInteger("String_Node_Str",64 * 1024);
  this.fileMap=new ConcurrentHashMap<AbstractID,ChannelWithAccessInfo>(2048,0.8f,64);
  this.distributedTempPath=CheckpointUtils.getDistributedCheckpointPath();
  FileSystem distFS=null;
  if (this.distributedTempPath != null && CheckpointUtils.allowDistributedCheckpoints()) {
    try {
      distFS=this.distributedTempPath.getFileSystem();
      if (!distFS.exists(this.distributedTempPath)) {
        distFS.mkdirs(this.distributedTempPath);
      }
    }
 catch (    IOException e) {
      LOG.error(StringUtils.stringifyException(e));
    }
  }
  this.distributedFileSystem=distFS;
}
Program: 87627
Project: 87627
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public Buffer requestEmptyBuffer(final int minimumSizeOfBuffer) throws IOException {
  throw new IllegalStateException("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public Buffer requestEmptyBuffer(final int minimumSizeOfBuffer) throws IOException {
  return this.inputGateContext.requestEmptyBuffer(minimumSizeOfBuffer);
}
Program: 87628
Project: 87628
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override protected boolean readBufferData(final ReadableByteChannel readableByteChannel) throws IOException {
  if (getBuffer() == null) {
    try {
      if (!getDeserializedJobID().equals(this.lastDeserializedJobID) || !getDeserializedSourceID().equals(this.lastDeserializedSourceID)) {
        this.bufferProvider=this.bufferProviderBroker.getBufferProvider(getDeserializedJobID(),getDeserializedSourceID());
        this.lastDeserializedJobID=getDeserializedJobID();
        this.lastDeserializedSourceID=getDeserializedSourceID();
      }
      setBuffer(this.bufferProvider.requestEmptyBufferBlocking(getSizeOfBuffer()));
      if (getBuffer() == null) {
        Thread.sleep(100);
        return true;
      }
    }
 catch (    InterruptedException e) {
      return true;
    }
  }
 else {
    final Buffer buffer=getBuffer();
    final int bytesWritten=buffer.write(readableByteChannel);
    if (!buffer.hasRemaining()) {
      buffer.finishWritePhase();
      return false;
    }
 else {
      if (bytesWritten == -1) {
        throw new IOException("String_Node_Str" + buffer.remaining() + "String_Node_Str");
      }
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override protected boolean readBufferData(final ReadableByteChannel readableByteChannel) throws IOException {
  if (getBuffer() == null) {
    try {
      if (!getDeserializedJobID().equals(this.lastDeserializedJobID) || !getDeserializedSourceID().equals(this.lastDeserializedSourceID)) {
        this.bufferProvider=this.bufferProviderBroker.getBufferProvider(getDeserializedJobID(),getDeserializedSourceID());
        this.lastDeserializedJobID=getDeserializedJobID();
        this.lastDeserializedSourceID=getDeserializedSourceID();
      }
      final Buffer buf=this.bufferProvider.requestEmptyBuffer(getSizeOfBuffer());
      if (buf == null) {
        Thread.sleep(1);
        return true;
      }
      setBuffer(buf);
    }
 catch (    InterruptedException e) {
      return true;
    }
  }
 else {
    final Buffer buffer=getBuffer();
    final int bytesWritten=buffer.write(readableByteChannel);
    if (!buffer.hasRemaining()) {
      buffer.finishWritePhase();
      return false;
    }
 else {
      if (bytesWritten == -1) {
        throw new IOException("String_Node_Str" + buffer.remaining() + "String_Node_Str");
      }
    }
  }
  return true;
}
Program: 87629
Project: 87629
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + this.cluster1 + "String_Node_Str"+ this.cluster2+ "String_Node_Str"+ this.distance+ "String_Node_Str";
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str" + clusters.size() + "String_Node_Str"+ distancedPairs+ "String_Node_Str";
}
Program: 87630
Project: 87630
Buggy source:
private void cluster(){
  while (this.queue.getNumberOfClusters() > 1) {
    final ClusterPair pair=this.queue.getFirstElement();
    final HierarchicalCluster cluster1=pair.getCluster1();
    final HierarchicalCluster cluster2=pair.getCluster2();
    final HierarchicalCluster mergedCluster=new MergedCluster(cluster1,cluster2,this.createNewId());
    this.queue.removeCluster(cluster1);
    this.queue.removeCluster(cluster2);
    final boolean makeFinal=this.canBeFinal(mergedCluster);
    mergedCluster.makeFinal(makeFinal);
    if (makeFinal)     this.queue.add(mergedCluster);
 else     for (    final HierarchicalCluster child : mergedCluster.getChildren())     this.clusters.add(child);
  }
  this.clusters.addAll(this.queue.getClusters());
  this.queue=null;
}

Fixed version (ground truth):
private void cluster(){
  while (this.queue.getNumberOfClusters() > 1) {
    final ClusterPair pair=this.queue.getFirstElement();
    if (pair.getDistance() > maxRadius) {
      break;
    }
    final HierarchicalCluster cluster1=pair.getCluster1();
    final HierarchicalCluster cluster2=pair.getCluster2();
    final HierarchicalCluster mergedCluster=new MergedCluster(cluster1,cluster2,this.createNewId());
    this.queue.removeCluster(cluster1);
    this.queue.removeCluster(cluster2);
    final boolean makeFinal=this.canBeFinal(mergedCluster);
    mergedCluster.makeFinal(makeFinal);
    if (makeFinal)     this.queue.add(mergedCluster);
 else     for (    final HierarchicalCluster child : mergedCluster.getChildren())     this.clusters.add(child);
  }
  this.clusters.addAll(this.queue.getClusters());
  this.queue=null;
}
Program: 87631
Project: 87631
Buggy source:
private void emit(final HierarchicalCluster cluster,final JsonCollector out){
  if (cluster.isFinal()) {
    this.pointsNode.clear();
    for (    final Point point : cluster.getPoints())     this.pointsNode.add(point.write((IJsonNode)null));
    this.idNode.setValue(cluster.getId());
    JsonUtil2.copy(this.pointsNode,cluster.getPoints());
    ClusterNodes.write(this.outputNode,this.idNode,this.clustroidNode,this.pointsNode);
    out.collect(this.outputNode);
  }
 else   for (  final HierarchicalCluster child : cluster.getChildren())   this.emit(child,out);
}

Fixed version (ground truth):
private void emit(final HierarchicalCluster cluster,final JsonCollector out){
  if (cluster.isFinal()) {
    this.pointsNode.clear();
    for (    final Point point : cluster.getPoints())     this.pointsNode.add(point.write((IJsonNode)null));
    this.idNode.setValue(cluster.getId());
    cluster.getClustroid().write(this.clustroidNode);
    ClusterNodes.write(this.outputNode,this.idNode,this.clustroidNode,this.pointsNode);
    out.collect(this.outputNode);
  }
 else   for (  final HierarchicalCluster child : cluster.getChildren())   this.emit(child,out);
}
Program: 87632
Project: 87632
Buggy source:
public static void annotate(final ObjectNode node,final IntNode annotation,final IJsonNode annotatee){
  node.put(ANNOTATION,annotation);
  node.put(ANNOTATEE,annotatee);
}

Fixed version (ground truth):
public static void annotate(final ObjectNode node,String annotationKey,final IntNode annotation,String annotateeKey,final IJsonNode annotatee){
  node.put(annotationKey,annotation);
  node.put(annotateeKey,annotatee);
}
Program: 87633
Project: 87633
Buggy source:
public static void copy(final IArrayNode array,final JsonSerializable... values){
  array.clear();
  for (  final JsonSerializable value : values)   array.add(value.write(null));
}

Fixed version (ground truth):
public static void copy(final IArrayNode array,final Iterable<JsonSerializable> values){
  array.clear();
  for (  final JsonSerializable value : values)   array.add(value.write(null));
}
Program: 87634
Project: 87634
Buggy source:
@Test public void testSequentialClustering(){
  final SequentialClustering clustering=new SequentialClustering();
  clustering.setMaxRadius(501);
  clustering.setMaxSize(50);
  final SopremoTestPlan plan=new SopremoTestPlan(clustering);
  final Point p1=new Point("String_Node_Str",Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str"));
  final Point p2=new Point("String_Node_Str",Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"));
  final Point p3=new Point("String_Node_Str",Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str"));
  final Point p4=new Point("String_Node_Str",Arrays.asList("String_Node_Str","String_Node_Str","String_Node_Str"));
  plan.getInput(0).add(this.createAnnotatedPoint(p1)).add(this.createAnnotatedPoint(p2)).add(this.createAnnotatedPoint(p3)).add(this.createAnnotatedPoint(p4));
  plan.run();
  int count=0;
  for (  final IJsonNode node : plan.getActualOutput(0)) {
    System.out.println(node);
    final ObjectNode cluster=(ObjectNode)node;
    Assert.assertEquals(2,((IArrayNode)cluster.get("String_Node_Str")).size());
    count++;
  }
  Assert.assertEquals(2,count);
}

Fixed version (ground truth):
@Test public void testSequentialClustering() throws IOException {
  final SequentialClustering clustering=new SequentialClustering();
  clustering.setMaxRadius(200);
  clustering.setMaxSize(200);
  final SopremoTestPlan plan=new SopremoTestPlan(clustering);
  String testPointsJsonString="String_Node_Str";
  JsonParser parser=new JsonParser(testPointsJsonString);
  while (!parser.checkEnd()) {
    plan.getInput(0).add(createAnnotatedPoint(parser.readValueAsTree()));
  }
  plan.run();
  int count=0;
  for (  final IJsonNode node : plan.getActualOutput(0)) {
    final ObjectNode cluster=(ObjectNode)node;
    System.out.println(cluster);
    count++;
  }
}
Program: 87635
Project: 87635
Buggy source:
private IJsonNode createAnnotatedPoint(final Point point){
  final ObjectNode annotatedValue=new ObjectNode();
  AnnotatorNodes.annotate(annotatedValue,Annotator.ANNOTATION_VALUE,point.write(null));
  return annotatedValue;
}

Fixed version (ground truth):
private IJsonNode createAnnotatedPoint(final IJsonNode pointNode){
  final ObjectNode annotatedValue=new ObjectNode();
  AnnotatorNodes.annotate(annotatedValue,Annotator.ANNOTATION_VALUE,pointNode);
  return annotatedValue;
}
Program: 87636
Project: 87636
Buggy source:
@SuppressWarnings("String_Node_Str") public List<? extends EvaluationExpression> getKeyExpressions(int inputIndex){
  if (inputIndex >= this.keyExpressions.size())   return Collections.EMPTY_LIST;
  final List<? extends EvaluationExpression> expressions=this.keyExpressions.get(inputIndex);
  if (expressions == null)   return Collections.EMPTY_LIST;
  return expressions;
}

Fixed version (ground truth):
/** 
 * Returns the key expressions of the given input.
 * @param inputIndex the index of the input
 * @return the key expressions of the given input
 */
@SuppressWarnings("String_Node_Str") public List<? extends EvaluationExpression> getKeyExpressions(int inputIndex){
  if (inputIndex >= this.keyExpressions.size())   return Collections.EMPTY_LIST;
  final List<? extends EvaluationExpression> expressions=this.keyExpressions.get(inputIndex);
  if (expressions == null)   return Collections.EMPTY_LIST;
  return expressions;
}
Program: 87637
Project: 87637
Buggy source:
/** 
 * Callback to add parameters to the stub configuration.<br> The default implementation adds the context and all non-transient, non-final, non-static fields.
 * @param contract the contract to configure
 * @param stubConfiguration the configuration of the stub
 * @param context the context in which the  {@link PactModule} is created and evaluated
 */
protected void configureContract(final Contract contract,final Configuration stubConfiguration,final EvaluationContext context){
  context.pushOperator(this);
  SopremoUtil.serialize(stubConfiguration,SopremoUtil.CONTEXT,context);
  context.popOperator();
  for (  final Field stubField : contract.getUserCodeClass().getDeclaredFields())   if ((stubField.getModifiers() & (Modifier.TRANSIENT | Modifier.FINAL | Modifier.STATIC)) == 0) {
    Field thisField;
    try {
      thisField=this.getClass().getDeclaredField(stubField.getName());
      thisField.setAccessible(true);
      SopremoUtil.serialize(stubConfiguration,stubField.getName(),(Serializable)thisField.get(this));
    }
 catch (    final NoSuchFieldException e) {
    }
catch (    final Exception e) {
      LOG.error(String.format("String_Node_Str",stubField.getName(),contract.getClass(),e));
    }
  }
}

Fixed version (ground truth):
/** 
 * Callback to add parameters to the stub configuration.<br> The default implementation adds the context and all non-transient, non-final, non-static fields.
 * @param contract the contract to configure
 * @param stubConfiguration the configuration of the stub
 * @param context the context in which the  {@link PactModule} is created and evaluated
 */
protected void configureContract(final Contract contract,final Configuration stubConfiguration,final EvaluationContext context){
  context.pushOperator(this);
  SopremoUtil.serialize(stubConfiguration,SopremoUtil.CONTEXT,context);
  context.popOperator();
  for (  final Field stubField : contract.getUserCodeClass().getDeclaredFields())   if ((stubField.getModifiers() & (Modifier.TRANSIENT | Modifier.FINAL | Modifier.STATIC)) == 0) {
    Class<?> clazz=this.getClass();
    do {
      Field thisField;
      try {
        thisField=clazz.getDeclaredField(stubField.getName());
        thisField.setAccessible(true);
        SopremoUtil.serialize(stubConfiguration,stubField.getName(),(Serializable)thisField.get(this));
      }
 catch (      final NoSuchFieldException e) {
      }
catch (      final Exception e) {
        LOG.error(String.format("String_Node_Str",stubField.getName(),contract.getClass(),e));
      }
    }
 while ((clazz=clazz.getSuperclass()) != ElementaryOperator.class);
  }
}
Program: 87638
Project: 87638
Buggy source:
/** 
 * Sets the keyExpressions to the specified value.
 * @param keyExpressions the keyExpressions to set
 */
public void setKeyExpressions(int index,EvaluationExpression... keyExpressions){
  if (keyExpressions.length == 0)   throw new IllegalArgumentException("String_Node_Str");
  setKeyExpressions(index,Arrays.asList(keyExpressions));
}

Fixed version (ground truth):
/** 
 * Sets the keyExpressions of the given input to the specified value.
 * @param keyExpressions the keyExpressions to set
 */
public void setKeyExpressions(int index,EvaluationExpression... keyExpressions){
  if (keyExpressions.length == 0)   throw new IllegalArgumentException("String_Node_Str");
  setKeyExpressions(index,Arrays.asList(keyExpressions));
}
Program: 87639
Project: 87639
Buggy source:
ReplayTaskContext(final ReplayTask task,final TransferEnvelopeDispatcher transferEnvelopeDispatcher,final LocalBufferPoolOwner previousBufferPoolOwner,final int numberOfChannels){
  this.task=task;
  this.transferEnvelopeDispatcher=transferEnvelopeDispatcher;
  if (previousBufferPoolOwner == null) {
    this.localBufferPool=new LocalBufferPool(1,false,this);
  }
 else {
    if (!(previousBufferPoolOwner instanceof RuntimeTaskContext)) {
      throw new IllegalStateException("String_Node_Str");
    }
    final RuntimeTaskContext rtc=(RuntimeTaskContext)previousBufferPoolOwner;
    this.localBufferPool=rtc.getLocalBufferPool();
  }
  this.numberOfChannels=numberOfChannels;
}

Fixed version (ground truth):
ReplayTaskContext(final ReplayTask task,final TransferEnvelopeDispatcher transferEnvelopeDispatcher,final LocalBufferPoolOwner previousBufferPoolOwner,final int numberOfChannels){
  this.task=task;
  this.transferEnvelopeDispatcher=transferEnvelopeDispatcher;
  this.previousBufferPoolOwner=previousBufferPoolOwner;
  if (previousBufferPoolOwner == null) {
    this.localBufferPool=new LocalBufferPool(1,false,this);
  }
 else {
    if (!(previousBufferPoolOwner instanceof RuntimeTaskContext)) {
      throw new IllegalStateException("String_Node_Str");
    }
    final RuntimeTaskContext rtc=(RuntimeTaskContext)previousBufferPoolOwner;
    this.localBufferPool=rtc.getLocalBufferPool();
  }
  this.numberOfChannels=numberOfChannels;
}
Program: 87640
Project: 87640
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void clearLocalBufferPool(){
  this.localBufferPool.destroy();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void clearLocalBufferPool(){
  if (this.previousBufferPoolOwner != null) {
    this.previousBufferPoolOwner.clearLocalBufferPool();
  }
 else {
    this.localBufferPool.destroy();
  }
}
Program: 87641
Project: 87641
Buggy source:
@Override public void requestInstance(JobID jobID,Configuration conf,Map<InstanceType,Integer> instanceMap,List<String> splitAffinityList) throws InstanceException {
  this.instanceListener.resourceAllocated(jobID,this.allocatedResource);
}

Fixed version (ground truth):
@Override public void requestInstance(final JobID jobID,Configuration conf,Map<InstanceType,Integer> instanceMap,List<String> splitAffinityList) throws InstanceException {
  ConcurrentUtil.invokeLater(new Runnable(){
    @Override public void run(){
      MockInstanceManager.this.instanceListener.resourceAllocated(jobID,getAllocatedResource());
    }
  }
);
}
Program: 87642
Project: 87642
Buggy source:
private void assignMemory(final TaskConfig config,final int memSize){
  config.setMemorySize(((long)memSize) * 1024L * 1024L);
  config.setNumFilehandles(DEFAUTL_MERGE_FACTOR);
}

Fixed version (ground truth):
private void assignMemory(final TaskConfig config,final int memSize){
  config.setMemorySize(memSize * 1024L * 1024L);
  config.setNumFilehandles(DEFAUTL_MERGE_FACTOR);
}