Program: 87772
Project: 87772
Buggy source:
@Override public void collect(PactRecord record){
  try {
    if (this.spillingInThisBuffer) {
      if (this.currentBuffer.write(record)) {
        if (this.bytesUntilSpilling - this.currentBuffer.getOccupancy() <= 0) {
          this.bytesUntilSpilling=0;
          this.queues.sort.add(SPILLING_MARKER);
        }
        return;
      }
    }
 else {
      if (this.currentBuffer.write(record))       return;
    }
    if (this.bytesUntilSpilling > 0) {
      this.bytesUntilSpilling-=this.currentBuffer.getCapacity();
      if (this.bytesUntilSpilling <= 0) {
        this.bytesUntilSpilling=0;
        this.queues.sort.add(SPILLING_MARKER);
      }
    }
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str" + this.currentElement.id + "String_Node_Str");
    }
    this.queues.sort.add(this.currentElement);
    this.currentElement=null;
    while (this.running && this.currentElement == null) {
      try {
        this.currentElement=this.queues.empty.take();
      }
 catch (      InterruptedException iex) {
        if (this.running) {
          LOG.error("String_Node_Str" + "String_Node_Str");
        }
 else {
          return;
        }
      }
    }
    if (!this.running)     return;
    this.currentBuffer=this.currentElement.buffer;
    if (!this.currentBuffer.isEmpty()) {
      throw new RuntimeException("String_Node_Str");
    }
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str" + this.currentElement.id + "String_Node_Str");
    }
    if (!this.currentBuffer.write(record)) {
      throw new RuntimeException("String_Node_Str");
    }
  }
 catch (  IOException ioex) {
    throw new RuntimeException("String_Node_Str" + ioex.getMessage(),ioex);
  }
}

Fixed version (ground truth):
@Override public void collect(PactRecord record){
  this.collectedPactRecordsInBytes+=record.getBinaryLength();
  try {
    if (this.spillingInThisBuffer) {
      if (this.currentBuffer.write(record)) {
        if (this.bytesUntilSpilling - this.currentBuffer.getOccupancy() <= 0) {
          this.bytesUntilSpilling=0;
          this.queues.sort.add(SPILLING_MARKER);
        }
        return;
      }
    }
 else {
      if (this.currentBuffer.write(record))       return;
    }
    if (this.bytesUntilSpilling > 0) {
      this.bytesUntilSpilling-=this.currentBuffer.getCapacity();
      if (this.bytesUntilSpilling <= 0) {
        this.bytesUntilSpilling=0;
        this.queues.sort.add(SPILLING_MARKER);
      }
    }
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str" + this.currentElement.id + "String_Node_Str");
    }
    this.queues.sort.add(this.currentElement);
    this.currentElement=null;
    while (this.running && this.currentElement == null) {
      try {
        this.currentElement=this.queues.empty.take();
      }
 catch (      InterruptedException iex) {
        if (this.running) {
          LOG.error("String_Node_Str" + "String_Node_Str");
        }
 else {
          return;
        }
      }
    }
    if (!this.running)     return;
    this.currentBuffer=this.currentElement.buffer;
    if (!this.currentBuffer.isEmpty()) {
      throw new RuntimeException("String_Node_Str");
    }
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str" + this.currentElement.id + "String_Node_Str");
    }
    if (!this.currentBuffer.write(record)) {
      throw new RuntimeException("String_Node_Str");
    }
  }
 catch (  IOException ioex) {
    throw new RuntimeException("String_Node_Str" + ioex.getMessage(),ioex);
  }
}