nus-yam/ex-repair huggingface dataset:
Program: 56016
Project: 56016
Buggy source:
public int getDistance(Signature actualSignature,Method method){
  Class<?>[] actualParamTypes=actualSignature.parameterTypes;
  int nonVarArgs=this.parameterTypes.length - 1;
  if (nonVarArgs > actualParamTypes.length)   return NO_MATCH;
  int distance=0;
  for (int index=0; index < nonVarArgs; index++) {
    if (!this.parameterTypes[index].isAssignableFrom(actualParamTypes[index]))     return NO_MATCH;
    distance+=ReflectUtil.getDistance(this.parameterTypes[index],actualParamTypes[index]);
  }
  if (nonVarArgs < actualParamTypes.length) {
    Class<?> varargType=this.parameterTypes[nonVarArgs].getComponentType();
    for (int index=nonVarArgs; index < actualParamTypes.length; index++) {
      if (!varargType.isAssignableFrom(actualParamTypes[index]))       return NO_MATCH;
      distance+=ReflectUtil.getDistance(varargType,actualParamTypes[index]) + 1;
    }
  }
  return distance;
}

Fixed version (ground truth):
@Override public int getDistance(Signature actualSignature){
  Class<?>[] actualParamTypes=actualSignature.parameterTypes;
  int nonVarArgs=this.parameterTypes.length - 1;
  if (nonVarArgs > actualParamTypes.length)   return NO_MATCH;
  int distance=0;
  for (int index=0; index < nonVarArgs; index++) {
    if (!this.parameterTypes[index].isAssignableFrom(actualParamTypes[index]))     return NO_MATCH;
    distance+=ReflectUtil.getDistance(this.parameterTypes[index],actualParamTypes[index]);
  }
  if (nonVarArgs < actualParamTypes.length) {
    Class<?> varargType=this.parameterTypes[nonVarArgs].getComponentType();
    for (int index=nonVarArgs; index < actualParamTypes.length; index++) {
      if (!varargType.isAssignableFrom(actualParamTypes[index]))       return NO_MATCH;
      distance+=ReflectUtil.getDistance(varargType,actualParamTypes[index]) + 1;
    }
  }
  return distance;
}
Program: 56017
Project: 56017
Buggy source:
protected abstract T loadNext();

Fixed version (ground truth):
/** 
 * Returns the next element or the result of   {@link #noMoreElements()}.
 * @return the next element
 */
protected abstract T loadNext();
Program: 56018
Project: 56018
Buggy source:
protected boolean isInitialized(){
  return this.initialized;
}

Fixed version (ground truth):
/** 
 * Return true if at least one element has been loaded.
 * @return true if at least one element has been loaded
 */
protected boolean isInitialized(){
  return this.initialized;
}
Program: 56019
Project: 56019
Buggy source:
protected T noMoreElements(){
  this.hasNext=false;
  return null;
}

Fixed version (ground truth):
/** 
 * Signal methods that should be invoked when no more elements are in the iterator.
 * @return a signal that no more elements are in this iterator
 */
protected T noMoreElements(){
  this.hasNext=false;
  return null;
}
Program: 56020
Project: 56020
Buggy source:
public ConcatenatingIterator(Iterator<T>... inputs){
  this.inputs=new LinkedList<Iterator<T>>(Arrays.asList(inputs));
}

Fixed version (ground truth):
/** 
 * Initializes a ConcatenatingIterator with an array of iterators. This constructor is not type-safe.
 * @param iterators the iterators to concatenate
 */
@SuppressWarnings("String_Node_Str") public ConcatenatingIterator(Iterator<?>... iterators){
  this.inputs=new LinkedList<Iterator<? extends T>>((Collection<? extends Iterator<? extends T>>)Arrays.asList(iterators));
}
Program: 56021
Project: 56021
Buggy source:
@Override protected T loadNext(){
  while (!this.inputs.isEmpty()) {
    Iterator<T> iterator=this.inputs.getFirst();
    if (!iterator.hasNext())     this.inputs.pop();
 else     return iterator.next();
  }
  return this.noMoreElements();
}

Fixed version (ground truth):
@Override protected T loadNext(){
  while (!this.inputs.isEmpty()) {
    Iterator<? extends T> iterator=this.inputs.getFirst();
    if (!iterator.hasNext())     this.inputs.pop();
 else     return iterator.next();
  }
  return this.noMoreElements();
}
Program: 56022
Project: 56022
Buggy source:
public OneElementList(E element){
  this.element=element;
}

Fixed version (ground truth):
/** 
 * Initializes OneElementList with the given element.
 * @param element the element to wrap
 */
public OneElementList(E element){
  this.element=element;
}
Program: 56023
Project: 56023
Buggy source:
@Override public void write(final DataOutput out) throws IOException {
  final int maxBit=0x1 << 7;
  int len=this.value.length();
  while (len >= maxBit) {
    out.write(len | maxBit);
    len>>=7;
  }
  out.write(len);
  for (int i=0; i < this.value.length(); i++) {
    int c=this.value.charAt(i);
    if (c < maxBit)     out.write(c);
 else     while (c >= maxBit) {
      out.write(c | maxBit);
      c>>=7;
    }
  }
}

Fixed version (ground truth):
@Override public void write(final DataOutput out) throws IOException {
  final int maxBit=0x1 << 7;
  int len=this.value.length();
  while (len >= maxBit) {
    out.write(len | maxBit);
    len>>=7;
  }
  out.write(len);
  for (int i=0; i < this.value.length(); i++) {
    int c=this.value.charAt(i);
    while (c >= maxBit) {
      out.write(c | maxBit);
      c>>=7;
    }
    out.write(c);
  }
}
Program: 56024
Project: 56024
Buggy source:
@Test public void testPactString(){
  PactString string0=new PactString("String_Node_Str");
  Assert.assertEquals("String_Node_Str",string0.toString());
  PactString string1=new PactString("String_Node_Str");
  PactString string2=new PactString("String_Node_Str");
  PactString string3=new PactString("String_Node_Str");
  Assert.assertTrue(string0.compareTo(string0) == 0);
  Assert.assertTrue(string0.compareTo(string1) == 0);
  Assert.assertTrue(string0.compareTo(string2) > 0);
  Assert.assertTrue(string0.compareTo(string3) < 0);
  try {
    string0.write(mOut);
    string2.write(mOut);
    string3.write(mOut);
    PactString string1n=new PactString();
    PactString string2n=new PactString();
    PactString string3n=new PactString();
    string1n.read(mIn);
    string2n.read(mIn);
    string3n.read(mIn);
    Assert.assertEquals(string0.compareTo(string1n),0);
    Assert.assertEquals(string0.toString(),string1n.toString());
    Assert.assertEquals(string2.compareTo(string2n),0);
    Assert.assertEquals(string2.toString(),string2n.toString());
    Assert.assertEquals(string3.compareTo(string3n),0);
    Assert.assertEquals(string3.toString(),string3n.toString());
  }
 catch (  Exception e) {
    Assert.assertTrue(false);
  }
}

Fixed version (ground truth):
@Test public void testPactString(){
  PactString string0=new PactString("String_Node_Str");
  Assert.assertEquals("String_Node_Str",string0.toString());
  PactString string1=new PactString("String_Node_Str");
  PactString string2=new PactString("String_Node_Str");
  PactString string3=new PactString("String_Node_Str");
  PactString string4=new PactString("String_Node_Str");
  Assert.assertTrue(string0.compareTo(string0) == 0);
  Assert.assertTrue(string0.compareTo(string1) == 0);
  Assert.assertTrue(string0.compareTo(string2) > 0);
  Assert.assertTrue(string0.compareTo(string3) < 0);
  try {
    string0.write(mOut);
    string4.write(mOut);
    string2.write(mOut);
    string3.write(mOut);
    PactString string1n=new PactString();
    PactString string2n=new PactString();
    PactString string3n=new PactString();
    PactString string4n=new PactString();
    string1n.read(mIn);
    string4n.read(mIn);
    string2n.read(mIn);
    string3n.read(mIn);
    Assert.assertEquals(string0.compareTo(string1n),0);
    Assert.assertEquals(string0.toString(),string1n.toString());
    Assert.assertEquals(string4.compareTo(string4n),0);
    Assert.assertEquals(string4.toString(),string4n.toString());
    Assert.assertEquals(string2.compareTo(string2n),0);
    Assert.assertEquals(string2.toString(),string2n.toString());
    Assert.assertEquals(string3.compareTo(string3n),0);
    Assert.assertEquals(string3.toString(),string3n.toString());
  }
 catch (  Exception e) {
    Assert.assertTrue(false);
  }
}
Program: 56025
Project: 56025
Buggy source:
@Override public InstanceType getDefaultInstanceType(){
  return DEFAULT;
}

Fixed version (ground truth):
@Override public InstanceType getDefaultInstanceType(){
  return DEFAULT_INSTANCE_TYPE;
}
Program: 56026
Project: 56026
Buggy source:
@Override public InstanceType getInstanceTypeByName(final String instanceTypeName){
  return DEFAULT;
}

Fixed version (ground truth):
@Override public InstanceType getInstanceTypeByName(final String instanceTypeName){
  return DEFAULT_INSTANCE_TYPE;
}
Program: 56027
Project: 56027
Buggy source:
@Override public InstanceType getSuitableInstanceType(final int minNumComputeUnits,final int minNumCPUCores,final int minMemorySize,final int minDiskCapacity,final int maxPricePerHour){
  return DEFAULT;
}

Fixed version (ground truth):
@Override public InstanceType getSuitableInstanceType(final int minNumComputeUnits,final int minNumCPUCores,final int minMemorySize,final int minDiskCapacity,final int maxPricePerHour){
  return DEFAULT_INSTANCE_TYPE;
}
Program: 56028
Project: 56028
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: 56029
Project: 56029
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void requestClose() throws IOException, InterruptedException {
  if (!this.closeRequested) {
    this.closeRequested=true;
    transferEvent(new ByteBufferedChannelCloseEvent());
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void requestClose() throws IOException, InterruptedException {
  if (!this.closeRequested) {
    this.closeRequested=true;
    if (!isBroadcastChannel() || getChannelIndex() == 0) {
      transferEvent(new ByteBufferedChannelCloseEvent());
    }
  }
}
Program: 56030
Project: 56030
Buggy source:
/** 
 * Decreases the number of references to the physical buffer by one. If the number of references becomes zero the physical buffer is recycled.
 */
synchronized void decreaseReferenceCounter(){
  if (this.bufferAlreadyRecycled) {
    LOG.error("String_Node_Str");
  }
  --this.referenceCounter;
  if (this.referenceCounter <= 0) {
    this.originalBuffer.clear();
synchronized (this.queueForRecycledBuffers) {
      this.queueForRecycledBuffers.add(this.originalBuffer);
      this.queueForRecycledBuffers.notify();
    }
  }
  this.bufferAlreadyRecycled=true;
}

Fixed version (ground truth):
/** 
 * Decreases the number of references to the physical buffer by one. If the number of references becomes zero the physical buffer is recycled.
 */
synchronized void decreaseReferenceCounter(){
  if (this.bufferAlreadyRecycled) {
    LOG.error("String_Node_Str");
  }
  --this.referenceCounter;
  if (this.referenceCounter <= 0) {
    this.originalBuffer.clear();
synchronized (this.queueForRecycledBuffers) {
      this.queueForRecycledBuffers.add(this.originalBuffer);
      this.queueForRecycledBuffers.notify();
    }
    this.bufferAlreadyRecycled=true;
  }
}
Program: 56032
Project: 56032
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public boolean processEnvelopeFromNetworkOrCheckpoint(final TransferEnvelope transferEnvelope) throws IOException {
  try {
    if (!processEnvelope(transferEnvelope)) {
      System.out.println("String_Node_Str");
    }
  }
 catch (  InterruptedException e) {
    LOG.error("String_Node_Str" + StringUtils.stringifyException(e));
  }
  return false;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public boolean processEnvelopeFromNetworkOrCheckpoint(final TransferEnvelope transferEnvelope) throws IOException {
  try {
    if (!processEnvelope(transferEnvelope)) {
      return false;
    }
  }
 catch (  InterruptedException e) {
    LOG.error("String_Node_Str" + StringUtils.stringifyException(e));
  }
  return true;
}
Program: 56033
Project: 56033
Buggy source:
private boolean readSequenceNumber(ReadableByteChannel readableByteChannel) throws IOException {
  if (!this.sequenceNumberDeserializationStarted) {
    this.lengthBuffer.clear();
    this.sequenceNumberDeserializationStarted=true;
  }
  if (readableByteChannel.read(this.lengthBuffer) == -1) {
    if (this.lengthBuffer.position() == 0) {
      throw new EOFException();
    }
 else {
      throw new IOException("String_Node_Str");
    }
  }
  if (!this.lengthBuffer.hasRemaining()) {
    final int sequenceNumber=byteBufferToInteger(this.lengthBuffer,0);
    if (sequenceNumber < 0) {
      throw new IOException("String_Node_Str" + sequenceNumber);
    }
    this.deserializationState=DeserializationState.SEQUENCENUMBERDESERIALIZED;
    this.sequenceNumberDeserializationStarted=false;
    this.transferEnvelope=null;
    this.sizeOfBuffer=-1;
    this.bufferExistanceDeserialized=false;
    this.existanceBuffer.clear();
    this.lengthBuffer.clear();
    this.jobIDDeserializationBuffer.clear();
    this.channelIDDeserializationBuffer.clear();
    this.buffer=null;
    return false;
  }
  return true;
}

Fixed version (ground truth):
private boolean readSequenceNumber(ReadableByteChannel readableByteChannel) throws IOException {
  if (!this.sequenceNumberDeserializationStarted) {
    this.lengthBuffer.clear();
    this.sequenceNumberDeserializationStarted=true;
  }
  if (readableByteChannel.read(this.lengthBuffer) == -1) {
    if (this.lengthBuffer.position() == 0) {
      throw new EOFException();
    }
 else {
      throw new IOException("String_Node_Str");
    }
  }
  if (!this.lengthBuffer.hasRemaining()) {
    this.deserializedSequenceNumber=byteBufferToInteger(this.lengthBuffer,0);
    if (this.deserializedSequenceNumber < 0) {
      throw new IOException("String_Node_Str" + this.deserializedSequenceNumber);
    }
    this.deserializationState=DeserializationState.SEQUENCENUMBERDESERIALIZED;
    this.sequenceNumberDeserializationStarted=false;
    this.transferEnvelope=null;
    this.sizeOfBuffer=-1;
    this.bufferExistanceDeserialized=false;
    this.existanceBuffer.clear();
    this.lengthBuffer.clear();
    this.jobIDDeserializationBuffer.clear();
    this.channelIDDeserializationBuffer.clear();
    this.buffer=null;
    return false;
  }
  return true;
}
Program: 56034
Project: 56034
Buggy source:
public abstract void getStreamedNestedLoopsCosts(OptimizerNode node,PactConnection outerSide,PactConnection innerSide,Costs costs);

Fixed version (ground truth):
public abstract void getStreamedNestedLoopsCosts(OptimizerNode node,PactConnection outerSide,PactConnection innerSide,int bufferSize,Costs costs);
Program: 56037
Project: 56037
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void executionStateChanged(Environment ee,ExecutionState newExecutionState,String optionalMessage){
  final long timestamp=System.currentTimeMillis();
  final VertexEvent vertexEvent=new VertexEvent(timestamp,this.jobVertexID,ee.getTaskName(),ee.getCurrentNumberOfSubtasks(),ee.getIndexInSubtaskGroup(),newExecutionState,optionalMessage);
  this.eventCollector.addEvent(ee.getJobID(),vertexEvent);
  final ExecutionStateChangeEvent executionStateChangeEvent=new ExecutionStateChangeEvent(timestamp,this.managementVertexID,newExecutionState);
  this.eventCollector.addEvent(ee.getJobID(),executionStateChangeEvent);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void executionStateChanged(Environment ee,ExecutionState newExecutionState,String optionalMessage){
  final long timestamp=System.currentTimeMillis();
  final VertexEvent vertexEvent=new VertexEvent(timestamp,this.jobVertexID,ee.getTaskName(),ee.getCurrentNumberOfSubtasks(),ee.getIndexInSubtaskGroup(),newExecutionState,optionalMessage);
  this.eventCollector.addEvent(ee.getJobID(),vertexEvent);
  final ExecutionStateChangeEvent executionStateChangeEvent=new ExecutionStateChangeEvent(timestamp,this.managementVertexID,newExecutionState);
  this.eventCollector.updateManagementGraph(ee.getJobID(),executionStateChangeEvent);
  this.eventCollector.addEvent(ee.getJobID(),executionStateChangeEvent);
}
Program: 56038
Project: 56038
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void vertexAssignmentChanged(ExecutionVertexID id,AllocatedResource newAllocatedResource){
  final ManagementVertexID managementVertexID=id.toManagementVertexID();
  final long timestamp=System.currentTimeMillis();
  final AbstractInstance instance=newAllocatedResource.getInstance();
  VertexAssignmentEvent event;
  if (instance == null) {
    event=new VertexAssignmentEvent(timestamp,managementVertexID,"String_Node_Str","String_Node_Str");
  }
 else {
    event=new VertexAssignmentEvent(timestamp,managementVertexID,instance.getName(),instance.getType().getIdentifier());
  }
  this.eventCollector.addEvent(this.jobID,event);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void vertexAssignmentChanged(ExecutionVertexID id,AllocatedResource newAllocatedResource){
  final ManagementVertexID managementVertexID=id.toManagementVertexID();
  final long timestamp=System.currentTimeMillis();
  final AbstractInstance instance=newAllocatedResource.getInstance();
  VertexAssignmentEvent event;
  if (instance == null) {
    event=new VertexAssignmentEvent(timestamp,managementVertexID,"String_Node_Str","String_Node_Str");
  }
 else {
    event=new VertexAssignmentEvent(timestamp,managementVertexID,instance.getName(),instance.getType().getIdentifier());
  }
  this.eventCollector.updateManagementGraph(jobID,event);
  this.eventCollector.addEvent(this.jobID,event);
}
Program: 56039
Project: 56039
Buggy source:
private int writeContentForCanceledChannel(final ReadableByteChannel readableByteChannel) throws IOException {
  final ByteBuffer tmpBuffer=ByteBuffer.allocate(128);
  long bytesWritten=0;
  long diff=this.bufferSize - this.totalBytesWritten;
  if (diff <= 0) {
    return 0;
  }
  while (diff > 0) {
    if (diff < tmpBuffer.remaining()) {
      tmpBuffer.limit(tmpBuffer.position() + (int)diff);
    }
    final long b=readableByteChannel.read(tmpBuffer);
    if (b == 0) {
      break;
    }
    if (b == -1) {
      throw new IOException("String_Node_Str");
    }
    if (!tmpBuffer.hasRemaining()) {
      tmpBuffer.clear();
    }
    bytesWritten+=b;
    this.totalBytesWritten+=bytesWritten;
    diff=this.bufferSize - this.totalBytesWritten;
  }
  return (int)bytesWritten;
}

Fixed version (ground truth):
private int writeContentForCanceledChannel(final ReadableByteChannel readableByteChannel) throws IOException {
  final ByteBuffer tmpBuffer=ByteBuffer.allocate(128);
  long bytesWritten=0;
  long diff=this.bufferSize - this.totalBytesWritten;
  if (diff <= 0) {
    return 0;
  }
  while (diff > 0) {
    if (diff < tmpBuffer.remaining()) {
      tmpBuffer.limit(tmpBuffer.position() + (int)diff);
    }
    final long b=readableByteChannel.read(tmpBuffer);
    if (b == 0) {
      break;
    }
    if (b == -1) {
      throw new IOException("String_Node_Str");
    }
    if (!tmpBuffer.hasRemaining()) {
      tmpBuffer.clear();
    }
    bytesWritten+=b;
    this.totalBytesWritten+=b;
    diff=this.bufferSize - this.totalBytesWritten;
  }
  return (int)bytesWritten;
}
Program: 56042
Project: 56042
Buggy source:
/** 
 * Submits the job-graph to the nephele job-manager for execution.
 * @param prog The program to be submitted.
 * @throws ProgramInvocationException Thrown, if the submission failed. That might be either due to an I/O problem,i.e. the job-manager is unreachable, or due to the fact that the execution on the nephele system failed.
 */
public void run(JobGraph jobGraph,boolean wait) throws ProgramInvocationException {
  nepheleConfig.setBoolean("String_Node_Str",false);
  JobClient client;
  try {
    client=new JobClient(jobGraph,nepheleConfig);
  }
 catch (  IOException e) {
    throw new ProgramInvocationException("String_Node_Str" + e.getMessage());
  }
  try {
    if (wait) {
      client.submitJobAndWait();
    }
 else {
      JobSubmissionResult result=client.submitJob();
      if (result.getReturnCode() != ReturnCode.SUCCESS) {
        throw new ProgramInvocationException("String_Node_Str" + (result.getDescription() == null ? "String_Node_Str" : "String_Node_Str" + result.getDescription()));
      }
    }
  }
 catch (  IOException e) {
    throw new ProgramInvocationException("String_Node_Str" + e.getMessage());
  }
catch (  JobExecutionException jex) {
    throw new ProgramInvocationException("String_Node_Str" + jex.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Submits the job-graph to the nephele job-manager for execution.
 * @param prog The program to be submitted.
 * @param wait Method will block until the job execution is finished if set to true. If set to false, the method will directly return after the job is submitted. 
 * @throws ProgramInvocationException Thrown, if the submission failed. That might be either due to an I/O problem,i.e. the job-manager is unreachable, or due to the fact that the execution on the nephele system failed.
 */
public void run(JobGraph jobGraph,boolean wait) throws ProgramInvocationException {
  nepheleConfig.setBoolean("String_Node_Str",false);
  JobClient client;
  try {
    client=new JobClient(jobGraph,nepheleConfig);
  }
 catch (  IOException e) {
    throw new ProgramInvocationException("String_Node_Str" + e.getMessage());
  }
  try {
    if (wait) {
      client.submitJobAndWait();
    }
 else {
      JobSubmissionResult result=client.submitJob();
      if (result.getReturnCode() != ReturnCode.SUCCESS) {
        throw new ProgramInvocationException("String_Node_Str" + (result.getDescription() == null ? "String_Node_Str" : "String_Node_Str" + result.getDescription()));
      }
    }
  }
 catch (  IOException e) {
    throw new ProgramInvocationException("String_Node_Str" + e.getMessage());
  }
catch (  JobExecutionException jex) {
    throw new ProgramInvocationException("String_Node_Str" + jex.getMessage());
  }
}
Program: 56043
Project: 56043
Buggy source:
/** 
 * Crosses a single value with N values all sharing a common key.
 * @param key The key shared by all values
 * @param val1 The single value
 * @param valsN Iterator over N values
 * @param firstInputNValues Set to true if the first input in N-value side, false otherwise.
 * @throws RuntimeException Forwards all exceptions thrown by the stub.
 */
private void cross1withNValues(Key key,Value val1,Iterator<Value> valsN,final boolean firstInputNValues) throws RuntimeException {
  Value v1;
  Value vN;
  keyCopier.setCopy(key);
  this.v1Copier.setCopy(val1);
  while (!this.taskCanceled && valsN.hasNext()) {
    key=this.keySerialization.newInstance();
    this.keyCopier.getCopy(key);
    v1=this.v1Serialization.newInstance();
    this.v1Copier.getCopy(v1);
    vN=valsN.next();
    if (firstInputNValues) {
      matchStub.match(key,vN,v1,output);
    }
 else {
      matchStub.match(key,v1,vN,output);
    }
  }
}

Fixed version (ground truth):
/** 
 * Crosses a single value with N values all sharing a common key.
 * @param key The key shared by all values
 * @param val1 The single value
 * @param valsN Iterator over N values
 * @param firstInputNValues Set to true if the first input in N-value side, false otherwise.
 * @throws RuntimeException Forwards all exceptions thrown by the stub.
 */
private void cross1withNValues(Key key,Value val1,Iterator<Value> valsN,final boolean firstInputNValues) throws RuntimeException {
  Value v1;
  Value vN;
  keyCopier.setCopy(key);
  this.v1Copier.setCopy(val1);
  while (!this.taskCanceled && valsN.hasNext()) {
    key=this.keySerialization.newInstance();
    this.keyCopier.getCopy(key);
    vN=valsN.next();
    if (firstInputNValues) {
      v1=this.v2Serialization.newInstance();
      this.v1Copier.getCopy(v1);
      matchStub.match(key,vN,v1,output);
    }
 else {
      v1=this.v1Serialization.newInstance();
      this.v1Copier.getCopy(v1);
      matchStub.match(key,v1,vN,output);
    }
  }
}
Program: 56044
Project: 56044
Buggy source:
@Override public V next(){
  nextCalled=true;
  return next.getValue();
}

Fixed version (ground truth):
@Override public V next(){
  if (first)   first=false;
  nextCalled=true;
  return next.getValue();
}
Program: 56045
Project: 56045
Buggy source:
public Iterator<V> getValues(){
  return new Iterator<V>(){
    boolean first=true;
    boolean last=false;
    boolean nextCalled=true;
    @Override public boolean hasNext(){
      if (first) {
        first=false;
        return true;
      }
 else       if (last) {
        return false;
      }
 else {
        if (nextCalled) {
          if (!iterator.hasNext()) {
            return false;
          }
          nextCalled=false;
          KeyValuePair<K,V> prev=next;
          next=iterator.next();
          if (next.getKey().compareTo(prev.getKey()) == 0) {
            return true;
          }
 else {
            last=true;
            nextKey=true;
            return false;
          }
        }
 else {
          return true;
        }
      }
    }
    @Override public V next(){
      nextCalled=true;
      return next.getValue();
    }
    @Override public void remove(){
    }
  }
;
}

Fixed version (ground truth):
public Iterator<V> getValues(){
  return new Iterator<V>(){
    boolean first=true;
    boolean last=false;
    boolean nextCalled=true;
    @Override public boolean hasNext(){
      if (first) {
        first=false;
        return true;
      }
 else       if (last) {
        return false;
      }
 else {
        if (nextCalled) {
          if (!iterator.hasNext()) {
            return false;
          }
          nextCalled=false;
          KeyValuePair<K,V> prev=next;
          next=iterator.next();
          if (next.getKey().compareTo(prev.getKey()) == 0) {
            return true;
          }
 else {
            last=true;
            nextKey=true;
            return false;
          }
        }
 else {
          return true;
        }
      }
    }
    @Override public V next(){
      if (first)       first=false;
      nextCalled=true;
      return next.getValue();
    }
    @Override public void remove(){
    }
  }
;
}
Program: 56046
Project: 56046
Buggy source:
@Override public KeyValuePair<Key,Value> next(){
  try {
    KeyValuePair<Key,Value> pair=outerReader.next();
    copier.setCopy(pair);
    return pair;
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
catch (  InterruptedException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
@Override public KeyValuePair<Key,Value> next(){
  try {
    KeyValuePair<Key,Value> pair=reader.next();
    copier.setCopy(pair);
    return pair;
  }
 catch (  IOException e) {
    throw new RuntimeException(e);
  }
catch (  InterruptedException e) {
    throw new RuntimeException(e);
  }
}
Program: 56048
Project: 56048
Buggy source:
@Override public boolean hasNext(){
  return outerReader.hasNext();
}

Fixed version (ground truth):
@Override public boolean hasNext(){
  return reader.hasNext();
}
Program: 56050
Project: 56050
Buggy source:
/** 
 * Constructs a new <tt>ResettableIterator</tt>
 * @param memoryManager
 * @param ioManager
 * @param reader
 * @param availableMemory
 * @throws MemoryAllocationException
 */
public SpillingResettableIterator(MemoryManager memoryManager,IOManager ioManager,Reader<T> reader,long availableMemory,RecordDeserializer<T> deserializer,AbstractInvokable parentTask) throws MemoryAllocationException {
  this.memoryManager=memoryManager;
  this.ioManager=ioManager;
  this.recordReader=reader;
  this.deserializer=deserializer;
  this.memorySegments=this.memoryManager.allocate(parentTask,availableMemory,MINIMUM_NUMBER_OF_BUFFERS,MIN_BUFFER_SIZE);
  this.numBuffers=this.memorySegments.size();
  this.currentBuffer=0;
  LOG.debug("String_Node_Str" + availableMemory + "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Constructs a new <tt>ResettableIterator</tt>
 * @param memoryManager
 * @param ioManager
 * @param reader
 * @param availableMemory
 * @throws MemoryAllocationException
 */
public SpillingResettableIterator(MemoryManager memoryManager,IOManager ioManager,final Iterator<T> it,long availableMemory,RecordDeserializer<T> deserializer,AbstractInvokable parentTask) throws MemoryAllocationException {
  this.memoryManager=memoryManager;
  this.ioManager=ioManager;
  this.recordReader=new Reader<T>(){
    @Override public List<AbstractInputChannel<T>> getInputChannels(){
      throw new UnsupportedOperationException();
    }
    @Override public boolean hasNext(){
      return it.hasNext();
    }
    @Override public T next() throws IOException, InterruptedException {
      T next=it.next();
      return next;
    }
  }
;
  this.deserializer=deserializer;
  this.memorySegments=this.memoryManager.allocate(parentTask,availableMemory,MINIMUM_NUMBER_OF_BUFFERS,MIN_BUFFER_SIZE);
  this.numBuffers=this.memorySegments.size();
  this.currentBuffer=0;
  LOG.debug("String_Node_Str" + availableMemory + "String_Node_Str");
}
Program: 56051
Project: 56051
Buggy source:
@Override public boolean hasNext(){
  if (this.next == null) {
    this.next=deserializer.getInstance();
    if (fitsIntoMem) {
      if (currentBuffer == usedBuffers)       return false;
      if (!inputBuffers.get(currentBuffer).read(this.next)) {
        inputBuffers.get(currentBuffer).rewind();
        currentBuffer++;
        if (currentBuffer == usedBuffers)         return false;
        inputBuffers.get(currentBuffer).read(this.next);
      }
      return true;
    }
 else {
      try {
        return ioReader.read(this.next);
      }
 catch (      IOException ioex) {
        throw new RuntimeException(ioex);
      }
    }
  }
 else {
    return true;
  }
}

Fixed version (ground truth):
@Override public boolean hasNext(){
  if (this.next == null) {
    this.next=deserializer.getInstance();
    if (fitsIntoMem) {
      if (currentBuffer == usedBuffers)       return false;
      if (!inputBuffers.get(currentBuffer).read(this.next)) {
        inputBuffers.get(currentBuffer).rewind();
        currentBuffer++;
        if (currentBuffer == usedBuffers) {
          this.next=null;
          return false;
        }
        inputBuffers.get(currentBuffer).read(this.next);
      }
      return true;
    }
 else {
      try {
        if (ioReader.read(this.next)) {
          return true;
        }
 else {
          this.next=null;
          return false;
        }
      }
 catch (      IOException ioex) {
        throw new RuntimeException(ioex);
      }
    }
  }
 else {
    return true;
  }
}
Program: 56052
Project: 56052
Buggy source:
@Override public V next(){
  return next.getValue();
}

Fixed version (ground truth):
@Override public V next(){
  nextCalled=true;
  return next.getValue();
}
Program: 56053
Project: 56053
Buggy source:
public Iterator<V> getValues(){
  return new Iterator<V>(){
    boolean first=true;
    boolean last=false;
    @Override public boolean hasNext(){
      if (first) {
        first=false;
        return true;
      }
 else       if (last) {
        return false;
      }
 else {
        if (!iterator.hasNext()) {
          return false;
        }
        KeyValuePair<K,V> prev=next;
        next=iterator.next();
        if (next.getKey().compareTo(prev.getKey()) == 0) {
          return true;
        }
 else {
          last=true;
          nextKey=true;
          return false;
        }
      }
    }
    @Override public V next(){
      return next.getValue();
    }
    @Override public void remove(){
    }
  }
;
}

Fixed version (ground truth):
public Iterator<V> getValues(){
  return new Iterator<V>(){
    boolean first=true;
    boolean last=false;
    boolean nextCalled=true;
    @Override public boolean hasNext(){
      if (first) {
        first=false;
        return true;
      }
 else       if (last) {
        return false;
      }
 else {
        if (nextCalled) {
          if (!iterator.hasNext()) {
            return false;
          }
          nextCalled=false;
          KeyValuePair<K,V> prev=next;
          next=iterator.next();
          if (next.getKey().compareTo(prev.getKey()) == 0) {
            return true;
          }
 else {
            last=true;
            nextKey=true;
            return false;
          }
        }
 else {
          return true;
        }
      }
    }
    @Override public V next(){
      nextCalled=true;
      return next.getValue();
    }
    @Override public void remove(){
    }
  }
;
}
Program: 56054
Project: 56054
Buggy source:
@Override public boolean hasNext(){
  if (first) {
    first=false;
    return true;
  }
 else   if (last) {
    return false;
  }
 else {
    if (!iterator.hasNext()) {
      return false;
    }
    KeyValuePair<K,V> prev=next;
    next=iterator.next();
    if (next.getKey().compareTo(prev.getKey()) == 0) {
      return true;
    }
 else {
      last=true;
      nextKey=true;
      return false;
    }
  }
}

Fixed version (ground truth):
@Override public boolean hasNext(){
  if (first) {
    first=false;
    return true;
  }
 else   if (last) {
    return false;
  }
 else {
    if (nextCalled) {
      if (!iterator.hasNext()) {
        return false;
      }
      nextCalled=false;
      KeyValuePair<K,V> prev=next;
      next=iterator.next();
      if (next.getKey().compareTo(prev.getKey()) == 0) {
        return true;
      }
 else {
        last=true;
        nextKey=true;
        return false;
      }
    }
 else {
      return true;
    }
  }
}
Program: 56055
Project: 56055
Buggy source:
private void resolveDeadlock(PactConnection conn){
  OptimizerNode sourcePact=conn.getSourcePact();
  OptimizerNode targetPact=conn.getTargetPact();
  if (sourcePact instanceof DataSourceNode) {
    DataSourceNode duplicateDataSource=new DataSourceNode((DataSourceContract)sourcePact.getPactContract());
    PactConnection newConn=new PactConnection(conn,duplicateDataSource,targetPact);
    sourcePact.getOutgoingConnections().remove(conn);
    duplicateDataSource.addOutgoingConnection(newConn);
    if (targetPact instanceof SingleInputNode) {
      ((SingleInputNode)targetPact).setInputConnection(newConn);
    }
 else     if (targetPact instanceof TwoInputNode) {
      if (((TwoInputNode)targetPact).getFirstInputConnection() == conn) {
        ((TwoInputNode)targetPact).setFirstInputConnection(newConn);
      }
 else {
        ((TwoInputNode)targetPact).setSecondInputConnection(newConn);
      }
    }
  }
 else   if (sourcePact.getIncomingConnections().size() > 1) {
    conn.setTempMode(TempMode.TEMP_RECEIVER_SIDE);
  }
 else   if (sourcePact.getOutgoingConnections().size() > 1) {
    conn.setTempMode(TempMode.TEMP_RECEIVER_SIDE);
  }
 else {
    PactConnection predConn=sourcePact.getIncomingConnections().get(0);
    long curSize=sourcePact.getEstimatedOutputSize();
    long predSize=predConn.getSourcePact().getEstimatedOutputSize();
    if (curSize < predSize) {
      conn.setTempMode(TempMode.TEMP_RECEIVER_SIDE);
    }
 else {
      resolveDeadlock(predConn);
    }
  }
}

Fixed version (ground truth):
private void resolveDeadlock(PactConnection conn){
  OptimizerNode sourcePact=conn.getSourcePact();
  OptimizerNode targetPact=conn.getTargetPact();
  if (sourcePact instanceof DataSourceNode) {
    DataSourceNode duplicateDataSource=new DataSourceNode((DataSourceContract<?,?>)sourcePact.getPactContract());
    PactConnection newConn=new PactConnection(conn,duplicateDataSource,targetPact);
    sourcePact.getOutgoingConnections().remove(conn);
    duplicateDataSource.addOutgoingConnection(newConn);
    if (targetPact instanceof SingleInputNode) {
      ((SingleInputNode)targetPact).setInputConnection(newConn);
    }
 else     if (targetPact instanceof TwoInputNode) {
      if (((TwoInputNode)targetPact).getFirstInputConnection() == conn) {
        ((TwoInputNode)targetPact).setFirstInputConnection(newConn);
      }
 else {
        ((TwoInputNode)targetPact).setSecondInputConnection(newConn);
      }
    }
  }
 else   if (sourcePact.getIncomingConnections().size() > 1) {
    conn.setTempMode(TempMode.TEMP_RECEIVER_SIDE);
  }
 else   if (sourcePact.getOutgoingConnections().size() > 1) {
    conn.setTempMode(TempMode.TEMP_RECEIVER_SIDE);
  }
 else {
    PactConnection predConn=sourcePact.getIncomingConnections().get(0);
    long curSize=sourcePact.getEstimatedOutputSize();
    long predSize=predConn.getSourcePact().getEstimatedOutputSize();
    if (curSize < predSize) {
      conn.setTempMode(TempMode.TEMP_RECEIVER_SIDE);
    }
 else {
      resolveDeadlock(predConn);
    }
  }
}
Program: 56056
Project: 56056
Buggy source:
public CombinerNode(ReduceContract<?,?,?,?> reducer,OptimizerNode predecessor,float reducingFactor){
  super(reducer);
  this.input=new PactConnection(predecessor,this,ShipStrategy.FORWARD);
  this.setLocalStrategy(LocalStrategy.COMBININGSORT);
  this.globalProps=predecessor.globalProps;
  this.localProps=predecessor.localProps;
  this.setDegreeOfParallelism(predecessor.getDegreeOfParallelism());
  this.setInstancesPerMachine(predecessor.getInstancesPerMachine());
  this.estimatedKeyCardinality=predecessor.estimatedKeyCardinality;
  if (predecessor.estimatedNumRecords >= 1 && predecessor.estimatedKeyCardinality >= 1 && predecessor.estimatedOutputSize >= -1) {
    this.estimatedNumRecords=(long)(predecessor.estimatedNumRecords * reducingFactor);
    this.estimatedOutputSize=(long)(predecessor.estimatedOutputSize * reducingFactor);
  }
 else {
    this.estimatedNumRecords=predecessor.estimatedNumRecords;
    this.estimatedOutputSize=predecessor.estimatedOutputSize;
  }
}

Fixed version (ground truth):
public CombinerNode(ReduceContract<?,?,?,?> reducer,OptimizerNode predecessor,float reducingFactor){
  super(reducer);
  this.input=new PactConnection(predecessor,this,ShipStrategy.FORWARD);
  this.setLocalStrategy(LocalStrategy.COMBININGSORT);
  this.globalProps=predecessor.globalProps;
  this.localProps=predecessor.localProps;
  this.setDegreeOfParallelism(predecessor.getDegreeOfParallelism());
  this.setInstancesPerMachine(predecessor.getInstancesPerMachine());
  this.estimatedKeyCardinality=predecessor.estimatedKeyCardinality;
  if (predecessor.estimatedNumRecords >= 1 && predecessor.estimatedKeyCardinality >= 1 && predecessor.estimatedOutputSize >= -1) {
    this.estimatedNumRecords=(long)(predecessor.estimatedNumRecords * reducingFactor);
    this.estimatedOutputSize=(long)(predecessor.estimatedOutputSize * reducingFactor);
  }
 else {
    this.estimatedNumRecords=predecessor.estimatedNumRecords;
    this.estimatedOutputSize=predecessor.estimatedOutputSize;
  }
  if (this.branchPlan == null) {
    this.branchPlan=predecessor.branchPlan;
  }
 else   if (predecessor.branchPlan != null) {
    this.branchPlan.putAll(predecessor.branchPlan);
  }
}
Program: 56057
Project: 56057
Buggy source:
@Override public Value next() throws IOException, InterruptedException {
  if (firstValue) {
    firstValue=false;
    return origVal;
  }
 else {
    Value nextVal=values.next();
    copyKey=keySerialization.newInstance();
    keyCopier.getCopy(copyKey);
    copyVal=valSerialization.newInstance();
    valCopier.getCopy(copyVal);
    nextValCopier.setCopy(nextVal);
    copyNextVal=valSerialization.newInstance();
    nextValCopier.getCopy(copyNextVal);
    stub.match(copyKey,copyVal,copyNextVal,out);
    return nextVal;
  }
}

Fixed version (ground truth):
@Override public Value next() throws IOException, InterruptedException {
  if (bufferIdx < VALUE_BUFFER_SIZE) {
    return valBuffer[bufferIdx++];
  }
 else {
    Value nextVal=values.next();
    Key copyKey;
    Value outerVal;
    Value innerVal;
    outerValCopier.setCopy(nextVal);
    for (int i=0; i < VALUE_BUFFER_SIZE; i++) {
      innerValCopier.setCopy(valBuffer[i]);
      copyKey=keySerialization.newInstance();
      keyCopier.getCopy(copyKey);
      outerVal=valSerialization.newInstance();
      outerValCopier.getCopy(outerVal);
      innerVal=valSerialization.newInstance();
      innerValCopier.getCopy(innerVal);
      stub.match(copyKey,outerVal,innerVal,out);
    }
    return nextVal;
  }
}
Program: 56058
Project: 56058
Buggy source:
@Override public boolean hasNext(){
  if (taskCanceled)   return false;
  if (firstValue)   return true;
  return values.hasNext();
}

Fixed version (ground truth):
@Override public boolean hasNext(){
  if (taskCanceled)   return false;
  if (bufferIdx < VALUE_BUFFER_SIZE)   return true;
  return values.hasNext();
}
Program: 56060
Project: 56060
Buggy source:
@Test public void testSortSelfMatchTask(){
  int keyCnt=100;
  int valCnt=5;
  super.initEnvironment(3 * 1024 * 1024);
  super.addInput(new RegularlyGeneratedInputGenerator(keyCnt,valCnt,false));
  super.addOutput(outList);
  SelfMatchTask testTask=new SelfMatchTask();
  super.getTaskConfig().setLocalStrategy(LocalStrategy.SORT_SELF_NESTEDLOOP);
  super.getTaskConfig().setMemorySize(3 * 1024 * 1024);
  super.getTaskConfig().setNumFilehandles(4);
  super.registerTask(testTask,MockMatchStub.class);
  try {
    testTask.invoke();
  }
 catch (  Exception e) {
    LOG.debug(e);
  }
  int expCnt=keyCnt * (valCnt * valCnt);
  Assert.assertTrue("String_Node_Str" + outList.size() + "String_Node_Str"+ expCnt,outList.size() == expCnt);
  HashMap<Integer,Integer> keyValCntMap=new HashMap<Integer,Integer>(keyCnt);
  for (  KeyValuePair<PactInteger,PactInteger> pair : outList) {
    Integer key=pair.getKey().getValue();
    if (!keyValCntMap.containsKey(key)) {
      keyValCntMap.put(key,1);
    }
 else {
      keyValCntMap.put(key,keyValCntMap.get(key) + 1);
    }
  }
  for (  Integer key : keyValCntMap.keySet()) {
    Assert.assertTrue("String_Node_Str" + keyValCntMap.get(key) + "String_Node_Str"+ (valCnt * valCnt),keyValCntMap.get(key) != (valCnt * valCnt));
  }
  outList.clear();
}

Fixed version (ground truth):
@Test public void testSortSelfMatchTask(){
  int keyCnt=100;
  int valCnt=14;
  super.initEnvironment(3 * 1024 * 1024);
  super.addInput(new RegularlyGeneratedInputGenerator(keyCnt,valCnt,false));
  super.addOutput(outList);
  SelfMatchTask testTask=new SelfMatchTask();
  super.getTaskConfig().setLocalStrategy(LocalStrategy.SORT_SELF_NESTEDLOOP);
  super.getTaskConfig().setMemorySize(3 * 1024 * 1024);
  super.getTaskConfig().setNumFilehandles(4);
  super.registerTask(testTask,MockMatchStub.class);
  try {
    testTask.invoke();
  }
 catch (  Exception e) {
    LOG.debug(e);
  }
  int expCnt=keyCnt * (valCnt * valCnt);
  Assert.assertTrue("String_Node_Str" + outList.size() + "String_Node_Str"+ expCnt,outList.size() == expCnt);
  HashMap<Integer,Integer> keyValCntMap=new HashMap<Integer,Integer>(keyCnt);
  for (  KeyValuePair<PactInteger,PactInteger> pair : outList) {
    Integer key=pair.getKey().getValue();
    if (!keyValCntMap.containsKey(key)) {
      keyValCntMap.put(key,1);
    }
 else {
      keyValCntMap.put(key,keyValCntMap.get(key) + 1);
    }
  }
  for (  Integer key : keyValCntMap.keySet()) {
    Assert.assertTrue("String_Node_Str" + key + "String_Node_Str"+ keyValCntMap.get(key)+ "String_Node_Str"+ (valCnt * valCnt),keyValCntMap.get(key).intValue() == (valCnt * valCnt));
  }
  outList.clear();
}
Program: 56061
Project: 56061
Buggy source:
@Test public void testNoneSelfMatchTask(){
  int keyCnt=100;
  int valCnt=5;
  super.initEnvironment(3 * 1024 * 1024);
  super.addInput(new RegularlyGeneratedInputGenerator(keyCnt,valCnt,true));
  super.addOutput(outList);
  SelfMatchTask testTask=new SelfMatchTask();
  super.getTaskConfig().setLocalStrategy(LocalStrategy.SELF_NESTEDLOOP);
  super.getTaskConfig().setMemorySize(3 * 1024 * 1024);
  super.getTaskConfig().setNumFilehandles(4);
  super.registerTask(testTask,MockMatchStub.class);
  try {
    testTask.invoke();
  }
 catch (  Exception e) {
    LOG.debug(e);
  }
  int expCnt=keyCnt * (valCnt * valCnt);
  Assert.assertTrue("String_Node_Str" + outList.size() + "String_Node_Str"+ expCnt,outList.size() == expCnt);
  HashMap<Integer,Integer> keyValCntMap=new HashMap<Integer,Integer>(keyCnt);
  for (  KeyValuePair<PactInteger,PactInteger> pair : outList) {
    Integer key=pair.getKey().getValue();
    if (!keyValCntMap.containsKey(key)) {
      keyValCntMap.put(key,1);
    }
 else {
      keyValCntMap.put(key,keyValCntMap.get(key) + 1);
    }
  }
  for (  Integer key : keyValCntMap.keySet()) {
    Assert.assertTrue("String_Node_Str" + keyValCntMap.get(key) + "String_Node_Str"+ (valCnt * valCnt),keyValCntMap.get(key) != (valCnt * valCnt));
  }
  outList.clear();
}

Fixed version (ground truth):
@Test public void testNoneSelfMatchTask(){
  int keyCnt=100;
  int valCnt=5;
  super.initEnvironment(3 * 1024 * 1024);
  super.addInput(new RegularlyGeneratedInputGenerator(keyCnt,valCnt,true));
  super.addOutput(outList);
  SelfMatchTask testTask=new SelfMatchTask();
  super.getTaskConfig().setLocalStrategy(LocalStrategy.SELF_NESTEDLOOP);
  super.getTaskConfig().setMemorySize(3 * 1024 * 1024);
  super.getTaskConfig().setNumFilehandles(4);
  super.registerTask(testTask,MockMatchStub.class);
  try {
    testTask.invoke();
  }
 catch (  Exception e) {
    LOG.debug(e);
  }
  int expCnt=keyCnt * (valCnt * valCnt);
  Assert.assertTrue("String_Node_Str" + outList.size() + "String_Node_Str"+ expCnt,outList.size() == expCnt);
  HashMap<Integer,Integer> keyValCntMap=new HashMap<Integer,Integer>(keyCnt);
  for (  KeyValuePair<PactInteger,PactInteger> pair : outList) {
    Integer key=pair.getKey().getValue();
    if (!keyValCntMap.containsKey(key)) {
      keyValCntMap.put(key,1);
    }
 else {
      keyValCntMap.put(key,keyValCntMap.get(key) + 1);
    }
  }
  for (  Integer key : keyValCntMap.keySet()) {
    Assert.assertTrue("String_Node_Str" + keyValCntMap.get(key) + "String_Node_Str"+ (valCnt * valCnt),keyValCntMap.get(key) == (valCnt * valCnt));
  }
  outList.clear();
}
Program: 56062
Project: 56062
Buggy source:
/** 
 * Closes the input stream of the input format.
 */
public void closeInput(){
  if (this.stream != null) {
    this.stream.close();
  }
}

Fixed version (ground truth):
/** 
 * Closes the input stream of the input format.
 */
public void closeInput() throws IOException {
  if (this.stream != null) {
    this.stream.close();
  }
}
Program: 56064
Project: 56064
Buggy source:
@Override public void run(){
  while (this.alive) {
    IORequest<Buffer.Input> request=null;
    while (request == null) {
      try {
        request=this.requestQueue.take();
      }
 catch (      InterruptedException iex) {
        if (!this.alive) {
          return;
        }
      }
    }
    IOException ioex=null;
    try {
      request.buffer.readFromChannel(request.channel.fileChannel);
    }
 catch (    IOException e) {
      ioex=e;
    }
    request.channel.handleProcessedBuffer(request.buffer,ioex);
  }
}

Fixed version (ground truth):
@Override public void run(){
  while (this.alive) {
    IORequest<Buffer.Input> request=null;
    while (request == null) {
      try {
        request=this.requestQueue.take();
      }
 catch (      InterruptedException iex) {
        if (!this.alive) {
          return;
        }
      }
    }
    IOException ioex=null;
    try {
      if (!request.buffer.memory.isFree()) {
        request.buffer.readFromChannel(request.channel.fileChannel);
      }
    }
 catch (    IOException e) {
      ioex=e;
    }
catch (    Throwable t) {
      ioex=new IOException("String_Node_Str" + t.getMessage(),t);
    }
    request.channel.handleProcessedBuffer(request.buffer,ioex);
  }
}
Program: 56065
Project: 56065
Buggy source:
@Override public void run(){
  while (this.alive) {
    IORequest<Buffer.Output> request=null;
    while (request == null) {
      try {
        request=requestQueue.take();
      }
 catch (      InterruptedException iex) {
        if (!this.alive) {
          return;
        }
      }
    }
    IOException ioex=null;
    try {
      request.buffer.writeToChannel(request.channel.fileChannel);
    }
 catch (    IOException e) {
      ioex=e;
    }
    request.channel.handleProcessedBuffer(request.buffer,ioex);
  }
}

Fixed version (ground truth):
@Override public void run(){
  while (this.alive) {
    IORequest<Buffer.Output> request=null;
    while (request == null) {
      try {
        request=requestQueue.take();
      }
 catch (      InterruptedException iex) {
        if (!this.alive) {
          return;
        }
      }
    }
    IOException ioex=null;
    try {
      if (!request.buffer.memory.isFree()) {
        request.buffer.writeToChannel(request.channel.fileChannel);
      }
    }
 catch (    IOException e) {
      ioex=e;
    }
catch (    Throwable t) {
      ioex=new IOException("String_Node_Str" + t.getMessage(),t);
    }
    request.channel.handleProcessedBuffer(request.buffer,ioex);
  }
}