nus-yam/ex-repair huggingface dataset:
Program: 55871
Project: 55871
Buggy source:
/** 
 * @param 
 */
public void clear(ChannelID channelID){
  ByteBufferedChannelWrapper wrapper=this.registeredChannels.get(channelID);
  wrapper.clear();
}

Fixed version (ground truth):
/** 
 * @param 
 */
public void clear(ChannelID channelID){
  ByteBufferedChannelWrapper wrapper=this.registeredChannels.get(channelID);
  wrapper.clear();
  this.incomingConnectionThread.clear();
}
Program: 55872
Project: 55872
Buggy source:
/** 
 * @param byteBufferedChannelManager
 * @param fileInputChannel
 * @param sourceChannelID 
 * @return CheckpointOutgoingConnection
 */
public CheckpointOutgoingConnection createOutgoingCheckpointConnection(ByteBufferedChannelManager byteBufferedChannelManager,FileChannel fileInputChannel,ChannelID sourceChannelID){
  try {
    final InetSocketAddress connectionAddress=getPeerConnectionAddress(sourceChannelID);
    OutgoingConnectionThread connectionThread=new OutgoingConnectionThread();
    CheckpointOutgoingConnection outgoingConnection=new CheckpointOutgoingConnection(this,connectionAddress,connectionThread,10,fileInputChannel);
    this.outgoingConnections.put(connectionAddress,outgoingConnection);
    return outgoingConnection;
  }
 catch (  InterruptedException e) {
    e.printStackTrace();
  }
catch (  IOException e) {
    e.printStackTrace();
  }
  return null;
}

Fixed version (ground truth):
/** 
 * @param byteBufferedChannelManager
 * @param fileInputChannel
 * @param sourceChannelID 
 * @param address 
 * @return CheckpointOutgoingConnection
 */
public CheckpointOutgoingConnection createOutgoingCheckpointConnection(ByteBufferedChannelManager byteBufferedChannelManager,FileChannel fileInputChannel,ChannelID sourceChannelID){
  try {
    final InetSocketAddress connectionAddress=getPeerConnectionAddress(sourceChannelID);
    OutgoingConnectionThread connectionThread=new OutgoingConnectionThread();
    connectionThread.start();
    CheckpointOutgoingConnection outgoingConnection=new CheckpointOutgoingConnection(this,connectionAddress,connectionThread,10,fileInputChannel);
    this.outgoingConnections.put(connectionAddress,outgoingConnection);
    return outgoingConnection;
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
catch (  InterruptedException e) {
    e.printStackTrace();
  }
  return null;
}
Program: 55873
Project: 55873
Buggy source:
public void clear(){
  releaseAllResources();
  this.nextExpectedSequenceNumber=0;
}

Fixed version (ground truth):
public void clear(){
  releaseAllResources();
  this.nextExpectedSequenceNumber=0;
  this.byteBufferedInputChannel.clear();
}
Program: 55875
Project: 55875
Buggy source:
public void clear(){
  if (this.outgoingTransferEnvelope != null) {
    this.outgoingTransferEnvelope.getProcessingLog().setSentViaNetwork();
    this.outgoingTransferEnvelope=null;
  }
  this.sequenceNumber=0;
  if (this.uncompressedDataBuffer != null) {
    this.uncompressedDataBuffer.recycleBuffer();
  }
}

Fixed version (ground truth):
public void clear(){
  if (this.outgoingTransferEnvelope != null) {
    this.outgoingTransferEnvelope.getProcessingLog().setSentViaNetwork();
    this.outgoingTransferEnvelope=null;
  }
  this.sequenceNumber=0;
  if (this.uncompressedDataBuffer != null) {
    this.uncompressedDataBuffer.getInternalBuffer().recycleBuffer();
  }
}
Program: 55876
Project: 55876
Buggy source:
private long byteBufferToLong(final ByteBuffer byteBuffer) throws IOException {
  long l=0;
  if (SIZEOFLONG > byteBuffer.limit()) {
    throw new IOException("String_Node_Str" + byteBuffer.limit() + "String_Node_Str");
  }
  for (int i=0; i < SIZEOFLONG; ++i) {
    l|=(byteBuffer.get((SIZEOFLONG - 1) - i) & 0xff) << (i << 3);
  }
  return l;
}

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

Fixed version (ground truth):
private void longToByteBuffer(long longToSerialize,ByteBuffer byteBuffer) throws IOException {
  if (SIZEOFLONG > byteBuffer.capacity()) {
    throw new IOException("String_Node_Str" + byteBuffer.limit() + "String_Node_Str"+ SIZEOFLONG+ "String_Node_Str");
  }
  byteBuffer.limit(SIZEOFLONG);
  for (int i=0; i < SIZEOFLONG; ++i) {
    final int shift=i << 3;
    byteBuffer.put((SIZEOFLONG - 1) - i,(byte)((longToSerialize & (0xffL << shift)) >>> shift));
  }
}
Program: 55878
Project: 55878
Buggy source:
/** 
 * Checks whether there is a floating instance with the specific type. If there are instances available, they will be removed from the list and returned...
 * @param awsAccessId the access ID into AWS
 * @param awsSecretKey the secret key used to generate signatures for authentication
 * @param type the type of the floating instance, which is checked
 * @return a list of suitable floating instances.
 * @throws InstanceException something wrong happens to the global configuration
 */
private LinkedList<FloatingInstance> anyFloatingInstancesAvailable(final String awsAccessId,final String awsSecretKey,final InstanceType type,final int count) throws InstanceException {
  LOG.info("String_Node_Str" + count + "String_Node_Str"+ type.getIdentifier());
  final LinkedList<FloatingInstance> foundfloatinginstances=new LinkedList<FloatingInstance>();
synchronized (this.floatingInstances) {
    final Iterator<Map.Entry<InstanceConnectionInfo,FloatingInstance>> it=this.floatingInstances.entrySet().iterator();
    while (it.hasNext()) {
      final FloatingInstance i=it.next().getValue();
      if (i.isFromThisOwner(awsAccessId,awsSecretKey)) {
        if (i.getType().equals(type)) {
          it.remove();
          foundfloatinginstances.add(i);
        }
      }
    }
  }
  LOG.info("String_Node_Str" + foundfloatinginstances.size() + "String_Node_Str");
  return foundfloatinginstances;
}

Fixed version (ground truth):
/** 
 * Checks whether there is a floating instance with the specific type. If there are instances available, they will be removed from the list and returned...
 * @param awsAccessId the access ID into AWS
 * @param awsSecretKey the secret key used to generate signatures for authentication
 * @param type the type of the floating instance, which is checked
 * @return a list of suitable floating instances.
 * @throws InstanceException something wrong happens to the global configuration
 */
private LinkedList<FloatingInstance> anyFloatingInstancesAvailable(final String awsAccessId,final String awsSecretKey,final InstanceType type,final int count) throws InstanceException {
  LOG.info("String_Node_Str" + count + "String_Node_Str"+ type.getIdentifier());
  final LinkedList<FloatingInstance> foundfloatinginstances=new LinkedList<FloatingInstance>();
synchronized (this.floatingInstances) {
    final Iterator<Map.Entry<InstanceConnectionInfo,FloatingInstance>> it=this.floatingInstances.entrySet().iterator();
    while (it.hasNext()) {
      final FloatingInstance i=it.next().getValue();
      if (i.isFromThisOwner(awsAccessId,awsSecretKey)) {
        if (i.getType().equals(type)) {
          it.remove();
          foundfloatinginstances.add(i);
          if (foundfloatinginstances.size() >= count) {
            break;
          }
        }
      }
    }
  }
  LOG.info("String_Node_Str" + foundfloatinginstances.size() + "String_Node_Str");
  return foundfloatinginstances;
}
Program: 55879
Project: 55879
Buggy source:
/** 
 * @param pair
 * @param hashCode
 * @throws IOException
 */
protected final void insertIntoTable(final PactRecord record,final int hashCode) throws IOException {
  final int posHashCode=hashCode % this.numBuckets;
  final int bucketArrayPos=posHashCode >> this.bucketsPerSegmentBits;
  final int bucketInSegmentPos=(posHashCode & this.bucketsPerSegmentMask) << NUM_INTRA_BUCKET_BITS;
  final MemorySegment bucket=this.buckets[bucketArrayPos];
  final int partitionNumber=bucket.get(bucketInSegmentPos + HEADER_PARTITION_OFFSET);
  if (partitionNumber < 0 || partitionNumber >= this.partitionsBeingBuilt.size()) {
    throw new RuntimeException("String_Node_Str");
  }
  final Partition p=this.partitionsBeingBuilt.get(partitionNumber);
  long pointer=p.insertIntoBuildBuffer(record);
  if (pointer == -1) {
    MemorySegment nextSeg=getNextBuffer();
    if (nextSeg == null) {
      spillPartition();
      nextSeg=getNextBuffer();
      if (nextSeg == null) {
        throw new RuntimeException("String_Node_Str");
      }
    }
    p.addBuildSideBuffer(nextSeg);
    pointer=p.insertIntoBuildBuffer(record);
    if (pointer == -1) {
      throw new IOException("String_Node_Str");
    }
  }
  if (p.isInMemory()) {
    insertBucketEntry(p,bucket,bucketInSegmentPos,hashCode,pointer);
  }
 else {
    return;
  }
}

Fixed version (ground truth):
/** 
 * @param pair
 * @param hashCode
 * @throws IOException
 */
protected final void insertIntoTable(final PactRecord record,final int hashCode) throws IOException {
  final int posHashCode=hashCode % this.numBuckets;
  final int bucketArrayPos=posHashCode >> this.bucketsPerSegmentBits;
  final int bucketInSegmentPos=(posHashCode & this.bucketsPerSegmentMask) << NUM_INTRA_BUCKET_BITS;
  final MemorySegment bucket=this.buckets[bucketArrayPos];
  final int partitionNumber=bucket.get(bucketInSegmentPos + HEADER_PARTITION_OFFSET);
  if (partitionNumber < 0 || partitionNumber >= this.partitionsBeingBuilt.size()) {
    throw new RuntimeException("String_Node_Str");
  }
  final Partition p=this.partitionsBeingBuilt.get(partitionNumber);
  long pointer=p.insertIntoBuildBuffer(record);
  if (pointer == -1) {
    MemorySegment nextSeg=getNextBuffer();
    if (nextSeg == null) {
      int spilledPartitionNum=spillPartition();
      if (spilledPartitionNum != partitionNumber) {
        nextSeg=getNextBuffer();
        if (nextSeg == null) {
          throw new RuntimeException("String_Node_Str");
        }
        p.addBuildSideBuffer(nextSeg);
      }
    }
 else {
      p.addBuildSideBuffer(nextSeg);
    }
    pointer=p.insertIntoBuildBuffer(record);
    if (pointer == -1) {
      throw new IOException("String_Node_Str");
    }
  }
  if (p.isInMemory()) {
    insertBucketEntry(p,bucket,bucketInSegmentPos,hashCode,pointer);
  }
 else {
    return;
  }
}
Program: 55880
Project: 55880
Buggy source:
/** 
 * Initializes the PactString to a sub-string of the given PactString. 
 * @param value The string containing the substring.
 * @param offset The offset of the substring.
 * @param len The length of the substring.
 */
public PactString(final PactString value,final int offset,final int len){
  setValue(value,offset,len);
}

Fixed version (ground truth):
/** 
 * Initializes the PactString to a sub-string of the given PactString. 
 * @param value The string containing the substring.
 * @param offset The offset of the substring.
 * @param len The length of the substring.
 */
public PactString(final PactString value,final int offset,final int len){
  this.value=EMPTY_STRING;
  setValue(value,offset,len);
}
Program: 55881
Project: 55881
Buggy source:
/** 
 * Writes this buffer completely to the given writer.
 * @param writer The writer to write the segment to.
 * @throws IOException Thrown, if the writer caused an I/O exception.
 */
public void writeToChannel(final Writer writer) throws IOException {
  int recordsLeft=this.numRecords;
  int currentMemSeg=0;
  while (recordsLeft > 0) {
    final MemorySegment currentIndexSegment=this.sortIndex.get(currentMemSeg++);
    int offset=0;
    if (recordsLeft >= this.indexEntriesPerSegment) {
      for (; offset <= this.lastIndexEntryOffset; offset+=this.indexEntrySize) {
        final long pointer=currentIndexSegment.getLong(offset);
      }
      recordsLeft-=this.indexEntriesPerSegment;
    }
 else {
      for (; recordsLeft > 0; recordsLeft--, offset+=this.indexEntrySize) {
        final long pointer=currentIndexSegment.getLong(offset);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Writes this buffer completely to the given writer.
 * @param writer The writer to write the segment to.
 * @throws IOException Thrown, if the writer caused an I/O exception.
 */
public void writeToChannel(final Writer writer) throws IOException {
  throw new UnsupportedOperationException();
}
Program: 55882
Project: 55882
Buggy source:
public void setKey(int key){
  this.key=key;
}

Fixed version (ground truth):
public void setKey(int key){
  setValue(key);
}
Program: 55883
Project: 55883
Buggy source:
public int getKey(){
  return key;
}

Fixed version (ground truth):
public int getKey(){
  return getValue();
}
Program: 55884
Project: 55884
Buggy source:
public Key(int k){
  key=k;
}

Fixed version (ground truth):
public Key(int k){
  super(k);
}
Program: 55885
Project: 55885
Buggy source:
public int compare(int i,int j){
  final int bufferNumI=i / this.indexEntriesPerSegment;
  final int segmentOffsetI=(i % this.indexEntriesPerSegment) * this.indexEntrySize;
  final int bufferNumJ=j / this.indexEntriesPerSegment;
  final int segmentOffsetJ=(j % this.indexEntriesPerSegment) * this.indexEntrySize;
  final MemorySegment segI=this.sortIndex.get(bufferNumI);
  final MemorySegment segJ=this.sortIndex.get(bufferNumJ);
  final byte[] bI=segI.getBackingArray();
  final byte[] bJ=segJ.getBackingArray();
  int val=0;
  for (int pos=0, posI=segI.translateOffset(segmentOffsetI + OFFSET_LEN), posJ=segJ.translateOffset(segmentOffsetJ + OFFSET_LEN); pos < this.numKeyBytes & (val=(bI[posI] & 0xff) - (bJ[posJ] & 0xff)) == 0; pos++, posI++, posJ++)   ;
  if (val != 0 || this.normalizedKeyFullyDetermines) {
    return val;
  }
  final long pointerI=segI.getLong(segmentOffsetI);
  final long pointerJ=segJ.getLong(segmentOffsetJ);
  return compareRecords(pointerI,pointerJ);
}

Fixed version (ground truth):
public int compare(int i,int j){
  final int bufferNumI=i / this.indexEntriesPerSegment;
  final int segmentOffsetI=(i % this.indexEntriesPerSegment) * this.indexEntrySize;
  final int bufferNumJ=j / this.indexEntriesPerSegment;
  final int segmentOffsetJ=(j % this.indexEntriesPerSegment) * this.indexEntrySize;
  final MemorySegment segI=this.sortIndex.get(bufferNumI);
  final MemorySegment segJ=this.sortIndex.get(bufferNumJ);
  final byte[] bI=segI.getBackingArray();
  final byte[] bJ=segJ.getBackingArray();
  int val=0;
  for (int pos=0, posI=segI.translateOffset(segmentOffsetI + OFFSET_LEN), posJ=segJ.translateOffset(segmentOffsetJ + OFFSET_LEN); pos < this.numKeyBytes && (val=(bI[posI] & 0xff) - (bJ[posJ] & 0xff)) == 0; pos++, posI++, posJ++)   ;
  if (val != 0 || this.normalizedKeyFullyDetermines) {
    return val;
  }
  final long pointerI=segI.getLong(segmentOffsetI);
  final long pointerJ=segJ.getLong(segmentOffsetJ);
  return compareRecords(pointerI,pointerJ);
}
Program: 55886
Project: 55886
Buggy source:
public List<MemorySegment> dispose(){
  this.freeMemory.addAll(this.sortIndex);
  this.freeMemory.addAll(this.recordBuffers);
  this.recordBuffers.clear();
  this.sortIndex.clear();
  return this.freeMemory;
}

Fixed version (ground truth):
/** 
 * Collects all memory segments from this sorter.
 * @return All memory segments from this sorter.
 */
public List<MemorySegment> dispose(){
  this.freeMemory.addAll(this.sortIndex);
  this.freeMemory.addAll(this.recordBuffers);
  this.recordBuffers.clear();
  this.sortIndex.clear();
  return this.freeMemory;
}
Program: 55887
Project: 55887
Buggy source:
@Test public void testSort() throws Exception {
  final int numSegments=MEMORY_SIZE / MEMORY_SEGMENT_SIZE;
  final List<MemorySegment> memory=this.memoryManager.allocate(new DummyInvokable(),numSegments,MEMORY_SEGMENT_SIZE);
  NormalizedKeySorter<PactRecord> sorter=newSortBuffer(memory);
  TestData.Generator generator=new TestData.Generator(SEED,KEY_MAX,VALUE_LENGTH,KeyMode.RANDOM,ValueMode.RANDOM_LENGTH);
  long writeStart=System.nanoTime();
  PactRecord record=new PactRecord();
  do {
    generator.next(record);
  }
 while (sorter.write(record));
  long writeStop=System.nanoTime();
  System.out.println("String_Node_Str" + (writeStop - writeStart) / 1000000 + "String_Node_Str");
  long sortStart=System.nanoTime();
  QuickSort qs=new QuickSort();
  qs.sort(sorter);
  long sortStop=System.nanoTime();
  System.out.println("String_Node_Str" + (sortStop - sortStart) / 1000000 + "String_Node_Str");
  MutableObjectIterator<PactRecord> iter=sorter.getIterator();
  PactRecord readTarget=new PactRecord();
  Key current=new Key();
  Key last=new Key();
  iter.next(readTarget);
  readTarget.getFieldInto(0,last);
  while (iter.next(readTarget)) {
    readTarget.getFieldInto(0,current);
    final int cmp=last.compareTo(current);
    if (cmp > 0)     Assert.fail("String_Node_Str");
    Key tmp=current;
    current=last;
    last=tmp;
  }
  this.memoryManager.release(sorter.dispose());
}

Fixed version (ground truth):
@Test public void testSort() throws Exception {
  final int numSegments=MEMORY_SIZE / MEMORY_SEGMENT_SIZE;
  final List<MemorySegment> memory=this.memoryManager.allocate(new DummyInvokable(),numSegments,MEMORY_SEGMENT_SIZE);
  NormalizedKeySorter<PactRecord> sorter=newSortBuffer(memory);
  TestData.Generator generator=new TestData.Generator(SEED,KEY_MAX,VALUE_LENGTH,KeyMode.RANDOM,ValueMode.RANDOM_LENGTH);
  PactRecord record=new PactRecord();
  do {
    generator.next(record);
  }
 while (sorter.write(record));
  QuickSort qs=new QuickSort();
  qs.sort(sorter);
  MutableObjectIterator<PactRecord> iter=sorter.getIterator();
  PactRecord readTarget=new PactRecord();
  Key current=new Key();
  Key last=new Key();
  iter.next(readTarget);
  readTarget.getFieldInto(0,last);
  while (iter.next(readTarget)) {
    readTarget.getFieldInto(0,current);
    final int cmp=last.compareTo(current);
    if (cmp > 0)     Assert.fail("String_Node_Str");
    Key tmp=current;
    current=last;
    last=tmp;
  }
  this.memoryManager.release(sorter.dispose());
}
Program: 55890
Project: 55890
Buggy source:
@Override public void reportPersistenCheckpoint(ExecutionVertexID executionVertexID,JobID jobID){
}

Fixed version (ground truth):
@Override public void reportPersistenCheckpoint(ExecutionVertexID executionVertexID,JobID jobID){
  getExecutionGraphByID(jobID).getVertexByID(executionVertexID).setCheckpoint();
}
Program: 55891
Project: 55891
Buggy source:
@Override public void reportPersistenCheckpoint(ExecutionVertexID executionVertexID,JobID jobID){
}

Fixed version (ground truth):
@Override public void reportPersistenCheckpoint(ExecutionVertexID executionVertexID,JobID jobID){
  this.scheduler.reportPersistenCheckpoint(executionVertexID,jobID);
}
Program: 55892
Project: 55892
Buggy source:
@Override public void reportPersistenCheckpoint(ExecutionVertexID executionVertexID,JobID jobID){
}

Fixed version (ground truth):
@Override public void reportPersistenCheckpoint(ExecutionVertexID executionVertexID,JobID jobID){
  getExecutionGraphByID(jobID).getVertexByID(executionVertexID).setCheckpoint();
}
Program: 55894
Project: 55894
Buggy source:
/** 
 * Sets the maximum number of members this group vertex can have.
 * @param maxSize the maximum number of members this group vertex can have
 */
void setMaxMemberSize(final int maxSize){
  if (maxSize < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.maxMemberSize=maxSize;
}

Fixed version (ground truth):
/** 
 * Sets the maximum number of members this group vertex can have.
 * @param maxSize the maximum number of members this group vertex can have
 */
void setMaxMemberSize(final int maxSize){
  this.maxMemberSize=maxSize;
}
Program: 55895
Project: 55895
Buggy source:
/** 
 * Sets the minimum number of members this group vertex must have.
 * @param minSize the minimum number of members this group vertex must have
 */
void setMinMemberSize(final int minSize){
  if (minSize < 0) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  this.minMemberSize=minSize;
}

Fixed version (ground truth):
/** 
 * Sets the minimum number of members this group vertex must have.
 * @param minSize the minimum number of members this group vertex must have
 */
void setMinMemberSize(final int minSize){
  this.minMemberSize=minSize;
}
Program: 55896
Project: 55896
Buggy source:
/** 
 * Cancels and removes the task represented by this vertex from the instance it is currently running on. If the task is not currently running, its execution state is simply updated to <code>CANCELLED</code>.
 * @return the result of the task cancel attempt
 */
public TaskCancelResult cancelTask(){
  if (this.groupVertex.getStageNumber() != this.executionGraph.getIndexOfCurrentExecutionStage()) {
    updateExecutionState(ExecutionState.CANCELED,null);
    return new TaskCancelResult(getID(),AbstractTaskResult.ReturnCode.SUCCESS);
  }
  if (this.executionState == ExecutionState.FINISHED || this.executionState == ExecutionState.FAILED) {
    return new TaskCancelResult(getID(),AbstractTaskResult.ReturnCode.SUCCESS);
  }
  if (this.executionState != ExecutionState.RUNNING && this.executionState != ExecutionState.FINISHING) {
    updateExecutionState(ExecutionState.CANCELED,null);
    return new TaskCancelResult(getID(),AbstractTaskResult.ReturnCode.SUCCESS);
  }
  if (this.allocatedResource == null) {
    final TaskCancelResult result=new TaskCancelResult(getID(),AbstractTaskResult.ReturnCode.ERROR);
    result.setDescription("String_Node_Str" + this.toString() + "String_Node_Str");
    return result;
  }
  try {
    return this.allocatedResource.getInstance().cancelTask(this.vertexID);
  }
 catch (  IOException e) {
    final TaskCancelResult result=new TaskCancelResult(getID(),AbstractTaskResult.ReturnCode.ERROR);
    result.setDescription(StringUtils.stringifyException(e));
    return result;
  }
}

Fixed version (ground truth):
/** 
 * Cancels and removes the task represented by this vertex from the instance it is currently running on. If the task is not currently running, its execution state is simply updated to <code>CANCELLED</code>.
 * @return the result of the task cancel attempt
 */
public TaskCancelResult cancelTask(){
  if (this.groupVertex.getStageNumber() != this.executionGraph.getIndexOfCurrentExecutionStage()) {
    updateExecutionState(ExecutionState.CANCELED,null);
    return new TaskCancelResult(getID(),AbstractTaskResult.ReturnCode.SUCCESS);
  }
  if (this.executionState == ExecutionState.FINISHED || this.executionState == ExecutionState.FAILED) {
    return new TaskCancelResult(getID(),AbstractTaskResult.ReturnCode.SUCCESS);
  }
  if (this.executionState != ExecutionState.RUNNING && this.executionState != ExecutionState.STARTING && this.executionState != ExecutionState.FINISHING) {
    updateExecutionState(ExecutionState.CANCELED,null);
    return new TaskCancelResult(getID(),AbstractTaskResult.ReturnCode.SUCCESS);
  }
  if (this.allocatedResource == null) {
    final TaskCancelResult result=new TaskCancelResult(getID(),AbstractTaskResult.ReturnCode.ERROR);
    result.setDescription("String_Node_Str" + this.toString() + "String_Node_Str");
    return result;
  }
  try {
    return this.allocatedResource.getInstance().cancelTask(this.vertexID);
  }
 catch (  IOException e) {
    final TaskCancelResult result=new TaskCancelResult(getID(),AbstractTaskResult.ReturnCode.ERROR);
    result.setDescription(StringUtils.stringifyException(e));
    return result;
  }
}
Program: 55897
Project: 55897
Buggy source:
private void reassignGraphFragment(final ExecutionVertex vertex,final AllocatedResource oldResource,final AllocatedResource newResource){
  if (oldResource.equals(vertex.getAllocatedResource())) {
    vertex.setAllocatedResource(newResource);
    if (vertex.getExecutionState() == ExecutionState.SCHEDULED) {
      vertex.updateExecutionState(ExecutionState.ASSIGNED);
    }
    final int numberOfOutputGates=vertex.getEnvironment().getNumberOfOutputGates();
    for (int i=0; i < numberOfOutputGates; ++i) {
      final OutputGate<? extends Record> outputGate=vertex.getEnvironment().getOutputGate(i);
      if (outputGate.getChannelType() == ChannelType.NETWORK) {
        continue;
      }
      final int numberOfOutputChannels=outputGate.getNumberOfOutputChannels();
      for (int j=0; j < numberOfOutputChannels; ++j) {
        final AbstractOutputChannel<? extends Record> outputChannel=outputGate.getOutputChannel(j);
        final ExecutionVertex connectedVertex=vertex.getExecutionGraph().getVertexByChannelID(outputChannel.getConnectedChannelID());
        reassignGraphFragment(connectedVertex,oldResource,newResource);
      }
    }
  }
}

Fixed version (ground truth):
private void reassignGraphFragment(final ExecutionVertex vertex,final AllocatedResource oldResource,final AllocatedResource newResource){
synchronized (vertex.getExecutionGraph()) {
    if (oldResource.equals(vertex.getAllocatedResource())) {
      vertex.setAllocatedResource(newResource);
      if (vertex.getExecutionState() == ExecutionState.SCHEDULED) {
        vertex.updateExecutionState(ExecutionState.ASSIGNED);
      }
      final int numberOfOutputGates=vertex.getEnvironment().getNumberOfOutputGates();
      for (int i=0; i < numberOfOutputGates; ++i) {
        final OutputGate<? extends Record> outputGate=vertex.getEnvironment().getOutputGate(i);
        if (outputGate.getChannelType() == ChannelType.NETWORK) {
          continue;
        }
        final int numberOfOutputChannels=outputGate.getNumberOfOutputChannels();
        for (int j=0; j < numberOfOutputChannels; ++j) {
          final AbstractOutputChannel<? extends Record> outputChannel=outputGate.getOutputChannel(j);
          final ExecutionVertex connectedVertex=vertex.getExecutionGraph().getVertexByChannelID(outputChannel.getConnectedChannelID());
          reassignGraphFragment(connectedVertex,oldResource,newResource);
        }
      }
    }
  }
}
Program: 55901
Project: 55901
Buggy source:
void flushQueuedOutgoingEnvelopes() throws IOException, InterruptedException {
  System.out.println("String_Node_Str" + this.queuedOutgoingEnvelopes.size() + "String_Node_Str");
  while (!this.queuedOutgoingEnvelopes.isEmpty()) {
    this.outputGateContext.processEnvelope(this,this.queuedOutgoingEnvelopes.poll());
  }
}

Fixed version (ground truth):
void flushQueuedOutgoingEnvelopes() throws IOException, InterruptedException {
  while (!this.queuedOutgoingEnvelopes.isEmpty()) {
    this.outputGateContext.processEnvelope(this,this.queuedOutgoingEnvelopes.poll());
  }
}
Program: 55902
Project: 55902
Buggy source:
public FSDataOutputStream getFSDataOutputStream() throws Exception {
  long start=System.currentTimeMillis();
  long remaining=this.timeoutMillies;
  if (this.exception != null) {
    throw this.exception;
  }
  if (this.fdos != null) {
    return this.fdos;
  }
synchronized (this.lock) {
    do {
      try {
        this.lock.wait(remaining);
      }
 catch (      InterruptedException iex) {
        this.canceled=true;
        if (this.fdos != null) {
          try {
            this.fdos.close();
          }
 catch (          Throwable t) {
          }
        }
        throw new Exception("String_Node_Str");
      }
    }
 while (this.exception == null && this.fdos == null && (remaining=this.timeoutMillies + start - System.currentTimeMillis()) > 0);
    if (this.exception != null) {
      if (this.fdos != null) {
        try {
          this.fdos.close();
        }
 catch (        Throwable t) {
        }
      }
      throw this.exception;
    }
    if (this.fdos != null) {
      return this.fdos;
    }
  }
  throw new Exception("String_Node_Str");
}

Fixed version (ground truth):
public FSDataOutputStream getFSDataOutputStream() throws Exception {
  long start=System.currentTimeMillis();
  long remaining=this.timeoutMillies;
synchronized (this.lock) {
    boolean success=false;
    try {
      while (this.exception == null && this.fdos == null && (remaining=this.timeoutMillies + start - System.currentTimeMillis()) > 0) {
        this.lock.wait(remaining);
      }
      if (this.exception != null) {
        throw this.exception;
      }
      if (this.fdos != null) {
        success=true;
        return this.fdos;
      }
    }
  finally {
      if (!success) {
        this.canceled=true;
      }
    }
  }
  throw new Exception("String_Node_Str");
}
Program: 55903
Project: 55903
Buggy source:
@Override public void run(){
  try {
    final FileSystem fs=path.getFileSystem();
    Path p=this.path;
    if (fs.exists(this.path) && fs.getFileStatus(this.path).isDir()) {
      p=this.path.suffix("String_Node_Str" + this.taskIndex);
    }
    final FSDataOutputStream stream=fs.create(p,true);
synchronized (this.lock) {
      this.lock.notifyAll();
      if (!this.canceled) {
        this.fdos=stream;
      }
 else {
        this.fdos=null;
        stream.close();
      }
    }
  }
 catch (  Exception t) {
synchronized (this.lock) {
      this.canceled=true;
      this.exception=t;
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  try {
    final FileSystem fs=path.getFileSystem();
    Path p=this.path;
    if (fs.exists(this.path) && fs.getFileStatus(this.path).isDir()) {
      p=this.path.suffix("String_Node_Str" + this.taskIndex);
    }
    final FSDataOutputStream stream=fs.create(p,true);
synchronized (this.lock) {
      if (canceled) {
        try {
          stream.close();
        }
 catch (        Throwable t) {
        }
      }
 else {
        this.fdos=stream;
      }
      this.lock.notifyAll();
    }
  }
 catch (  Exception t) {
synchronized (this.lock) {
      this.exception=t;
      this.lock.notifyAll();
    }
  }
catch (  Throwable t) {
synchronized (this.lock) {
      this.exception=new Exception(t);
      this.lock.notifyAll();
    }
  }
}
Program: 55904
Project: 55904
Buggy source:
/** 
 * Private constructor used to duplicate execution vertices.
 * @param vertexID the ID of the new execution vertex.
 * @param invokableClass the task that is assigned to this execution vertex
 * @param executionGraph the execution graph the new vertex belongs to
 * @param groupVertex the group vertex the new vertex belongs to
 */
private ExecutionVertex(ExecutionVertexID vertexID,Class<? extends AbstractInvokable> invokableClass,ExecutionGraph executionGraph,ExecutionGroupVertex groupVertex){
  this.vertexID=vertexID;
  this.invokableClass=invokableClass;
  this.executionGraph=executionGraph;
  this.groupVertex=groupVertex;
}

Fixed version (ground truth):
/** 
 * Private constructor used to duplicate execution vertices.
 * @param vertexID the ID of the new execution vertex.
 * @param invokableClass the task that is assigned to this execution vertex
 * @param executionGraph the execution graph the new vertex belongs to
 * @param groupVertex the group vertex the new vertex belongs to
 */
private ExecutionVertex(ExecutionVertexID vertexID,Class<? extends AbstractInvokable> invokableClass,ExecutionGraph executionGraph,ExecutionGroupVertex groupVertex){
  this.vertexID=vertexID;
  this.invokableClass=invokableClass;
  this.executionGraph=executionGraph;
  this.groupVertex=groupVertex;
  registerExecutionListener(this.executionGraph);
}
Program: 55905
Project: 55905
Buggy source:
/** 
 * Updates the vertex's current execution state.
 * @param newExecutionState the new execution state
 * @param optionalMessage an optional message related to the state change
 */
public synchronized void updateExecutionState(final ExecutionState newExecutionState,final String optionalMessage){
  if (this.executionState == newExecutionState) {
    return;
  }
  ExecutionStateTransition.checkTransition(getName(),this.executionState,newExecutionState);
  final Iterator<ExecutionListener> it=this.executionListeners.iterator();
  while (it.hasNext()) {
    it.next().executionStateChanged(this.executionGraph.getJobID(),this.vertexID,newExecutionState,optionalMessage);
  }
  this.executionState=newExecutionState;
}

Fixed version (ground truth):
/** 
 * Updates the vertex's current execution state.
 * @param newExecutionState the new execution state
 * @param optionalMessage an optional message related to the state change
 */
public synchronized void updateExecutionState(final ExecutionState newExecutionState,final String optionalMessage){
  if (this.executionState == newExecutionState) {
    return;
  }
  ExecutionStateTransition.checkTransition(getName(),this.executionState,newExecutionState);
  this.executionState=newExecutionState;
  final Iterator<ExecutionListener> it=this.executionListeners.iterator();
  while (it.hasNext()) {
    it.next().executionStateChanged(this.executionGraph.getJobID(),this.vertexID,newExecutionState,optionalMessage);
  }
}
Program: 55909
Project: 55909
Buggy source:
public SerializableHashSet<ChannelID> constructInitialActiveOutputChannelsSet(){
  final SerializableHashSet<ChannelID> activeOutputChannels=new SerializableHashSet<ChannelID>();
synchronized (this) {
    final int numberOfOutputGates=this.environment.getNumberOfOutputGates();
    for (int i=0; i < numberOfOutputGates; ++i) {
      final OutputGate<? extends Record> outputGate=this.environment.getOutputGate(i);
      final ChannelType channelType=outputGate.getChannelType();
      final int numberOfOutputChannels=outputGate.getNumberOfOutputChannels();
      for (int j=0; j < numberOfOutputChannels; ++j) {
        final AbstractOutputChannel<? extends Record> outputChannel=outputGate.getOutputChannel(j);
        if (channelType == ChannelType.FILE) {
          continue;
        }
        if (channelType == ChannelType.INMEMORY) {
          activeOutputChannels.add(outputChannel.getID());
          continue;
        }
        if (channelType == ChannelType.NETWORK) {
          final ExecutionVertex connectedVertex=this.executionGraph.getVertexByChannelID(outputChannel.getConnectedChannelID());
          final ExecutionState state=connectedVertex.getExecutionState();
          if (state == ExecutionState.READY || state == ExecutionState.STARTING || state == ExecutionState.RUNNING) {
            activeOutputChannels.add(outputChannel.getID());
          }
        }
      }
    }
  }
  return activeOutputChannels;
}

Fixed version (ground truth):
public SerializableHashSet<ChannelID> constructInitialActiveOutputChannelsSet(){
  final SerializableHashSet<ChannelID> activeOutputChannels=new SerializableHashSet<ChannelID>();
synchronized (this) {
    final int numberOfOutputGates=this.environment.getNumberOfOutputGates();
    for (int i=0; i < numberOfOutputGates; ++i) {
      final OutputGate<? extends Record> outputGate=this.environment.getOutputGate(i);
      final ChannelType channelType=outputGate.getChannelType();
      final int numberOfOutputChannels=outputGate.getNumberOfOutputChannels();
      for (int j=0; j < numberOfOutputChannels; ++j) {
        final AbstractOutputChannel<? extends Record> outputChannel=outputGate.getOutputChannel(j);
        if (channelType == ChannelType.FILE) {
          activeOutputChannels.add(outputChannel.getID());
          continue;
        }
        if (channelType == ChannelType.INMEMORY) {
          activeOutputChannels.add(outputChannel.getID());
          continue;
        }
        if (channelType == ChannelType.NETWORK) {
          final ExecutionVertex connectedVertex=this.executionGraph.getVertexByChannelID(outputChannel.getConnectedChannelID());
          final ExecutionState state=connectedVertex.getExecutionState();
          if (state == ExecutionState.READY || state == ExecutionState.STARTING || state == ExecutionState.RUNNING) {
            activeOutputChannels.add(outputChannel.getID());
          }
        }
      }
    }
  }
  return activeOutputChannels;
}
Program: 55910
Project: 55910
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void close() throws IOException, InterruptedException {
  this.deserializationBuffer.clear();
  if (this.uncompressedDataBuffer != null) {
    releasedConsumedReadBuffer();
  }
  if (this.getType() == ChannelType.NETWORK) {
synchronized (this.synchronisationObject) {
      if (!this.brokerAggreedToCloseChannel) {
        while (!this.brokerAggreedToCloseChannel) {
          requestReadBuffersFromBroker();
          if (this.uncompressedDataBuffer != null || this.compressedDataBuffer != null) {
            releasedConsumedReadBuffer();
          }
          this.synchronisationObject.wait(500);
        }
        this.bufferedRecord=null;
      }
    }
  }
  if (getType() == ChannelType.NETWORK) {
    transferEvent(new ByteBufferedChannelCloseEvent());
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void close() throws IOException, InterruptedException {
  this.deserializationBuffer.clear();
  if (this.uncompressedDataBuffer != null) {
    releasedConsumedReadBuffer();
  }
  if (this.getType() == ChannelType.NETWORK) {
synchronized (this.synchronisationObject) {
      if (!this.brokerAggreedToCloseChannel) {
        while (!this.brokerAggreedToCloseChannel) {
          requestReadBuffersFromBroker();
          if (this.uncompressedDataBuffer != null || this.compressedDataBuffer != null) {
            releasedConsumedReadBuffer();
          }
          this.synchronisationObject.wait(500);
        }
        this.bufferedRecord=null;
      }
    }
  }
  final ChannelType type=getType();
  if (type == ChannelType.NETWORK || type == ChannelType.INMEMORY) {
    transferEvent(new ByteBufferedChannelCloseEvent());
  }
}
Program: 55911
Project: 55911
Buggy source:
@Override public void run() throws Exception {
  final KeyGroupedIterator it=new KeyGroupedIterator(closeableInput.getIterator(),keyPositions,keyClasses);
  while (this.running && it.nextKey()) {
    System.out.println("String_Node_Str" + it.getKeys()[0]);
    crossValues(it.getValues(),output);
  }
}

Fixed version (ground truth):
@Override public void run() throws Exception {
  final KeyGroupedIterator it=new KeyGroupedIterator(closeableInput.getIterator(),keyPositions,keyClasses);
  while (this.running && it.nextKey()) {
    crossValues(it.getValues(),output);
  }
}
Program: 55914
Project: 55914
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void userThreadFinished(Environment ee,Thread userThread){
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void userThreadFinished(final Environment ee,final Thread userThread){
}
Program: 55915
Project: 55915
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void userThreadStarted(Environment ee,Thread userThread){
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void userThreadStarted(final Environment ee,final Thread userThread){
}
Program: 55916
Project: 55916
Buggy source:
public SerializableHashSet<ChannelID> constructInitialActiveOutputChannelsSet(){
  final SerializableHashSet<ChannelID> activeOutputChannels=new SerializableHashSet<ChannelID>();
synchronized (this) {
    final int numberOfOutputGates=this.environment.getNumberOfOutputGates();
    for (int i=0; i < numberOfOutputGates; ++i) {
      final OutputGate<? extends Record> outputGate=this.environment.getOutputGate(i);
      final ChannelType channelType=outputGate.getChannelType();
      final int numberOfOutputChannels=outputGate.getNumberOfOutputChannels();
      for (int j=0; j < numberOfOutputChannels; ++j) {
        final AbstractOutputChannel<? extends Record> outputChannel=outputGate.getOutputChannel(j);
        if (channelType == ChannelType.FILE) {
          continue;
        }
        if (channelType == ChannelType.INMEMORY) {
          activeOutputChannels.add(outputChannel.getID());
          continue;
        }
        if (channelType == ChannelType.NETWORK) {
          final ExecutionVertex connectedVertex=this.executionGraph.getVertexByChannelID(outputChannel.getConnectedChannelID());
          final ExecutionState state=connectedVertex.getExecutionState();
          if (state == ExecutionState.READY || state == ExecutionState.RUNNING) {
            activeOutputChannels.add(outputChannel.getID());
          }
        }
      }
    }
  }
  return activeOutputChannels;
}

Fixed version (ground truth):
public SerializableHashSet<ChannelID> constructInitialActiveOutputChannelsSet(){
  final SerializableHashSet<ChannelID> activeOutputChannels=new SerializableHashSet<ChannelID>();
synchronized (this) {
    final int numberOfOutputGates=this.environment.getNumberOfOutputGates();
    for (int i=0; i < numberOfOutputGates; ++i) {
      final OutputGate<? extends Record> outputGate=this.environment.getOutputGate(i);
      final ChannelType channelType=outputGate.getChannelType();
      final int numberOfOutputChannels=outputGate.getNumberOfOutputChannels();
      for (int j=0; j < numberOfOutputChannels; ++j) {
        final AbstractOutputChannel<? extends Record> outputChannel=outputGate.getOutputChannel(j);
        if (channelType == ChannelType.FILE) {
          continue;
        }
        if (channelType == ChannelType.INMEMORY) {
          activeOutputChannels.add(outputChannel.getID());
          continue;
        }
        if (channelType == ChannelType.NETWORK) {
          final ExecutionVertex connectedVertex=this.executionGraph.getVertexByChannelID(outputChannel.getConnectedChannelID());
          final ExecutionState state=connectedVertex.getExecutionState();
          if (state == ExecutionState.READY || state == ExecutionState.STARTING || state == ExecutionState.RUNNING) {
            activeOutputChannels.add(outputChannel.getID());
          }
        }
      }
    }
  }
  return activeOutputChannels;
}
Program: 55917
Project: 55917
Buggy source:
public InstanceSummaryProfilingEvent getInstanceSummaryProfilingData(long timestamp){
  final Set<AbstractInstance> tempSet=new HashSet<AbstractInstance>();
  final ExecutionGroupVertexIterator it=new ExecutionGroupVertexIterator(this.executionGraph,true,this.executionGraph.getIndexOfCurrentExecutionStage());
  while (it.hasNext()) {
    final ExecutionGroupVertex groupVertex=it.next();
    for (int i=0; i < groupVertex.getCurrentNumberOfGroupMembers(); i++) {
      final ExecutionVertex executionVertex=groupVertex.getGroupMember(i);
      tempSet.add(executionVertex.getAllocatedResource().getInstance());
    }
  }
  if (tempSet.size() != this.collectedInstanceProfilingData.size()) {
    return null;
  }
  return constructInstanceSummary(timestamp);
}

Fixed version (ground truth):
public InstanceSummaryProfilingEvent getInstanceSummaryProfilingData(long timestamp){
  final Set<AbstractInstance> tempSet=new HashSet<AbstractInstance>();
  final ExecutionGroupVertexIterator it=new ExecutionGroupVertexIterator(this.executionGraph,true,this.executionGraph.getIndexOfCurrentExecutionStage());
  while (it.hasNext()) {
    final ExecutionGroupVertex groupVertex=it.next();
    for (int i=0; i < groupVertex.getCurrentNumberOfGroupMembers(); i++) {
      final ExecutionVertex executionVertex=groupVertex.getGroupMember(i);
      final AbstractInstance instance=executionVertex.getAllocatedResource().getInstance();
      if (!(instance instanceof DummyInstance)) {
        tempSet.add(instance);
      }
    }
  }
  if (tempSet.size() != this.collectedInstanceProfilingData.size()) {
    return null;
  }
  return constructInstanceSummary(timestamp);
}
Program: 55919
Project: 55919
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void close() throws IOException, InterruptedException {
  this.deserializationBuffer.clear();
  if (this.uncompressedDataBuffer != null) {
    releasedConsumedReadBuffer();
  }
  if (getType() == ChannelType.NETWORK) {
    transferEvent(new ByteBufferedChannelCloseEvent());
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void close() throws IOException, InterruptedException {
  this.deserializationBuffer.clear();
  if (this.uncompressedDataBuffer != null) {
    releasedConsumedReadBuffer();
  }
synchronized (this.synchronisationObject) {
    if (!this.brokerAggreedToCloseChannel) {
      while (!this.brokerAggreedToCloseChannel) {
        requestReadBuffersFromBroker();
        if (this.uncompressedDataBuffer != null || this.compressedDataBuffer != null) {
          releasedConsumedReadBuffer();
        }
        this.synchronisationObject.wait(500);
      }
      this.bufferedRecord=null;
    }
  }
  if (getType() == ChannelType.NETWORK) {
    transferEvent(new ByteBufferedChannelCloseEvent());
  }
}
Program: 55920
Project: 55920
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void close() throws IOException, InterruptedException {
  this.deserializationBuffer.clear();
  if (this.uncompressedDataBuffer != null) {
    releasedConsumedReadBuffer();
  }
synchronized (this.synchronisationObject) {
    if (!this.brokerAggreedToCloseChannel) {
      while (!this.brokerAggreedToCloseChannel) {
        requestReadBuffersFromBroker();
        if (this.uncompressedDataBuffer != null || this.compressedDataBuffer != null) {
          releasedConsumedReadBuffer();
        }
        this.synchronisationObject.wait(500);
      }
      this.bufferedRecord=null;
    }
  }
  if (getType() == ChannelType.NETWORK) {
    transferEvent(new ByteBufferedChannelCloseEvent());
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void close() throws IOException, InterruptedException {
  this.deserializationBuffer.clear();
  if (this.uncompressedDataBuffer != null) {
    releasedConsumedReadBuffer();
  }
  if (this.getType() == ChannelType.NETWORK) {
synchronized (this.synchronisationObject) {
      if (!this.brokerAggreedToCloseChannel) {
        while (!this.brokerAggreedToCloseChannel) {
          requestReadBuffersFromBroker();
          if (this.uncompressedDataBuffer != null || this.compressedDataBuffer != null) {
            releasedConsumedReadBuffer();
          }
          this.synchronisationObject.wait(500);
        }
        this.bufferedRecord=null;
      }
    }
  }
  if (getType() == ChannelType.NETWORK) {
    transferEvent(new ByteBufferedChannelCloseEvent());
  }
}
Program: 55923
Project: 55923
Buggy source:
/** 
 * @param stubClass
 * @param dop
 * @return
 */
private JobTaskVertex generateTempVertex(Class<?> stubClass,int dop){
  JobTaskVertex tempVertex=new JobTaskVertex("String_Node_Str",this.jobGraph);
  tempVertex.setTaskClass(TempTask.class);
  TaskConfig tempConfig=new TaskConfig(tempVertex.getConfiguration());
  tempConfig.setStubClass(stubClass);
  assignMemory(tempConfig,PactCompiler.DEFAULT_TEMP_TASK_MEMORY);
  tempVertex.setNumberOfSubtasks(dop);
  return tempVertex;
}

Fixed version (ground truth):
/** 
 * @param stubClass
 * @param dop
 * @return
 */
private JobTaskVertex generateTempVertex(Class<?> stubClass,int dop,int instancesPerMachine){
  JobTaskVertex tempVertex=new JobTaskVertex("String_Node_Str",this.jobGraph);
  tempVertex.setTaskClass(TempTask.class);
  TaskConfig tempConfig=new TaskConfig(tempVertex.getConfiguration());
  tempConfig.setStubClass(stubClass);
  assignMemory(tempConfig,PactCompiler.DEFAULT_TEMP_TASK_MEMORY);
  tempVertex.setNumberOfSubtasks(dop);
  tempVertex.setNumberOfSubtasksPerInstance(instancesPerMachine);
  return tempVertex;
}