nus-yam/ex-repair huggingface dataset:
Program: 55450
Project: 55450
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: 55451
Project: 55451
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: 55452
Project: 55452
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: 55453
Project: 55453
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: 55454
Project: 55454
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: 55455
Project: 55455
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: 55456
Project: 55456
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: 55457
Project: 55457
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: 55459
Project: 55459
Buggy source:
@Override public IArrayNode add(int index,IJsonNode element){
  if (element == null) {
    throw new NullPointerException();
  }
  if (element.isMissing()) {
    this.remove(index);
  }
  if (index < 0 || index > this.size()) {
    throw new IndexOutOfBoundsException();
  }
  if (index < this.schema.getTailSize()) {
    for (int i=this.schema.getTailSize() - 1; i >= index; i--) {
      if (!this.record.isNull(i)) {
        if (i == this.schema.getTailSize() - 1) {
          this.getOtherField().add(0,SopremoUtil.unwrap(this.record.getField(i,JsonNodeWrapper.class)));
        }
 else {
          this.record.setField(i + 1,this.record.getField(i,JsonNodeWrapper.class));
        }
      }
    }
    this.record.setField(index,SopremoUtil.wrap(element));
  }
  return this;
}

Fixed version (ground truth):
@Override public IArrayNode add(int index,IJsonNode element){
  if (element == null) {
    throw new NullPointerException();
  }
  if (element.isMissing()) {
    this.remove(index);
  }
  if (index < 0 || index > this.size()) {
    throw new IndexOutOfBoundsException();
  }
  int recordPosition=this.schema.getTailSize() - size() + index;
  if (recordPosition < 0) {
    this.getOtherField().add(index,element);
  }
 else {
    IJsonNode oldNode=SopremoUtil.unwrap(this.record.getField(recordPosition + 1,JsonNodeWrapper.class));
    IJsonNode tmpNode;
    this.record.setField(recordPosition + 1,SopremoUtil.wrap(element));
    for (int i=recordPosition + 1; i > 0; i--) {
      if (this.record.isNull(i)) {
        this.record.setField(i,SopremoUtil.wrap(oldNode));
        return this;
      }
 else {
        tmpNode=SopremoUtil.unwrap(this.record.getField(i,JsonNodeWrapper.class));
        if (oldNode != null) {
          this.record.setField(i,SopremoUtil.wrap(oldNode));
        }
        oldNode=tmpNode;
      }
    }
    if (oldNode != null) {
      this.getOtherField().add(oldNode);
    }
  }
  return this;
}
Program: 55460
Project: 55460
Buggy source:
@Override public IJsonNode set(int index,IJsonNode node){
  if (node == null) {
    throw new NullPointerException();
  }
  if (node.isMissing()) {
    return this.remove(index);
  }
  if (index < 0 || index >= this.size()) {
    if (index == this.size()) {
      this.add(node);
      return MissingNode.getInstance();
    }
 else {
      throw new IndexOutOfBoundsException();
    }
  }
  int pactRecordPosition=this.schema.getTailSize() - size() + index;
  if (pactRecordPosition < 0) {
    return this.getOtherField().set(index,node);
  }
 else {
    IJsonNode oldNode=SopremoUtil.unwrap(this.record.getField(pactRecordPosition + 1,JsonNodeWrapper.class));
    this.record.setField(pactRecordPosition + 1,node);
    return oldNode;
  }
}

Fixed version (ground truth):
@Override public IJsonNode set(int index,IJsonNode node){
  if (node == null) {
    throw new NullPointerException();
  }
  if (node.isMissing()) {
    return this.remove(index);
  }
  if (index < 0 || index >= this.size()) {
    if (index == this.size()) {
      this.add(node);
      return MissingNode.getInstance();
    }
 else {
      throw new IndexOutOfBoundsException();
    }
  }
  int recordPosition=this.schema.getTailSize() - size() + index;
  if (recordPosition < 0) {
    return this.getOtherField().set(index,node);
  }
 else {
    IJsonNode oldNode=SopremoUtil.unwrap(this.record.getField(recordPosition + 1,JsonNodeWrapper.class));
    this.record.setField(recordPosition + 1,node);
    return oldNode;
  }
}
Program: 55461
Project: 55461
Buggy source:
@Override public IJsonNode get(int index){
  int size=this.size();
  if (index < 0 || index >= size) {
    return MissingNode.getInstance();
  }
  if (size <= this.schema.getTailSize()) {
    return SopremoUtil.unwrap(this.record.getField(this.schema.getTailSize() - size + index + 1,JsonNodeWrapper.class));
  }
 else {
    return this.getOtherField().get(index);
  }
}

Fixed version (ground truth):
@Override public IJsonNode get(int index){
  int size=this.size();
  if (index < 0 || index >= size) {
    return MissingNode.getInstance();
  }
  int recordPosition=this.schema.getTailSize() - size + index;
  if (recordPosition >= 0) {
    return SopremoUtil.unwrap(this.record.getField(recordPosition + 1,JsonNodeWrapper.class));
  }
 else {
    return this.getOtherField().get(index);
  }
}
Program: 55462
Project: 55462
Buggy source:
@Override public void initArrayNode(){
  TailArraySchema schema=new TailArraySchema();
  schema.setTailSize(5);
  PactRecord record=schema.jsonToRecord(new ArrayNode(IntNode.valueOf(0),IntNode.valueOf(1),IntNode.valueOf(2)),null,null);
  this.node=new LazyTailArrayNode(record,schema);
}

Fixed version (ground truth):
@Override public void initArrayNode(){
}
Program: 55463
Project: 55463
Buggy source:
@Test public void shouldReturnTheCorrectNode(){
  this.node.add(0,TextNode.valueOf("String_Node_Str"));
  Assert.assertEquals(TextNode.valueOf("String_Node_Str"),this.node.get(0));
}

Fixed version (ground truth):
@Test public void shouldReturnTheCorrectNode(){
  this.node.add(0,TextNode.valueOf("String_Node_Str"));
  this.node.add(0,TextNode.valueOf("String_Node_Str"));
  Assert.assertEquals(TextNode.valueOf("String_Node_Str"),this.node.get(0));
  Assert.assertEquals(TextNode.valueOf("String_Node_Str"),this.node.get(1));
}
Program: 55466
Project: 55466
Buggy source:
@Override public JsonNode evaluate(final JsonNode node,final EvaluationContext context){
  return LongNode.valueOf((((LongNode)((ArrayNode)node).get(0)).getLongValue() << 48) + ((LongNode)((ArrayNode)node).get(1)).getLongValue());
}

Fixed version (ground truth):
@Override public IJsonNode evaluate(IJsonNode node,IJsonNode target,EvaluationContext context){
  return LongNode.valueOf((((LongNode)((ArrayNode)node).get(0)).getLongValue() << 48) + ((LongNode)((ArrayNode)node).get(1)).getLongValue());
}
Program: 55467
Project: 55467
Buggy source:
@Override public IJsonNode evaluate(IJsonNode node,EvaluationContext context){
  throw new EvaluationException("String_Node_Str");
}

Fixed version (ground truth):
@Override public IJsonNode evaluate(IJsonNode node,IJsonNode target,EvaluationContext context){
  throw new EvaluationException("String_Node_Str");
}
Program: 55468
Project: 55468
Buggy source:
public void collect(final IJsonNode value){
  if (SopremoUtil.LOG.isTraceEnabled())   SopremoUtil.LOG.trace(String.format("String_Node_Str",value));
  this.collector.collect(this.record=this.schema.jsonToRecord(value,null,this.record));
}

Fixed version (ground truth):
public void collect(final IJsonNode value){
  if (SopremoUtil.LOG.isTraceEnabled())   SopremoUtil.LOG.trace(String.format("String_Node_Str",value));
  this.collector.collect(this.record=this.schema.jsonToRecord(value,this.record,this.context));
}
Program: 55469
Project: 55469
Buggy source:
@Override public void coGroup(final Iterator<PactRecord> records1,final Iterator<PactRecord> records2,final Collector out){
  this.context.increaseInputCounter();
  this.collector.setCollector(out);
  this.cachedIterator1.setIterator(records1);
  this.cachedIterator2.setIterator(records2);
  Iterator<IJsonNode> values1=this.cachedIterator1;
  Iterator<IJsonNode> values2=this.cachedIterator2;
  if (SopremoUtil.LOG.isTraceEnabled()) {
    final ArrayList<IJsonNode> cached1=new ArrayList<IJsonNode>(), cached2=new ArrayList<IJsonNode>();
    while (values1.hasNext())     cached1.add(values1.next());
    while (values2.hasNext())     cached2.add(values2.next());
    SopremoUtil.LOG.trace(String.format("String_Node_Str",this.getContext().operatorTrace(),cached1,cached2));
    values1=cached1.iterator();
    values2=cached2.iterator();
  }
  final ArrayNode array1=JsonUtil.wrapWithNode(this.needsResettableIterator(0,values1),values1);
  final ArrayNode array2=JsonUtil.wrapWithNode(this.needsResettableIterator(0,values2),values2);
  try {
    this.coGroup(array1,array2,this.collector);
  }
 catch (  final RuntimeException e) {
    SopremoUtil.LOG.error(String.format("String_Node_Str",this.getContext().operatorTrace(),array1,array2,e));
    throw e;
  }
}

Fixed version (ground truth):
@Override public void coGroup(final Iterator<PactRecord> records1,final Iterator<PactRecord> records2,final Collector out){
  this.context.increaseInputCounter();
  this.collector.configure(out,this.context);
  this.cachedIterator1.setIterator(records1);
  this.cachedIterator2.setIterator(records2);
  Iterator<IJsonNode> values1=this.cachedIterator1;
  Iterator<IJsonNode> values2=this.cachedIterator2;
  if (SopremoUtil.LOG.isTraceEnabled()) {
    final ArrayList<IJsonNode> cached1=new ArrayList<IJsonNode>(), cached2=new ArrayList<IJsonNode>();
    while (values1.hasNext())     cached1.add(values1.next());
    while (values2.hasNext())     cached2.add(values2.next());
    SopremoUtil.LOG.trace(String.format("String_Node_Str",this.getContext().operatorTrace(),cached1,cached2));
    values1=cached1.iterator();
    values2=cached2.iterator();
  }
  final ArrayNode array1=JsonUtil.wrapWithNode(this.needsResettableIterator(0,values1),values1);
  final ArrayNode array2=JsonUtil.wrapWithNode(this.needsResettableIterator(0,values2),values2);
  try {
    this.coGroup(array1,array2,this.collector);
  }
 catch (  final RuntimeException e) {
    SopremoUtil.LOG.error(String.format("String_Node_Str",this.getContext().operatorTrace(),array1,array2,e));
    throw e;
  }
}
Program: 55470
Project: 55470
Buggy source:
@Override public void cross(final PactRecord record1,final PactRecord record2,final Collector out){
  this.context.increaseInputCounter();
  this.collector.setCollector(out);
  final IJsonNode input1=this.inputSchema1.recordToJson(record1,this.cachedInput1);
  final IJsonNode input2=this.inputSchema2.recordToJson(record2,this.cachedInput2);
  if (SopremoUtil.LOG.isTraceEnabled())   SopremoUtil.LOG.trace(String.format("String_Node_Str",this.getContext().operatorTrace(),input1,input2));
  try {
    this.cross(input1,input2,this.collector);
  }
 catch (  final RuntimeException e) {
    SopremoUtil.LOG.error(String.format("String_Node_Str",this.getContext().operatorTrace(),input1,input2,e));
    throw e;
  }
}

Fixed version (ground truth):
@Override public void cross(final PactRecord record1,final PactRecord record2,final Collector out){
  this.context.increaseInputCounter();
  this.collector.configure(out,this.context);
  final IJsonNode input1=this.inputSchema1.recordToJson(record1,this.cachedInput1);
  final IJsonNode input2=this.inputSchema2.recordToJson(record2,this.cachedInput2);
  if (SopremoUtil.LOG.isTraceEnabled())   SopremoUtil.LOG.trace(String.format("String_Node_Str",this.getContext().operatorTrace(),input1,input2));
  try {
    this.cross(input1,input2,this.collector);
  }
 catch (  final RuntimeException e) {
    SopremoUtil.LOG.error(String.format("String_Node_Str",this.getContext().operatorTrace(),input1,input2,e));
    throw e;
  }
}
Program: 55471
Project: 55471
Buggy source:
@Override public void map(final PactRecord record,final Collector out) throws Exception {
  this.context.increaseInputCounter();
  this.collector.setCollector(out);
  final IJsonNode input=this.inputSchema.recordToJson(record,this.cachedInput);
  if (SopremoUtil.LOG.isTraceEnabled())   SopremoUtil.LOG.trace(String.format("String_Node_Str",this.getContext().operatorTrace(),input));
  try {
    this.map(input,this.collector);
  }
 catch (  final RuntimeException e) {
    SopremoUtil.LOG.error(String.format("String_Node_Str",this.getContext().operatorTrace(),this.cachedInput,e));
    throw e;
  }
}

Fixed version (ground truth):
@Override public void map(final PactRecord record,final Collector out) throws Exception {
  this.context.increaseInputCounter();
  this.collector.configure(out,this.context);
  final IJsonNode input=this.inputSchema.recordToJson(record,this.cachedInput);
  if (SopremoUtil.LOG.isTraceEnabled())   SopremoUtil.LOG.trace(String.format("String_Node_Str",this.getContext().operatorTrace(),input));
  try {
    this.map(input,this.collector);
  }
 catch (  final RuntimeException e) {
    SopremoUtil.LOG.error(String.format("String_Node_Str",this.getContext().operatorTrace(),this.cachedInput,e));
    throw e;
  }
}
Program: 55472
Project: 55472
Buggy source:
@Override public void match(final PactRecord record1,final PactRecord record2,final Collector out) throws Exception {
  this.context.increaseInputCounter();
  this.collector.setCollector(out);
  final IJsonNode input1=this.inputSchema1.recordToJson(record1,this.cachedInput1);
  final IJsonNode input2=this.inputSchema2.recordToJson(record2,this.cachedInput2);
  if (SopremoUtil.LOG.isTraceEnabled())   SopremoUtil.LOG.trace(String.format("String_Node_Str",this.getContext().operatorTrace(),input1,input2));
  try {
    this.match(input1,input2,this.collector);
  }
 catch (  final RuntimeException e) {
    SopremoUtil.LOG.error(String.format("String_Node_Str",this.getContext().operatorTrace(),input1,input2,e));
    throw e;
  }
}

Fixed version (ground truth):
@Override public void match(final PactRecord record1,final PactRecord record2,final Collector out) throws Exception {
  this.context.increaseInputCounter();
  this.collector.configure(out,this.context);
  final IJsonNode input1=this.inputSchema1.recordToJson(record1,this.cachedInput1);
  final IJsonNode input2=this.inputSchema2.recordToJson(record2,this.cachedInput2);
  if (SopremoUtil.LOG.isTraceEnabled())   SopremoUtil.LOG.trace(String.format("String_Node_Str",this.getContext().operatorTrace(),input1,input2));
  try {
    this.match(input1,input2,this.collector);
  }
 catch (  final RuntimeException e) {
    SopremoUtil.LOG.error(String.format("String_Node_Str",this.getContext().operatorTrace(),input1,input2,e));
    throw e;
  }
}
Program: 55473
Project: 55473
Buggy source:
@Override public void reduce(final Iterator<PactRecord> records,final Collector out) throws Exception {
  this.context.increaseInputCounter();
  this.collector.setCollector(out);
  this.cachedIterator.setIterator(records);
  Iterator<IJsonNode> values=this.cachedIterator;
  if (SopremoUtil.LOG.isTraceEnabled()) {
    final ArrayList<IJsonNode> cached=new ArrayList<IJsonNode>();
    while (this.cachedIterator.hasNext())     cached.add(this.cachedIterator.next());
    values=cached.iterator();
    SopremoUtil.LOG.trace(String.format("String_Node_Str",this.getContext().operatorTrace(),cached));
  }
  final ArrayNode array=JsonUtil.wrapWithNode(this.needsResettableIterator(values),values);
  try {
    this.reduce(array,this.collector);
  }
 catch (  final RuntimeException e) {
    SopremoUtil.LOG.error(String.format("String_Node_Str",this.getContext().operatorTrace(),array,e));
    throw e;
  }
}

Fixed version (ground truth):
@Override public void reduce(final Iterator<PactRecord> records,final Collector out) throws Exception {
  this.context.increaseInputCounter();
  this.collector.configure(out,this.context);
  this.cachedIterator.setIterator(records);
  Iterator<IJsonNode> values=this.cachedIterator;
  if (SopremoUtil.LOG.isTraceEnabled()) {
    final ArrayList<IJsonNode> cached=new ArrayList<IJsonNode>();
    while (this.cachedIterator.hasNext())     cached.add(this.cachedIterator.next());
    values=cached.iterator();
    SopremoUtil.LOG.trace(String.format("String_Node_Str",this.getContext().operatorTrace(),cached));
  }
  final ArrayNode array=JsonUtil.wrapWithNode(this.needsResettableIterator(values),values);
  try {
    this.reduce(array,this.collector);
  }
 catch (  final RuntimeException e) {
    SopremoUtil.LOG.error(String.format("String_Node_Str",this.getContext().operatorTrace(),array,e));
    throw e;
  }
}
Program: 55474
Project: 55474
Buggy source:
@Override public IJsonNode recordToJson(PactRecord record,IJsonNode target){
  if (this.getHeadSize() + 1 != record.getNumFields())   throw new IllegalStateException("String_Node_Str");
  if (target == null)   target=new ArrayNode();
}

Fixed version (ground truth):
@Override public IJsonNode recordToJson(PactRecord record,IJsonNode target){
  if (this.getHeadSize() + 1 != record.getNumFields())   throw new IllegalStateException("String_Node_Str");
  if (target == null)   target=new ArrayNode();
 else   ((IArrayNode)target).clear();
  for (int i=0; i < this.getHeadSize(); i++) {
    if (record.getField(i,JsonNodeWrapper.class) != null) {
      ((IArrayNode)target).add(SopremoUtil.unwrap(record.getField(i,JsonNodeWrapper.class)));
    }
  }
  ((IArrayNode)target).addAll((IArrayNode)SopremoUtil.unwrap(record.getField(this.getHeadSize(),JsonNodeWrapper.class)));
  return target;
}
Program: 55475
Project: 55475
Buggy source:
@Override public IJsonNode remove(int index){
}

Fixed version (ground truth):
@Override public IJsonNode remove(int index){
  if (index < 0 || index >= this.size())   return MissingNode.getInstance();
  if (index < this.schema.getHeadSize()) {
    IJsonNode oldNode=SopremoUtil.wrap(this.getOtherField().remove(0));
    IJsonNode buffer;
    for (int i=this.schema.getHeadSize() - 1; i >= index; i--) {
      buffer=this.record.getField(i,JsonNodeWrapper.class);
      if (buffer == null) {
        buffer=MissingNode.getInstance();
      }
      if (oldNode.isMissing())       this.record.setNull(i);
 else       this.record.setField(i,oldNode);
      oldNode=buffer;
    }
    return SopremoUtil.unwrap(oldNode);
  }
  return this.getOtherField().remove(index - this.schema.getHeadSize());
}
Program: 55476
Project: 55476
Buggy source:
@Override public PactRecord jsonToRecord(IJsonNode value,PactRecord target,EvaluationContext context){
}

Fixed version (ground truth):
@Override public PactRecord jsonToRecord(IJsonNode value,PactRecord target,EvaluationContext context){
  IObjectNode others;
  if (target == null) {
    target=new PactRecord(this.mappings.size() + 1);
    for (int i=0; i < this.mappings.size(); i++)     target.setField(i,new JsonNodeWrapper(MissingNode.getInstance()));
    target.setField(this.mappings.size(),new JsonNodeWrapper(others=new ObjectNode()));
  }
 else {
    JsonNodeWrapper wrappedField=target.getField(target.getNumFields() - 1,JsonNodeWrapper.class);
    others=wrappedField.getValue(IObjectNode.class);
    others.removeAll();
    target.setField(target.getNumFields() - 1,wrappedField);
  }
  IObjectNode object=(IObjectNode)value;
  for (int i=0; i < this.mappings.size(); i++) {
    IJsonNode node=object.get(this.mappings.get(i));
    JsonNodeWrapper wrappedField=target.getField(i,JsonNodeWrapper.class);
    wrappedField.setValue(node);
    target.setField(i,wrappedField);
  }
  for (  Entry<String,IJsonNode> entry : object.getEntries())   if (!this.mappings.contains(entry.getKey()))   others.put(entry.getKey(),entry.getValue());
  return target;
}
Program: 55477
Project: 55477
Buggy source:
private static void removeCheckpointMetaData(final Path pathPrefix) throws IOException {
  Path p=pathPrefix.suffix(COMPLETED_CHECKPOINT_SUFFIX);
  FileSystem fs=p.getFileSystem();
  if (fs.exists(p)) {
    fs.delete(p,false);
    return;
  }
  p=pathPrefix.suffix("String_Node_Str");
  if (fs.exists(p)) {
    fs.delete(p,false);
  }
  p=pathPrefix.suffix("String_Node_Str");
  if (fs.exists(p)) {
    fs.delete(p,false);
  }
}

Fixed version (ground truth):
private static boolean removeCheckpointMetaData(final Path pathPrefix) throws IOException {
  boolean removed=false;
  Path p=pathPrefix.suffix("String_Node_Str");
  FileSystem fs=p.getFileSystem();
  if (fs.exists(p)) {
    fs.delete(p,false);
    removed=true;
  }
  int suffix=0;
  while (true) {
    p=pathPrefix.suffix("String_Node_Str" + suffix++);
    if (fs.exists(p)) {
      fs.delete(p,false);
      removed=true;
    }
 else {
      break;
    }
  }
  p=pathPrefix.suffix(COMPLETED_CHECKPOINT_SUFFIX);
  if (fs.exists(p)) {
    fs.delete(p,false);
    removed=true;
  }
  return removed;
}
Program: 55478
Project: 55478
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 {
    removeCheckpointMetaData(new Path(localChPath + Path.SEPARATOR + METADATA_PREFIX));
    final Path distributedChPath=getDistributedCheckpointPath();
    if (distributedChPath != null) {
      removeCheckpointMetaData(new Path(distributedChPath + Path.SEPARATOR + METADATA_PREFIX));
    }
  }
 catch (  IOException e) {
  }
}

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) {
        removeCheckpointMetaData(new Path(distributedChPath + Path.SEPARATOR + METADATA_PREFIX+ "String_Node_Str"+ vertexID));
      }
    }
    FileBufferManager.deleteFile(vertexID);
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
}
Program: 55479
Project: 55479
Buggy source:
public synchronized void shutdown(){
  if (this.isShutDown) {
    return;
  }
  if (this.instanceManager != null) {
    this.instanceManager.shutdown();
  }
  DiscoveryService.stopDiscoveryService();
  if (this.profiler != null) {
    this.profiler.shutdown();
  }
  if (this.jobManagerServer != null) {
    this.jobManagerServer.stop();
  }
  if (this.executorService != null) {
    this.executorService.shutdown();
  }
  final Iterator<JobManagerPlugin> it=this.jobManagerPlugins.values().iterator();
  while (it.hasNext()) {
    it.next().shutdown();
  }
  if (this.eventCollector != null) {
    this.eventCollector.shutdown();
  }
  if (this.scheduler != null) {
    this.scheduler.shutdown();
  }
  this.isShutDown=true;
  LOG.debug("String_Node_Str");
}

Fixed version (ground truth):
public synchronized void shutdown(){
  if (this.isShutDown) {
    return;
  }
  if (this.instanceManager != null) {
    this.instanceManager.shutdown();
  }
  DiscoveryService.stopDiscoveryService();
  if (this.profiler != null) {
    this.profiler.shutdown();
  }
  if (this.jobManagerServer != null) {
    this.jobManagerServer.stop();
  }
  if (this.executorService != null) {
    this.executorService.shutdown();
    try {
      this.executorService.awaitTermination(5000L,TimeUnit.MILLISECONDS);
    }
 catch (    InterruptedException e) {
      if (LOG.isDebugEnabled()) {
        LOG.debug(StringUtils.stringifyException(e));
      }
    }
  }
  final Iterator<JobManagerPlugin> it=this.jobManagerPlugins.values().iterator();
  while (it.hasNext()) {
    it.next().shutdown();
  }
  if (this.eventCollector != null) {
    this.eventCollector.shutdown();
  }
  if (this.scheduler != null) {
    this.scheduler.shutdown();
  }
  this.isShutDown=true;
  LOG.debug("String_Node_Str");
}
Program: 55480
Project: 55480
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public TaskCancelResult cancelTask(final ExecutionVertexID id) throws IOException {
  final Task task=this.runningTasks.get(id);
  if (task == null) {
    final TaskCancelResult taskCancelResult=new TaskCancelResult(id,AbstractTaskResult.ReturnCode.TASK_NOT_FOUND);
    taskCancelResult.setDescription("String_Node_Str" + id + "String_Node_Str");
    return taskCancelResult;
  }
  final Thread tmpThread=new Thread(new Runnable(){
    @Override public void run(){
      task.cancelExecution();
    }
  }
);
  tmpThread.start();
  return new TaskCancelResult(id,AbstractTaskResult.ReturnCode.SUCCESS);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public TaskCancelResult cancelTask(final ExecutionVertexID id) throws IOException {
  final Task task=this.runningTasks.get(id);
  if (task == null) {
    final TaskCancelResult taskCancelResult=new TaskCancelResult(id,AbstractTaskResult.ReturnCode.TASK_NOT_FOUND);
    taskCancelResult.setDescription("String_Node_Str" + id + "String_Node_Str");
    return taskCancelResult;
  }
  final Runnable r=new Runnable(){
    @Override public void run(){
      task.cancelExecution();
    }
  }
;
  this.executorService.execute(r);
  return new TaskCancelResult(id,AbstractTaskResult.ReturnCode.SUCCESS);
}
Program: 55481
Project: 55481
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void removeCheckpoints(final List<ExecutionVertexID> listOfVertexIDs) throws IOException {
  final Thread checkpointRemovalThread=new Thread("String_Node_Str"){
    @Override public void run(){
      final Iterator<ExecutionVertexID> it=listOfVertexIDs.iterator();
      while (it.hasNext()) {
        final ExecutionVertexID vertexID=it.next();
        EnvelopeConsumptionLog.removeLog(vertexID);
        CheckpointUtils.removeCheckpoint(vertexID);
      }
    }
  }
;
  checkpointRemovalThread.start();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void removeCheckpoints(final List<ExecutionVertexID> listOfVertexIDs) throws IOException {
  final List<ExecutionVertexID> threadSafeList=Collections.unmodifiableList(listOfVertexIDs);
  final Runnable r=new Runnable(){
    @Override public void run(){
      final Iterator<ExecutionVertexID> it=threadSafeList.iterator();
      while (it.hasNext()) {
        final ExecutionVertexID vertexID=it.next();
        EnvelopeConsumptionLog.removeLog(vertexID);
        CheckpointUtils.removeCheckpoint(vertexID);
      }
    }
  }
;
  this.executorService.execute(r);
}
Program: 55482
Project: 55482
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public TaskKillResult killTask(final ExecutionVertexID id) throws IOException {
  final Task task=this.runningTasks.get(id);
  if (task == null) {
    final TaskKillResult taskKillResult=new TaskKillResult(id,AbstractTaskResult.ReturnCode.TASK_NOT_FOUND);
    taskKillResult.setDescription("String_Node_Str" + id + "String_Node_Str");
    return taskKillResult;
  }
  final Thread tmpThread=new Thread(new Runnable(){
    @Override public void run(){
      task.killExecution();
    }
  }
);
  tmpThread.start();
  return new TaskKillResult(id,AbstractTaskResult.ReturnCode.SUCCESS);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public TaskKillResult killTask(final ExecutionVertexID id) throws IOException {
  final Task task=this.runningTasks.get(id);
  if (task == null) {
    final TaskKillResult taskKillResult=new TaskKillResult(id,AbstractTaskResult.ReturnCode.TASK_NOT_FOUND);
    taskKillResult.setDescription("String_Node_Str" + id + "String_Node_Str");
    return taskKillResult;
  }
  final Runnable r=new Runnable(){
    @Override public void run(){
      task.killExecution();
    }
  }
;
  this.executorService.execute(r);
  return new TaskKillResult(id,AbstractTaskResult.ReturnCode.SUCCESS);
}
Program: 55483
Project: 55483
Buggy source:
/** 
 * Shuts the task manager down.
 */
public synchronized void shutdown(){
  if (this.isShutDown) {
    return;
  }
  LOG.info("String_Node_Str");
  RPC.stopProxy(this.jobManager);
  this.taskManagerServer.stop();
  if (this.profiler != null) {
    this.profiler.shutdown();
  }
  this.byteBufferedChannelManager.shutdown();
  if (this.ioManager != null) {
    this.ioManager.shutdown();
  }
  if (this.memoryManager != null) {
    this.memoryManager.shutdown();
  }
  final Iterator<TaskManagerPlugin> it=this.taskManagerPlugins.values().iterator();
  while (it.hasNext()) {
    it.next().shutdown();
  }
  this.isShutDown=true;
}

Fixed version (ground truth):
/** 
 * Shuts the task manager down.
 */
public synchronized void shutdown(){
  if (this.isShutDown) {
    return;
  }
  LOG.info("String_Node_Str");
  RPC.stopProxy(this.jobManager);
  this.taskManagerServer.stop();
  if (this.profiler != null) {
    this.profiler.shutdown();
  }
  this.byteBufferedChannelManager.shutdown();
  if (this.ioManager != null) {
    this.ioManager.shutdown();
  }
  if (this.memoryManager != null) {
    this.memoryManager.shutdown();
  }
  if (this.executorService != null) {
    this.executorService.shutdown();
    try {
      this.executorService.awaitTermination(5000L,TimeUnit.MILLISECONDS);
    }
 catch (    InterruptedException e) {
      if (LOG.isDebugEnabled()) {
        LOG.debug(StringUtils.stringifyException(e));
      }
    }
  }
  final Iterator<TaskManagerPlugin> it=this.taskManagerPlugins.values().iterator();
  while (it.hasNext()) {
    it.next().shutdown();
  }
  this.isShutDown=true;
}
Program: 55488
Project: 55488
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void read(DataInput in) throws IOException {
  final int addr_length=in.readInt();
  byte[] address=new byte[addr_length];
  in.readFully(address);
  this.hostname=StringRecord.readString(in);
  this.domainname=StringRecord.readString(in);
  try {
    this.inetAddress=InetAddress.getByAddress(address);
  }
 catch (  UnknownHostException uhe) {
    throw new IOException(StringUtils.stringifyException(uhe));
  }
  this.ipcPort=in.readInt();
  this.dataPort=in.readInt();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void read(final DataInput in) throws IOException {
  final int addr_length=in.readInt();
  byte[] address=new byte[addr_length];
  in.readFully(address);
  this.hostName=StringRecord.readString(in);
  this.domainName=StringRecord.readString(in);
  try {
    this.inetAddress=InetAddress.getByAddress(address);
  }
 catch (  UnknownHostException uhe) {
    throw new IOException(StringUtils.stringifyException(uhe));
  }
  this.ipcPort=in.readInt();
  this.dataPort=in.readInt();
}
Program: 55489
Project: 55489
Buggy source:
/** 
 * Returns the host name of the instance. If the host name could not be determined, the return value will be a textual representation of the instance's IP address.
 * @return the host name of the instance
 */
public String getHostName(){
  return this.hostname;
}

Fixed version (ground truth):
/** 
 * Returns the host name of the instance. If the host name could not be determined, the return value will be a textual representation of the instance's IP address.
 * @return the host name of the instance
 */
public String getHostName(){
  return this.hostName;
}
Program: 55490
Project: 55490
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public boolean equals(Object obj){
  if (obj instanceof InstanceConnectionInfo) {
    InstanceConnectionInfo ici=(InstanceConnectionInfo)obj;
    if (!this.inetAddress.equals(ici.getAddress())) {
      return false;
    }
    if (this.ipcPort != ici.getIPCPort()) {
      return false;
    }
    if (this.dataPort != ici.getDataPort()) {
      return false;
    }
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public boolean equals(final Object obj){
  if (obj instanceof InstanceConnectionInfo) {
    InstanceConnectionInfo ici=(InstanceConnectionInfo)obj;
    if (!this.inetAddress.equals(ici.getAddress())) {
      return false;
    }
    if (this.ipcPort != ici.getIPCPort()) {
      return false;
    }
    if (this.dataPort != ici.getDataPort()) {
      return false;
    }
    return true;
  }
  return false;
}
Program: 55491
Project: 55491
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public String toString(){
  String iaString;
  if (this.hostname != null) {
    iaString=this.hostname;
  }
 else {
    iaString=inetAddress.toString();
    iaString=iaString.replace("String_Node_Str","String_Node_Str");
  }
  return iaString;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public String toString(){
  String iaString;
  if (this.hostName != null) {
    iaString=this.hostName;
  }
 else {
    iaString=inetAddress.toString();
    iaString=iaString.replace("String_Node_Str","String_Node_Str");
  }
  return iaString;
}
Program: 55492
Project: 55492
Buggy source:
@Override public int compareTo(InstanceConnectionInfo o){
  return this.getAddress().getHostName().compareTo(((InstanceConnectionInfo)o).getAddress().getHostName());
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public int compareTo(final InstanceConnectionInfo o){
  return this.getAddress().getHostName().compareTo(((InstanceConnectionInfo)o).getAddress().getHostName());
}
Program: 55493
Project: 55493
Buggy source:
/** 
 * Returns the domain name of the instance.
 * @return the domain name of the instance or <code>null</code> if the domain name could not be determined
 */
public String getDomainName(){
  return this.domainname;
}

Fixed version (ground truth):
/** 
 * Returns the domain name of the instance.
 * @return the domain name of the instance or <code>null</code> if the domain name could not be determined
 */
public String getDomainName(){
  return this.domainName;
}
Program: 55494
Project: 55494
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void write(DataOutput out) throws IOException {
  out.writeInt(this.inetAddress.getAddress().length);
  out.write(this.inetAddress.getAddress());
  StringRecord.writeString(out,this.hostname);
  StringRecord.writeString(out,this.domainname);
  out.writeInt(this.ipcPort);
  out.writeInt(this.dataPort);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void write(final DataOutput out) throws IOException {
  out.writeInt(this.inetAddress.getAddress().length);
  out.write(this.inetAddress.getAddress());
  StringRecord.writeString(out,this.hostName);
  StringRecord.writeString(out,this.domainName);
  out.writeInt(this.ipcPort);
  out.writeInt(this.dataPort);
}
Program: 55496
Project: 55496
Buggy source:
RuntimeInputChannelContext(final RuntimeInputGateContext inputGateContext,final TransferEnvelopeDispatcher transferEnvelopeDispatcher,final AbstractByteBufferedInputChannel<?> byteBufferedInputChannel,final EnvelopeConsumptionLog envelopeConsumptionLog){
  this.inputGateContext=inputGateContext;
  this.transferEnvelopeDispatcher=transferEnvelopeDispatcher;
  this.byteBufferedInputChannel=byteBufferedInputChannel;
  this.byteBufferedInputChannel.setInputChannelBroker(this);
  this.envelopeConsumptionLog=envelopeConsumptionLog;
}

Fixed version (ground truth):
RuntimeInputChannelContext(final RuntimeInputGateContext inputGateContext,final TransferEnvelopeDispatcher transferEnvelopeDispatcher,final AbstractByteBufferedInputChannel<?> byteBufferedInputChannel,final EnvelopeConsumptionLog envelopeConsumptionLog){
  this.inputGateContext=inputGateContext;
  this.transferEnvelopeDispatcher=transferEnvelopeDispatcher;
  this.byteBufferedInputChannel=byteBufferedInputChannel;
  this.byteBufferedInputChannel.setInputChannelBroker(this);
  this.envelopeConsumptionLog=envelopeConsumptionLog;
  this.isReexecuted=(envelopeConsumptionLog.getNumberOfInitialLogEntries() > 0L);
}
Program: 55497
Project: 55497
Buggy source:
public ChannelReaderInputView(BlockChannelReader reader,List<MemorySegment> memory,int numBlocks,boolean waitForFirstBlock) throws IOException {
  super(ChannelWriterOutputView.HEADER_LENGTH);
  if (reader == null || memory == null)   throw new NullPointerException();
  if (memory.isEmpty())   throw new IllegalArgumentException("String_Node_Str");
  if (numBlocks < 1 && numBlocks != -1) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.reader=reader;
  this.numRequestsRemaining=numBlocks;
  this.numSegments=memory.size();
  for (int i=0; i < memory.size(); i++) {
    sendReadRequest(memory.get(i));
  }
  if (waitForFirstBlock) {
    advance();
  }
}

Fixed version (ground truth):
public ChannelReaderInputView(BlockChannelReader reader,List<MemorySegment> memory,int numBlocks,boolean waitForFirstBlock) throws IOException {
  super(ChannelWriterOutputView.HEADER_LENGTH);
  if (reader == null || memory == null)   throw new NullPointerException();
  if (memory.isEmpty())   throw new IllegalArgumentException("String_Node_Str");
  if (numBlocks < 1 && numBlocks != -1) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.reader=reader;
  this.numRequestsRemaining=numBlocks;
  this.numSegments=memory.size();
  this.freeMem=new ArrayList<MemorySegment>(this.numSegments);
  for (int i=0; i < memory.size(); i++) {
    sendReadRequest(memory.get(i));
  }
  if (waitForFirstBlock) {
    advance();
  }
}
Program: 55498
Project: 55498
Buggy source:
/** 
 * Sends a new read requests, if further requests remain. Otherwise, this method adds the segment directly to the readers return queue.
 * @param seg The segment to use for the read request.
 * @throws IOException Thrown, if the reader is in error.
 */
private void sendReadRequest(MemorySegment seg) throws IOException {
  if (this.numRequestsRemaining != 0) {
    this.reader.readBlock(seg);
    if (this.numRequestsRemaining != -1) {
      this.numRequestsRemaining--;
    }
  }
 else {
    this.reader.getReturnQueue().add(seg);
  }
}

Fixed version (ground truth):
/** 
 * Sends a new read requests, if further requests remain. Otherwise, this method adds the segment directly to the readers return queue.
 * @param seg The segment to use for the read request.
 * @throws IOException Thrown, if the reader is in error.
 */
private void sendReadRequest(MemorySegment seg) throws IOException {
  if (this.numRequestsRemaining != 0) {
    this.reader.readBlock(seg);
    if (this.numRequestsRemaining != -1) {
      this.numRequestsRemaining--;
    }
  }
 else {
    this.freeMem.add(seg);
  }
}
Program: 55499
Project: 55499
Buggy source:
/** 
 * Closes this InoutView, closing the underlying reader and returning all memory segments.
 * @return A list containing all memory segments originally supplied to this view.
 * @throws IOException Thrown, if the underlying reader could not be properly closed.
 */
public List<MemorySegment> close() throws IOException {
  if (this.closed) {
    throw new IllegalStateException("String_Node_Str");
  }
  this.closed=true;
  ArrayList<MemorySegment> list=new ArrayList<MemorySegment>(this.numSegments);
  final MemorySegment current=getCurrentSegment();
  if (current != null) {
    list.add(current);
  }
  clear();
  final LinkedBlockingQueue<MemorySegment> queue=this.reader.getReturnQueue();
  this.reader.close();
  while (list.size() < this.numSegments) {
    final MemorySegment m=queue.poll();
    if (m == null) {
      throw new RuntimeException("String_Node_Str");
    }
    list.add(m);
  }
  return list;
}

Fixed version (ground truth):
/** 
 * Closes this InputView, closing the underlying reader and returning all memory segments.
 * @return A list containing all memory segments originally supplied to this view.
 * @throws IOException Thrown, if the underlying reader could not be properly closed.
 */
public List<MemorySegment> close() throws IOException {
  if (this.closed) {
    throw new IllegalStateException("String_Node_Str");
  }
  this.closed=true;
  ArrayList<MemorySegment> list=this.freeMem;
  final MemorySegment current=getCurrentSegment();
  if (current != null) {
    list.add(current);
  }
  clear();
  final LinkedBlockingQueue<MemorySegment> queue=this.reader.getReturnQueue();
  this.reader.close();
  while (list.size() < this.numSegments) {
    final MemorySegment m=queue.poll();
    if (m == null) {
      throw new RuntimeException("String_Node_Str");
    }
    list.add(m);
  }
  return list;
}