nus-yam/ex-repair huggingface dataset:
Program: 55403
Project: 55403
Buggy source:
/** 
 * Reads all stub annotations
 */
private void readStubAnnotations(){
  this.readConstantAnnotation();
  this.readUniqueFieldsAnnotation();
}

Fixed version (ground truth):
/** 
 * Reads all stub annotations
 */
private void readStubAnnotations(){
  this.readConstantAnnotation();
  this.readOutputCardBoundAnnotation();
  this.readUniqueFieldsAnnotation();
}
Program: 55404
Project: 55404
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: 55406
Project: 55406
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: 55407
Project: 55407
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: 55408
Project: 55408
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: 55409
Project: 55409
Buggy source:
@Override protected void map(final IJsonNode value,final JsonCollector out){
  System.out.println("String_Node_Str" + value);
  AnnotatorNodes.annotate(this.output,ANNOTATION_VALUE,value);
  System.out.println(this.output);
  out.collect(this.output);
}

Fixed version (ground truth):
@Override protected void map(final IJsonNode value,final JsonCollector out){
  AnnotatorNodes.annotate(this.output,ANNOTATION_VALUE,value);
  out.collect(this.output);
}
Program: 55410
Project: 55410
Buggy source:
@Override public void read(final IJsonNode node){
  if (node == null || !(node instanceof ObjectNode))   throw new IllegalArgumentException("String_Node_Str" + node);
  final ObjectNode objectNode=(ObjectNode)node;
  System.out.println("String_Node_Str" + node);
  this.key=PointNodes.getId(objectNode).getJavaValue();
  this.values=new ArrayList<String>();
  for (  final IJsonNode valuesNode : PointNodes.getValues(objectNode))   this.values.add(((TextNode)valuesNode).getTextValue());
  this.rowsum=PointNodes.getRowsum(objectNode).getIntValue();
}

Fixed version (ground truth):
@Override public void read(final IJsonNode node){
  if (node == null || !(node instanceof ObjectNode))   throw new IllegalArgumentException("String_Node_Str" + node);
  final ObjectNode objectNode=(ObjectNode)node;
  this.key=PointNodes.getId(objectNode).getJavaValue();
  this.values=new ArrayList<String>();
  for (  final IJsonNode valuesNode : PointNodes.getValues(objectNode))   this.values.add(((TextNode)valuesNode).getTextValue());
  this.rowsum=PointNodes.getRowsum(objectNode).getIntValue();
}
Program: 55411
Project: 55411
Buggy source:
@Override protected void reduce(final IArrayNode values,final JsonCollector out){
  System.out.println("String_Node_Str" + values);
  this.addPoints(values);
  this.cluster();
  this.emitClusters(out);
}

Fixed version (ground truth):
@Override protected void reduce(final IArrayNode values,final JsonCollector out){
  this.addPoints(values);
  this.cluster();
  this.emitClusters(out);
}
Program: 55412
Project: 55412
Buggy source:
public static IArrayNode getPoints(final ObjectNode clusterNode){
  return (IArrayNode)clusterNode.get(POINTS);
}

Fixed version (ground truth):
public static IArrayNode getPoints(final ObjectNode clusterNode){
  try {
    return (IArrayNode)clusterNode.get(POINTS);
  }
 catch (  ClassCastException e) {
    System.err.println(clusterNode);
    throw e;
  }
}
Program: 55413
Project: 55413
Buggy source:
@Override protected void map(final IJsonNode node,final JsonCollector out){
  System.out.println("String_Node_Str" + node);
  final ObjectNode clusterNode=(ObjectNode)node;
  final TextNode idNode=ClusterNodes.getId(clusterNode);
  final IArrayNode pointsNode=ClusterNodes.getPoints(clusterNode);
  for (  final IJsonNode pointNode : pointsNode) {
    this.outputNode.putAll((IObjectNode)pointNode);
    PointNodes.assignCluster(this.outputNode,idNode);
    out.collect(this.outputNode);
  }
}

Fixed version (ground truth):
@Override protected void map(final IJsonNode node,final JsonCollector out){
  final ObjectNode clusterNode=(ObjectNode)node;
  final TextNode idNode=ClusterNodes.getId(clusterNode);
  final IArrayNode pointsNode=ClusterNodes.getPoints(clusterNode);
  for (  final IJsonNode pointNode : pointsNode) {
    this.outputNode.putAll((IObjectNode)pointNode);
    PointNodes.assignCluster(this.outputNode,idNode);
    out.collect(this.outputNode);
  }
}
Program: 55414
Project: 55414
Buggy source:
@Override public ElementarySopremoModule asElementaryOperators(){
  final ElementarySopremoModule module=new ElementarySopremoModule(this.getName(),4,2);
  final Source initialClustersInput=module.getInput(0);
  final Source restPointsInput=module.getInput(1);
  final Source treeInput=module.getInput(2);
  final Source representationInput=module.getInput(3);
  final ClusterDisassemble disassemble=new ClusterDisassemble().withInputs(initialClustersInput);
  final PointMapper pointMapper=new PointMapper();
  pointMapper.setInput(PointMapper.POINT_INPUT_INDEX,restPointsInput);
  pointMapper.setInput(PointMapper.TREE_INPUT_INDEX,treeInput);
  final UnionAll pointUnionAll=new UnionAll().withInputs(disassemble,pointMapper);
  final RepresentationUpdate representationUpdate=new RepresentationUpdate().withInputs(representationInput,pointUnionAll);
  representationUpdate.setMaxClusterRadius(this.maxClusterRadius);
  representationUpdate.setMinPointCount(this.minPointCount);
  representationUpdate.setMaxClustroidShift(this.maxClustroidShift);
  representationUpdate.setRepresentationDetail(this.representationDetail);
  module.getOutput(0).setInputs(pointUnionAll);
  module.getOutput(1).setInputs(representationUpdate);
  return module;
}

Fixed version (ground truth):
@Override public ElementarySopremoModule asElementaryOperators(){
  final ElementarySopremoModule module=new ElementarySopremoModule(this.getName(),4,2);
  final Source initialClustersInput=module.getInput(0);
  final Source restPointsInput=module.getInput(1);
  final Source treeInput=module.getInput(2);
  final Source representationInput=module.getInput(3);
  final ClusterDisassemble disassemble=new ClusterDisassemble().withInputs(initialClustersInput);
  final PointMapper pointMapper=new PointMapper().withInputs(restPointsInput,treeInput);
  final UnionAll pointUnionAll=new UnionAll().withInputs(disassemble,pointMapper);
  final RepresentationUpdate representationUpdate=new RepresentationUpdate().withInputs(representationInput,pointUnionAll);
  representationUpdate.setMaxClusterRadius(this.maxClusterRadius);
  representationUpdate.setMinPointCount(this.minPointCount);
  representationUpdate.setMaxClustroidShift(this.maxClustroidShift);
  representationUpdate.setRepresentationDetail(this.representationDetail);
  module.getOutput(0).setInputs(pointUnionAll);
  module.getOutput(1).setInputs(representationUpdate);
  return module;
}
Program: 55415
Project: 55415
Buggy source:
@Override protected void cross(final IJsonNode pointNode,final IJsonNode treeNode,final JsonCollector out){
  System.out.println("String_Node_Str" + treeNode);
  System.out.println("String_Node_Str" + pointNode);
  final ClusterTree tree=new ClusterTree();
  tree.read(treeNode);
  final Point point=new Point();
  point.read(pointNode);
  final String clusterId=tree.findIdOfClusterNextTo(point);
  this.clusterIdNode.setValue(clusterId);
  PointNodes.assignCluster((ObjectNode)pointNode,this.clusterIdNode);
  System.out.println(pointNode);
  out.collect(pointNode);
}

Fixed version (ground truth):
@Override protected void cross(final IJsonNode pointNode,final IJsonNode treeNode,final JsonCollector out){
  final ClusterTree tree=new ClusterTree();
  tree.read(treeNode);
  final Point point=new Point();
  point.read(pointNode);
  final String clusterId=tree.findIdOfClusterNextTo(point);
  this.clusterIdNode.setValue(clusterId);
  PointNodes.assignCluster((ObjectNode)pointNode,this.clusterIdNode);
  out.collect(pointNode);
}
Program: 55416
Project: 55416
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: 55417
Project: 55417
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: 55418
Project: 55418
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: 55419
Project: 55419
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: 55420
Project: 55420
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: 55421
Project: 55421
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: 55422
Project: 55422
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: 55423
Project: 55423
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: 55424
Project: 55424
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: 55425
Project: 55425
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: 55426
Project: 55426
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: 55427
Project: 55427
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: 55428
Project: 55428
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: 55429
Project: 55429
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: 55430
Project: 55430
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: 55431
Project: 55431
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: 55432
Project: 55432
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: 55434
Project: 55434
Buggy source:
public void logBufferUtilization(){
  System.out.println("String_Node_Str");
  final Iterator<Map.Entry<InetSocketAddress,OutgoingConnection>> it=this.outgoingConnections.entrySet().iterator();
  while (it.hasNext()) {
    final Map.Entry<InetSocketAddress,OutgoingConnection> entry=it.next();
    System.out.println("String_Node_Str" + entry.getKey() + "String_Node_Str"+ entry.getValue().getNumberOfQueuedWriteBuffers());
  }
}

Fixed version (ground truth):
public void logBufferUtilization(){
  System.out.println("String_Node_Str");
  final Iterator<Map.Entry<RemoteReceiver,OutgoingConnection>> it=this.outgoingConnections.entrySet().iterator();
  while (it.hasNext()) {
    final Map.Entry<RemoteReceiver,OutgoingConnection> entry=it.next();
    System.out.println("String_Node_Str" + entry.getKey() + "String_Node_Str"+ entry.getValue().getNumberOfQueuedWriteBuffers());
  }
}
Program: 55435
Project: 55435
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: 55436
Project: 55436
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: 55437
Project: 55437
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: 55439
Project: 55439
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: 55440
Project: 55440
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: 55441
Project: 55441
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: 55442
Project: 55442
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: 55443
Project: 55443
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: 55444
Project: 55444
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: 55445
Project: 55445
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);
}
Program: 55446
Project: 55446
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void write(final DataOutput out) throws IOException {
  final InetAddress ia=this.connectionAddress.getAddress();
  out.writeInt(ia.getAddress().length);
  out.write(ia.getAddress());
  out.write(this.connectionAddress.getPort());
  out.writeInt(this.connectionIndex);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void write(final DataOutput out) throws IOException {
  final InetAddress ia=this.connectionAddress.getAddress();
  out.writeInt(ia.getAddress().length);
  out.write(ia.getAddress());
  out.writeInt(this.connectionAddress.getPort());
  out.writeInt(this.connectionIndex);
}
Program: 55447
Project: 55447
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: 55448
Project: 55448
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: 55449
Project: 55449
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";
}