nus-yam/ex-repair huggingface dataset:
Program: 55724
Project: 55724
Buggy source:
@Override public SopremoModule asElementaryOperators(){
  final SopremoModule sopremoModule=new SopremoModule(this.getName(),1,1);
  JsonStream input=sopremoModule.getInput(0);
  int itCount=2;
  TransformAKey[] a=new TransformAKey[itCount];
  TransformBKey[] b=new TransformBKey[itCount];
  TransformXKey[] x=new TransformXKey[itCount];
  BAndXCoGroup[] xb=new BAndXCoGroup[itCount];
  ACoGroup axb[]=new ACoGroup[itCount];
  for (int i=0; i < itCount; i++) {
    a[i]=new TransformAKey().withInputs(i == 0 ? input : axb[i - 1]);
    a[i].setIterationStep(i + 1);
    b[i]=new TransformBKey().withInputs(i == 0 ? input : axb[i - 1]);
    b[i].setIterationStep(i + 1);
    x[i]=new TransformXKey().withInputs(i == 0 ? input : axb[i - 1]);
    xb[i]=new BAndXCoGroup().withInputs(b[i],x[i]);
    axb[i]=new ACoGroup().withInputs(a[i],xb[i]);
  }
  sopremoModule.getOutput(0).setInput(0,axb[itCount - 1]);
  return sopremoModule;
}

Fixed version (ground truth):
@Override public SopremoModule asElementaryOperators(){
  final SopremoModule sopremoModule=new SopremoModule(this.getName(),1,1);
  JsonStream input=sopremoModule.getInput(0);
  int itCount=3;
  TransformAKey[] a=new TransformAKey[itCount];
  TransformBKey[] b=new TransformBKey[itCount];
  TransformXKey[] x=new TransformXKey[itCount];
  BAndXCoGroup[] xb=new BAndXCoGroup[itCount];
  ACoGroup axb[]=new ACoGroup[itCount];
  for (int i=0; i < itCount; i++) {
    a[i]=new TransformAKey().withInputs(i == 0 ? input : axb[i - 1]);
    a[i].setIterationStep(i + 1);
    b[i]=new TransformBKey().withInputs(i == 0 ? input : axb[i - 1]);
    b[i].setIterationStep(i + 1);
    x[i]=new TransformXKey().withInputs(i == 0 ? input : axb[i - 1]);
    xb[i]=new BAndXCoGroup().withInputs(b[i],x[i]);
    axb[i]=new ACoGroup().withInputs(a[i],xb[i]);
  }
  sopremoModule.getOutput(0).setInput(0,axb[itCount - 1]);
  return sopremoModule;
}
Program: 55725
Project: 55725
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void read(final DataInput in) throws IOException {
  this.sourceChannelID.read(in);
  this.bufferSize=in.readInt();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void read(final DataInput in) throws IOException {
  super.read(in);
  this.sourceChannelID.read(in);
  this.bufferSize=in.readInt();
}
Program: 55726
Project: 55726
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void write(final DataOutput out) throws IOException {
  this.sourceChannelID.write(out);
  out.writeInt(this.bufferSize);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void write(final DataOutput out) throws IOException {
  super.write(out);
  this.sourceChannelID.write(out);
  out.writeInt(this.bufferSize);
}
Program: 55727
Project: 55727
Buggy source:
@Override public void close(){
  this.running=false;
  if (this.currentBuffer.isEmpty()) {
    this.queues.empty.add(this.currentElement);
  }
 else {
    this.queues.sort.add(this.currentElement);
    if (LOG.isDebugEnabled()) {
      LOG.debug("String_Node_Str" + this.currentElement.id + "String_Node_Str");
    }
  }
  this.currentBuffer=null;
  this.currentElement=null;
  this.queues.sort.add(SENTINEL);
  if (LOG.isDebugEnabled())   LOG.debug("String_Node_Str");
}

Fixed version (ground truth):
@Override public void close(){
  if (this.running) {
    this.running=false;
    if (this.currentBuffer != null && this.currentElement != null) {
      if (this.currentBuffer.isEmpty()) {
        this.queues.empty.add(this.currentElement);
      }
 else {
        this.queues.sort.add(this.currentElement);
        if (LOG.isDebugEnabled()) {
          LOG.debug("String_Node_Str" + this.currentElement.id + "String_Node_Str");
        }
      }
    }
    this.currentBuffer=null;
    this.currentElement=null;
    this.queues.sort.add(SENTINEL);
  }
}
Program: 55728
Project: 55728
Buggy source:
public static PluginID fromByteArray(final byte[] byteArray){
  if (byteArray == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (byteArray.length != SIZE) {
    throw new IllegalArgumentException("String_Node_Str" + SIZE);
  }
  return new PluginID(byteArray);
}

Fixed version (ground truth):
/** 
 * Constructs a new plugin ID from the given byte array.
 * @param byteArray the byte array to construct the plugin ID from
 */
public static PluginID fromByteArray(final byte[] byteArray){
  if (byteArray == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (byteArray.length != SIZE) {
    throw new IllegalArgumentException("String_Node_Str" + SIZE);
  }
  return new PluginID(byteArray);
}
Program: 55729
Project: 55729
Buggy source:
private PluginID(final byte[] byteArray){
  super(byteArray);
}

Fixed version (ground truth):
/** 
 * Default constructor required for the deserialization.
 */
public PluginID(){
  super();
}
Program: 55730
Project: 55730
Buggy source:
public ProfilingValue(double value,long timestamp){
  this.value=value;
  this.timestamp=timestamp;
}

Fixed version (ground truth):
public ProfilingValue(double value,long timestamp){
  this.value=value;
  this.timestamp=timestamp;
  this.id=nextFreeId++;
}
Program: 55731
Project: 55731
Buggy source:
/** 
 * Sorts first by value and then by timestamp.
 */
@Override public int compareTo(ProfilingValue other){
  if (this.value > other.value) {
    return 1;
  }
 else   if (this.value < other.value) {
    return -1;
  }
 else {
    if (this.timestamp > other.timestamp) {
      return 1;
    }
 else     if (this.timestamp < other.timestamp) {
      return -1;
    }
 else {
      return 0;
    }
  }
}

Fixed version (ground truth):
/** 
 * Sorts first by value and then by id.
 */
@Override public int compareTo(ProfilingValue other){
  if (this.value > other.value) {
    return 1;
  }
 else   if (this.value < other.value) {
    return -1;
  }
 else {
    if (this.id > other.id) {
      return 1;
    }
 else     if (this.id < other.id) {
      return -1;
    }
 else {
      return 0;
    }
  }
}
Program: 55732
Project: 55732
Buggy source:
public ProfilingValueStatistic(int valueSetSize){
  this.sortedByTimestamp=new LinkedList<ProfilingValue>();
  this.sortedByValue=new ArrayList<ProfilingValue>();
  this.valueArraySize=valueSetSize;
  this.noOfStoredValues=0;
  this.sumOfValues=0;
}

Fixed version (ground truth):
public ProfilingValueStatistic(int statisticWindowSize){
  this.sortedById=new LinkedList<ProfilingValue>();
  this.sortedByValue=new ArrayList<ProfilingValue>();
  this.statisticWindowSize=statisticWindowSize;
  this.noOfStoredValues=0;
  this.sumOfValues=0;
}
Program: 55733
Project: 55733
Buggy source:
private ProfilingValue insertIntoSortedByTimestamp(ProfilingValue value){
  if (!sortedByTimestamp.isEmpty() && sortedByTimestamp.getLast().getTimestamp() > value.getTimestamp()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  sortedByTimestamp.add(value);
  if (noOfStoredValues >= valueArraySize) {
    return sortedByTimestamp.removeFirst();
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
private ProfilingValue insertIntoSortedByTimestamp(ProfilingValue value){
  if (!sortedById.isEmpty() && sortedById.getLast().getId() >= value.getId()) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  sortedById.add(value);
  if (noOfStoredValues >= statisticWindowSize) {
    return sortedById.removeFirst();
  }
 else {
    return null;
  }
}
Program: 55734
Project: 55734
Buggy source:
public void refreshEdgeLatency(PathLatency pathLatency){
}

Fixed version (ground truth):
public void refreshEdgeLatency(PathLatency pathLatency){
  LOG.info("String_Node_Str" + pathLatency);
}
Program: 55735
Project: 55735
Buggy source:
public LatencyOptimizerThread(ExecutionGraph executionGraph){
  this.latencyModel=new LatencyModel(executionGraph);
  this.streamingDataQueue=new LinkedBlockingQueue<AbstractStreamingData>();
}

Fixed version (ground truth):
public LatencyOptimizerThread(ExecutionGraph executionGraph){
  this.executionGraph=executionGraph;
  this.latencyModel=new LatencyModel(executionGraph);
  this.streamingDataQueue=new LinkedBlockingQueue<AbstractStreamingData>();
}
Program: 55736
Project: 55736
Buggy source:
public void run(){
  try {
    while (!interrupted()) {
      AbstractStreamingData streamingData=streamingDataQueue.take();
      if (streamingData instanceof PathLatency) {
        latencyModel.refreshEdgeLatency((PathLatency)streamingData);
      }
    }
  }
 catch (  InterruptedException e) {
  }
}

Fixed version (ground truth):
public void run(){
  LOG.info("String_Node_Str" + executionGraph.getJobName());
  try {
    while (!interrupted()) {
      AbstractStreamingData streamingData=streamingDataQueue.take();
      if (streamingData instanceof PathLatency) {
        latencyModel.refreshEdgeLatency((PathLatency)streamingData);
      }
    }
  }
 catch (  InterruptedException e) {
  }
  LOG.info("String_Node_Str" + executionGraph.getJobName());
}
Program: 55737
Project: 55737
Buggy source:
public ManagementVertex getEnd(){
  return pathVertices.getFirst();
}

Fixed version (ground truth):
public ManagementVertex getEnd(){
  return pathVertices.getLast();
}
Program: 55738
Project: 55738
Buggy source:
/** 
 * Creates a new file input channel and assigns it to the input gate.
 * @param channelID the channel ID to assign to the new channel, <code>null</code> to generate a new ID
 * @param compressionLevel the level of compression to be used for this channel
 * @return the new file input channel
 */
FileInputChannel<T> createFileInputChannel(ChannelID channelID,CompressionLevel compressionLevel);

Fixed version (ground truth):
/** 
 * Creates a new file input channel and assigns it to the given input gate.
 * @param inputGate the input gate the channel shall be assigned to
 * @param channelID the channel ID to assign to the new channel, <code>null</code> to generate a new ID
 * @param compressionLevel the level of compression to be used for this channel
 * @return the new file input channel
 */
FileInputChannel<T> createFileInputChannel(InputGate<T> inputGate,ChannelID channelID,CompressionLevel compressionLevel);
Program: 55739
Project: 55739
Buggy source:
/** 
 * Creates a new in-memory input channel and assigns it to the input gate.
 * @param channelID the channel ID to assign to the new channel, <code>null</code> to generate a new ID
 * @param compressionLevel the level of compression to be used for this channel
 * @return the new in-memory input channel
 */
InMemoryInputChannel<T> createInMemoryInputChannel(ChannelID channelID,CompressionLevel compressionLevel);

Fixed version (ground truth):
/** 
 * Creates a new in-memory input channel and assigns it to the given input gate.
 * @param inputGate the input gate the channel shall be assigned to
 * @param channelID the channel ID to assign to the new channel, <code>null</code> to generate a new ID
 * @param compressionLevel the level of compression to be used for this channel
 * @return the new in-memory input channel
 */
InMemoryInputChannel<T> createInMemoryInputChannel(InputGate<T> inputGate,ChannelID channelID,CompressionLevel compressionLevel);
Program: 55740
Project: 55740
Buggy source:
/** 
 * Creates a new network input channel and assigns it to the input gate.
 * @param channelID the channel ID to assign to the new channel, <code>null</code> to generate a new ID
 * @param compressionLevel the level of compression to be used for this channel
 * @return the new network input channel
 */
NetworkInputChannel<T> createNetworkInputChannel(ChannelID channelID,CompressionLevel compressionLevel);

Fixed version (ground truth):
/** 
 * Creates a new network input channel and assigns it to the given input gate.
 * @param inputGate the input gate the channel shall be assigned to
 * @param channelID the channel ID to assign to the new channel, <code>null</code> to generate a new ID
 * @param compressionLevel the level of compression to be used for this channel
 * @return the new network input channel
 */
NetworkInputChannel<T> createNetworkInputChannel(InputGate<T> inputGate,ChannelID channelID,CompressionLevel compressionLevel);
Program: 55741
Project: 55741
Buggy source:
/** 
 * Creates a new in-memory output channel and assigns it to the output gate.
 * @param channelID the channel ID to assign to the new channel, <code>null</code> to generate a new ID
 * @param compressionLevel the level of compression to be used for this channel
 * @return the new in-memory output channel
 */
InMemoryOutputChannel<T> createInMemoryOutputChannel(ChannelID channelID,CompressionLevel compressionLevel);

Fixed version (ground truth):
/** 
 * Creates a new in-memory output channel and assigns it to the given output gate.
 * @param outputGate the output gate the channel shall be assigned to
 * @param channelID the channel ID to assign to the new channel, <code>null</code> to generate a new ID
 * @param compressionLevel the level of compression to be used for this channel
 * @return the new in-memory output channel
 */
InMemoryOutputChannel<T> createInMemoryOutputChannel(OutputGate<T> outputGate,ChannelID channelID,CompressionLevel compressionLevel);
Program: 55742
Project: 55742
Buggy source:
/** 
 * Creates a new network output channel and assigns it to the output gate.
 * @param channelID the channel ID to assign to the new channel, <code>null</code> to generate a new ID
 * @param compressionLevel the level of compression to be used for this channel
 * @return the new network output channel
 */
NetworkOutputChannel<T> createNetworkOutputChannel(ChannelID channelID,CompressionLevel compressionLevel);

Fixed version (ground truth):
/** 
 * Creates a new network output channel and assigns it to the given output gate.
 * @param outputGate the output gate the channel shall be assigned to
 * @param channelID the channel ID to assign to the new channel, <code>null</code> to generate a new ID
 * @param compressionLevel the level of compression to be used for this channel
 * @return the new network output channel
 */
NetworkOutputChannel<T> createNetworkOutputChannel(OutputGate<T> outputGate,ChannelID channelID,CompressionLevel compressionLevel);
Program: 55743
Project: 55743
Buggy source:
/** 
 * Creates a new file output channel and assigns it to the output gate.
 * @param channelID the channel ID to assign to the new channel, <code>null</code> to generate a new ID
 * @param compressionLevel the level of compression to be used for this channel
 * @return the new file output channel
 */
FileOutputChannel<T> createFileOutputChannel(ChannelID channelID,CompressionLevel compressionLevel);

Fixed version (ground truth):
/** 
 * Creates a new file output channel and assigns it to the given output gate.
 * @param outputGate the output gate the channel shall be assigned to
 * @param channelID the channel ID to assign to the new channel, <code>null</code> to generate a new ID
 * @param compressionLevel the level of compression to be used for this channel
 * @return the new file output channel
 */
FileOutputChannel<T> createFileOutputChannel(OutputGate<T> outputGate,ChannelID channelID,CompressionLevel compressionLevel);
Program: 55745
Project: 55745
Buggy source:
private void createChannel(final ExecutionVertex source,final OutputGate<? extends Record> outputGate,final ExecutionVertex target,final InputGate<? extends Record> inputGate,final ChannelType channelType,final CompressionLevel compressionLevel) throws GraphConversionException {
  AbstractOutputChannel<? extends Record> outputChannel;
  AbstractInputChannel<? extends Record> inputChannel;
switch (channelType) {
case NETWORK:
    outputChannel=outputGate.createNetworkOutputChannel(null,compressionLevel);
  inputChannel=inputGate.createNetworkInputChannel(null,compressionLevel);
break;
case INMEMORY:
outputChannel=outputGate.createInMemoryOutputChannel(null,compressionLevel);
inputChannel=inputGate.createInMemoryInputChannel(null,compressionLevel);
break;
case FILE:
outputChannel=outputGate.createFileOutputChannel(null,compressionLevel);
inputChannel=inputGate.createFileInputChannel(null,compressionLevel);
break;
default :
throw new GraphConversionException("String_Node_Str");
}
inputChannel.setConnectedChannelID(outputChannel.getID());
outputChannel.setConnectedChannelID(inputChannel.getID());
this.outputChannelMap.put(outputChannel.getID(),outputChannel);
this.inputChannelMap.put(inputChannel.getID(),inputChannel);
this.channelToVertexMap.put(outputChannel.getID(),source);
this.channelToVertexMap.put(inputChannel.getID(),target);
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str","String_Node_Str"}) private void createChannel(final ExecutionVertex source,final OutputGate<? extends Record> outputGate,final ExecutionVertex target,final InputGate<? extends Record> inputGate,final ChannelType channelType,final CompressionLevel compressionLevel) throws GraphConversionException {
  AbstractOutputChannel<? extends Record> outputChannel;
  AbstractInputChannel<? extends Record> inputChannel;
switch (channelType) {
case NETWORK:
    outputChannel=outputGate.createNetworkOutputChannel((OutputGate)outputGate,null,compressionLevel);
  inputChannel=inputGate.createNetworkInputChannel((InputGate)inputGate,null,compressionLevel);
break;
case INMEMORY:
outputChannel=outputGate.createInMemoryOutputChannel((OutputGate)outputGate,null,compressionLevel);
inputChannel=inputGate.createInMemoryInputChannel((InputGate)inputGate,null,compressionLevel);
break;
case FILE:
outputChannel=outputGate.createFileOutputChannel((OutputGate)outputGate,null,compressionLevel);
inputChannel=inputGate.createFileInputChannel((InputGate)inputGate,null,compressionLevel);
break;
default :
throw new GraphConversionException("String_Node_Str");
}
inputChannel.setConnectedChannelID(outputChannel.getID());
outputChannel.setConnectedChannelID(inputChannel.getID());
this.outputChannelMap.put(outputChannel.getID(),outputChannel);
this.inputChannelMap.put(inputChannel.getID(),inputChannel);
this.channelToVertexMap.put(outputChannel.getID(),source);
this.channelToVertexMap.put(inputChannel.getID(),target);
}
Program: 55747
Project: 55747
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public InMemoryInputChannel<T> createInMemoryInputChannel(final ChannelID channelID,final CompressionLevel compressionLevel){
  final InMemoryInputChannel<T> eimic=new InMemoryInputChannel<T>(this,this.inputChannels.size(),deserializer,channelID,compressionLevel);
  addInputChannel(eimic);
  return eimic;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public InMemoryInputChannel<T> createInMemoryInputChannel(final InputGate<T> inputGate,final ChannelID channelID,final CompressionLevel compressionLevel){
  final InMemoryInputChannel<T> eimic=new InMemoryInputChannel<T>(inputGate,this.inputChannels.size(),this.deserializer,channelID,compressionLevel);
  addInputChannel(eimic);
  return eimic;
}
Program: 55748
Project: 55748
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public FileInputChannel<T> createFileInputChannel(final ChannelID channelID,final CompressionLevel compressionLevel){
  final FileInputChannel<T> efic=new FileInputChannel<T>(this,this.inputChannels.size(),deserializer,channelID,compressionLevel);
  addInputChannel(efic);
  return efic;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public FileInputChannel<T> createFileInputChannel(final InputGate<T> inputGate,final ChannelID channelID,final CompressionLevel compressionLevel){
  final FileInputChannel<T> efic=new FileInputChannel<T>(inputGate,this.inputChannels.size(),this.deserializer,channelID,compressionLevel);
  addInputChannel(efic);
  return efic;
}
Program: 55749
Project: 55749
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public NetworkInputChannel<T> createNetworkInputChannel(final ChannelID channelID,final CompressionLevel compressionLevel){
  final NetworkInputChannel<T> enic=new NetworkInputChannel<T>(this,this.inputChannels.size(),deserializer,channelID,compressionLevel);
  addInputChannel(enic);
  return enic;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public NetworkInputChannel<T> createNetworkInputChannel(final InputGate<T> inputGate,final ChannelID channelID,final CompressionLevel compressionLevel){
  final NetworkInputChannel<T> enic=new NetworkInputChannel<T>(inputGate,this.inputChannels.size(),this.deserializer,channelID,compressionLevel);
  addInputChannel(enic);
  return enic;
}
Program: 55750
Project: 55750
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public InMemoryOutputChannel<T> createInMemoryOutputChannel(final ChannelID channelID,final CompressionLevel compressionLevel){
  final InMemoryOutputChannel<T> einoc=new InMemoryOutputChannel<T>(this,this.outputChannels.size(),channelID,compressionLevel);
  addOutputChannel(einoc);
  return einoc;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public InMemoryOutputChannel<T> createInMemoryOutputChannel(final OutputGate<T> outputGate,final ChannelID channelID,final CompressionLevel compressionLevel){
  final InMemoryOutputChannel<T> einoc=new InMemoryOutputChannel<T>(outputGate,this.outputChannels.size(),channelID,compressionLevel);
  addOutputChannel(einoc);
  return einoc;
}
Program: 55751
Project: 55751
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public NetworkOutputChannel<T> createNetworkOutputChannel(final ChannelID channelID,final CompressionLevel compressionLevel){
  final NetworkOutputChannel<T> enoc=new NetworkOutputChannel<T>(this,this.outputChannels.size(),channelID,compressionLevel);
  addOutputChannel(enoc);
  return enoc;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public NetworkOutputChannel<T> createNetworkOutputChannel(final OutputGate<T> outputGate,final ChannelID channelID,final CompressionLevel compressionLevel){
  final NetworkOutputChannel<T> enoc=new NetworkOutputChannel<T>(outputGate,this.outputChannels.size(),channelID,compressionLevel);
  addOutputChannel(enoc);
  return enoc;
}
Program: 55752
Project: 55752
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public FileOutputChannel<T> createFileOutputChannel(final ChannelID channelID,final CompressionLevel compressionLevel){
  final FileOutputChannel<T> efoc=new FileOutputChannel<T>(this,this.outputChannels.size(),channelID,compressionLevel);
  addOutputChannel(efoc);
  return efoc;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public FileOutputChannel<T> createFileOutputChannel(final OutputGate<T> outputGate,final ChannelID channelID,final CompressionLevel compressionLevel){
  final FileOutputChannel<T> efoc=new FileOutputChannel<T>(outputGate,this.outputChannels.size(),channelID,compressionLevel);
  addOutputChannel(efoc);
  return efoc;
}
Program: 55753
Project: 55753
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public NetworkInputChannel<T> createNetworkInputChannel(final ChannelID channelID,final CompressionLevel compressionLevel){
  return this.wrappedInputGate.createNetworkInputChannel(channelID,compressionLevel);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public NetworkInputChannel<T> createNetworkInputChannel(final InputGate<T> inputGate,final ChannelID channelID,final CompressionLevel compressionLevel){
  return this.wrappedInputGate.createNetworkInputChannel(inputGate,channelID,compressionLevel);
}
Program: 55754
Project: 55754
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public InMemoryInputChannel<T> createInMemoryInputChannel(final ChannelID channelID,final CompressionLevel compressionLevel){
  return this.wrappedInputGate.createInMemoryInputChannel(channelID,compressionLevel);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public InMemoryInputChannel<T> createInMemoryInputChannel(final InputGate<T> inputGate,final ChannelID channelID,final CompressionLevel compressionLevel){
  return this.wrappedInputGate.createInMemoryInputChannel(inputGate,channelID,compressionLevel);
}
Program: 55755
Project: 55755
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public FileInputChannel<T> createFileInputChannel(final ChannelID channelID,final CompressionLevel compressionLevel){
  return this.wrappedInputGate.createFileInputChannel(channelID,compressionLevel);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public FileInputChannel<T> createFileInputChannel(final InputGate<T> inputGate,final ChannelID channelID,final CompressionLevel compressionLevel){
  return this.wrappedInputGate.createFileInputChannel(inputGate,channelID,compressionLevel);
}
Program: 55756
Project: 55756
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public InMemoryOutputChannel<T> createInMemoryOutputChannel(final ChannelID channelID,final CompressionLevel compressionLevel){
  return this.wrappedOutputGate.createInMemoryOutputChannel(channelID,compressionLevel);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public InMemoryOutputChannel<T> createInMemoryOutputChannel(final OutputGate<T> outputGate,final ChannelID channelID,final CompressionLevel compressionLevel){
  return this.wrappedOutputGate.createInMemoryOutputChannel(outputGate,channelID,compressionLevel);
}
Program: 55757
Project: 55757
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public NetworkOutputChannel<T> createNetworkOutputChannel(final ChannelID channelID,final CompressionLevel compressionLevel){
  return this.wrappedOutputGate.createNetworkOutputChannel(channelID,compressionLevel);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public NetworkOutputChannel<T> createNetworkOutputChannel(final OutputGate<T> outputGate,final ChannelID channelID,final CompressionLevel compressionLevel){
  return this.wrappedOutputGate.createNetworkOutputChannel(outputGate,channelID,compressionLevel);
}
Program: 55758
Project: 55758
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public FileOutputChannel<T> createFileOutputChannel(final ChannelID channelID,final CompressionLevel compressionLevel){
  return this.wrappedOutputGate.createFileOutputChannel(channelID,compressionLevel);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public FileOutputChannel<T> createFileOutputChannel(final OutputGate<T> outputGate,final ChannelID channelID,final CompressionLevel compressionLevel){
  return this.wrappedOutputGate.createFileOutputChannel(outputGate,channelID,compressionLevel);
}
Program: 55759
Project: 55759
Buggy source:
/** 
 * Output Schema: Key: C_MKTSEGMENT Value: 0:PARTIAL_COUNT=1
 */
@Override public void match(PactRecord value1,PactRecord value2,Collector out) throws Exception {
  value2.getField(1,mktSeg);
  value2.setField(0,mktSeg);
  value2.setField(1,oneInteger);
  out.collect(value2);
}

Fixed version (ground truth):
/** 
 * Output Schema: Key: C_MKTSEGMENT Value: 0:PARTIAL_COUNT=1
 */
@Override public void match(PactRecord value1,PactRecord value2,Collector out) throws Exception {
  mktSeg=value2.getField(1,mktSeg);
  value2.setField(0,mktSeg);
  value2.setField(1,oneInteger);
  out.collect(value2);
}
Program: 55760
Project: 55760
Buggy source:
/** 
 * Output Schema: Key: CUSTOMERKEY Value: 0:MKTSEGMENT
 */
@Override public void map(PactRecord record,Collector out) throws Exception {
  record.getField(1,value);
  PactString mktSegment=new PactString(value.getStringValueAt(6));
  record.setField(1,mktSegment);
  out.collect(record);
}

Fixed version (ground truth):
/** 
 * Output Schema: Key: CUSTOMERKEY Value: 0:MKTSEGMENT
 */
@Override public void map(PactRecord record,Collector out) throws Exception {
  value=record.getField(1,value);
  PactString mktSegment=new PactString(value.getStringValueAt(6));
  record.setField(1,mktSegment);
  out.collect(record);
}
Program: 55761
Project: 55761
Buggy source:
@Override public void coGroup(Iterator<PactRecord> records1,Iterator<PactRecord> records2,Collector out){
  int sum=0;
  LOG.debug("String_Node_Str");
  while (records1.hasNext()) {
    record=records1.next();
    record.getField(0,keyString);
    record.getField(1,valueString);
    sum+=Integer.parseInt(valueString.getValue());
    LOG.debug("String_Node_Str" + keyString.getValue() + "String_Node_Str"+ valueString.getValue()+ "String_Node_Str");
  }
  LOG.debug("String_Node_Str");
  while (records2.hasNext()) {
    record=records2.next();
    record.getField(0,keyString);
    record.getField(1,valueString);
    sum-=Integer.parseInt(valueString.getValue());
    LOG.debug("String_Node_Str" + keyString.getValue() + "String_Node_Str"+ valueString.getValue()+ "String_Node_Str");
  }
  record.setField(1,new PactInteger(sum));
  LOG.debug("String_Node_Str");
  out.collect(record);
}

Fixed version (ground truth):
@Override public void coGroup(Iterator<PactRecord> records1,Iterator<PactRecord> records2,Collector out){
  int sum=0;
  LOG.debug("String_Node_Str");
  while (records1.hasNext()) {
    record=records1.next();
    keyString=record.getField(0,keyString);
    valueString=record.getField(1,valueString);
    sum+=Integer.parseInt(valueString.getValue());
    LOG.debug("String_Node_Str" + keyString.getValue() + "String_Node_Str"+ valueString.getValue()+ "String_Node_Str");
  }
  LOG.debug("String_Node_Str");
  while (records2.hasNext()) {
    record=records2.next();
    keyString=record.getField(0,keyString);
    valueString=record.getField(1,valueString);
    sum-=Integer.parseInt(valueString.getValue());
    LOG.debug("String_Node_Str" + keyString.getValue() + "String_Node_Str"+ valueString.getValue()+ "String_Node_Str");
  }
  record.setField(1,new PactInteger(sum));
  LOG.debug("String_Node_Str");
  out.collect(record);
}
Program: 55762
Project: 55762
Buggy source:
@Override public void cross(PactRecord record1,PactRecord record2,Collector out){
  record1.getField(1,string);
  int val1=Integer.parseInt(string.toString());
  record2.getField(1,string);
  int val2=Integer.parseInt(string.toString());
  record1.getField(0,string);
  int key1=Integer.parseInt(string.toString());
  record2.getField(0,string);
  int key2=Integer.parseInt(string.toString());
  LOG.debug("String_Node_Str" + key1 + "String_Node_Str"+ val1+ "String_Node_Str"+ key2+ "String_Node_Str"+ val2+ "String_Node_Str");
  if (val1 + val2 <= 6) {
    string.setValue((key1 + key2 + 2) + "String_Node_Str");
    integer.setValue(val2 - val1 + 1);
    record1.setField(0,string);
    record1.setField(1,integer);
    out.collect(record1);
  }
}

Fixed version (ground truth):
@Override public void cross(PactRecord record1,PactRecord record2,Collector out){
  string=record1.getField(1,string);
  int val1=Integer.parseInt(string.toString());
  string=record2.getField(1,string);
  int val2=Integer.parseInt(string.toString());
  string=record1.getField(0,string);
  int key1=Integer.parseInt(string.toString());
  string=record2.getField(0,string);
  int key2=Integer.parseInt(string.toString());
  LOG.debug("String_Node_Str" + key1 + "String_Node_Str"+ val1+ "String_Node_Str"+ key2+ "String_Node_Str"+ val2+ "String_Node_Str");
  if (val1 + val2 <= 6) {
    string.setValue((key1 + key2 + 2) + "String_Node_Str");
    integer.setValue(val2 - val1 + 1);
    record1.setField(0,string);
    record1.setField(1,integer);
    out.collect(record1);
  }
}
Program: 55763
Project: 55763
Buggy source:
@Override public void map(PactRecord record,Collector out) throws Exception {
  record.getField(0,keyString);
  record.getField(1,valueString);
  LOG.debug("String_Node_Str" + keyString.toString() + "String_Node_Str"+ valueString.getValue()+ "String_Node_Str");
  if (Integer.parseInt(keyString.toString()) + Integer.parseInt(valueString.toString()) < 10) {
    record.setField(0,valueString);
    record.setField(1,new PactInteger(Integer.parseInt(keyString.toString()) + 10));
    out.collect(record);
  }
}

Fixed version (ground truth):
@Override public void map(PactRecord record,Collector out) throws Exception {
  keyString=record.getField(0,keyString);
  valueString=record.getField(1,valueString);
  LOG.debug("String_Node_Str" + keyString.toString() + "String_Node_Str"+ valueString.getValue()+ "String_Node_Str");
  if (Integer.parseInt(keyString.toString()) + Integer.parseInt(valueString.toString()) < 10) {
    record.setField(0,valueString);
    record.setField(1,new PactInteger(Integer.parseInt(keyString.toString()) + 10));
    out.collect(record);
  }
}
Program: 55764
Project: 55764
Buggy source:
@Override public void match(PactRecord value1,PactRecord value2,Collector out) throws Exception {
  value1.getField(0,keyString);
  keyString.setValue("String_Node_Str" + (Integer.parseInt(keyString.getValue()) + 1));
  value1.setField(0,keyString);
  value1.getField(1,valueString);
  int val1=Integer.parseInt(valueString.getValue()) + 2;
  value2.getField(1,valueString);
  int val2=Integer.parseInt(valueString.getValue()) + 1;
  value1.setField(1,new PactInteger(val1 - val2));
  out.collect(value1);
  LOG.debug("String_Node_Str" + keyString.toString() + "String_Node_Str"+ val1+ "String_Node_Str"+ "String_Node_Str"+ keyString.toString()+ "String_Node_Str"+ val2+ "String_Node_Str");
}

Fixed version (ground truth):
@Override public void match(PactRecord value1,PactRecord value2,Collector out) throws Exception {
  keyString=value1.getField(0,keyString);
  keyString.setValue("String_Node_Str" + (Integer.parseInt(keyString.getValue()) + 1));
  value1.setField(0,keyString);
  valueString=value1.getField(1,valueString);
  int val1=Integer.parseInt(valueString.getValue()) + 2;
  valueString=value2.getField(1,valueString);
  int val2=Integer.parseInt(valueString.getValue()) + 1;
  value1.setField(1,new PactInteger(val1 - val2));
  out.collect(value1);
  LOG.debug("String_Node_Str" + keyString.toString() + "String_Node_Str"+ val1+ "String_Node_Str"+ "String_Node_Str"+ keyString.toString()+ "String_Node_Str"+ val2+ "String_Node_Str");
}
Program: 55765
Project: 55765
Buggy source:
@Override public void reduce(Iterator<PactRecord> records,Collector out) throws Exception {
  int sum=0;
  PactRecord record=new PactRecord();
  while (records.hasNext()) {
    record=records.next();
    record.getField(1,reduceValue);
    sum+=Integer.parseInt(reduceValue.toString());
    LOG.debug("String_Node_Str" + record.getField(0,PactString.class).toString() + "String_Node_Str"+ reduceValue.toString()+ "String_Node_Str");
  }
  record.setField(1,new PactInteger(sum));
  out.collect(record);
}

Fixed version (ground truth):
@Override public void reduce(Iterator<PactRecord> records,Collector out) throws Exception {
  int sum=0;
  PactRecord record=new PactRecord();
  while (records.hasNext()) {
    record=records.next();
    reduceValue=record.getField(1,reduceValue);
    sum+=Integer.parseInt(reduceValue.toString());
    LOG.debug("String_Node_Str" + record.getField(0,PactString.class).toString() + "String_Node_Str"+ reduceValue.toString()+ "String_Node_Str");
  }
  record.setField(1,new PactInteger(sum));
  out.collect(record);
}
Program: 55766
Project: 55766
Buggy source:
@Override public void combine(Iterator<PactRecord> records,Collector out) throws Exception {
  int sum=0;
  PactRecord record=new PactRecord();
  while (records.hasNext()) {
    record=records.next();
    record.getField(1,combineValue);
    sum+=Integer.parseInt(combineValue.toString());
    LOG.debug("String_Node_Str" + record.getField(0,PactString.class).toString() + "String_Node_Str"+ combineValue.toString()+ "String_Node_Str");
  }
  combineValue.setValue(sum + "String_Node_Str");
  record.setField(1,combineValue);
  out.collect(record);
}

Fixed version (ground truth):
@Override public void combine(Iterator<PactRecord> records,Collector out) throws Exception {
  int sum=0;
  PactRecord record=new PactRecord();
  while (records.hasNext()) {
    record=records.next();
    combineValue=record.getField(1,combineValue);
    sum+=Integer.parseInt(combineValue.toString());
    LOG.debug("String_Node_Str" + record.getField(0,PactString.class).toString() + "String_Node_Str"+ combineValue.toString()+ "String_Node_Str");
  }
  combineValue.setValue(sum + "String_Node_Str");
  record.setField(1,combineValue);
  out.collect(record);
}
Program: 55767
Project: 55767
Buggy source:
@Override public void reduce(Iterator<PactRecord> records,Collector out) throws Exception {
  double sum=0;
  while (records.hasNext()) {
    record=records.next();
    record.getField(0,key);
    record.getField(1,v);
    if (v.getNumberOfColumns() > 1) {
      long val=Math.round(Double.parseDouble(v.getStringValueAt(0)) * (1 - Double.parseDouble(v.getStringValueAt(1))) * 10000);
      sum+=(((double)val) / 10000d);
    }
 else {
      sum+=Double.parseDouble(v.getStringValueAt(0));
    }
  }
  Tuple summed=new Tuple();
  summed.addAttribute(FORMATTER.format(sum));
  LOGGER.info("String_Node_Str" + key);
  record.setField(1,summed);
  out.collect(record);
}

Fixed version (ground truth):
@Override public void reduce(Iterator<PactRecord> records,Collector out) throws Exception {
  double sum=0;
  while (records.hasNext()) {
    record=records.next();
    key=record.getField(0,key);
    v=record.getField(1,v);
    if (v.getNumberOfColumns() > 1) {
      long val=Math.round(Double.parseDouble(v.getStringValueAt(0)) * (1 - Double.parseDouble(v.getStringValueAt(1))) * 10000);
      sum+=(((double)val) / 10000d);
    }
 else {
      sum+=Double.parseDouble(v.getStringValueAt(0));
    }
  }
  Tuple summed=new Tuple();
  summed.addAttribute(FORMATTER.format(sum));
  LOGGER.info("String_Node_Str" + key);
  record.setField(1,summed);
  out.collect(record);
}
Program: 55768
Project: 55768
Buggy source:
@Override public void map(PactRecord record,Collector out) throws Exception {
  record.getField(1,tuple);
  tuple.project(2);
  record.setField(1,tuple);
  out.collect(record);
}

Fixed version (ground truth):
@Override public void map(PactRecord record,Collector out) throws Exception {
  tuple=record.getField(1,tuple);
  tuple.project(2);
  record.setField(1,tuple);
  out.collect(record);
}
Program: 55769
Project: 55769
Buggy source:
/** 
 * Project "partsupp". Output Schema: Key: partkey Value: (suppkey, supplycost)
 */
@Override public void map(PactRecord record,Collector out) throws Exception {
  record.getField(1,inputTuple);
  inputTuple.project((0 << 0) | (1 << 1) | (0 << 2)| (1 << 3)| (0 << 4));
  record.setField(1,inputTuple);
  out.collect(record);
}

Fixed version (ground truth):
/** 
 * Project "partsupp". Output Schema: Key: partkey Value: (suppkey, supplycost)
 */
@Override public void map(PactRecord record,Collector out) throws Exception {
  inputTuple=record.getField(1,inputTuple);
  inputTuple.project((0 << 0) | (1 << 1) | (0 << 2)| (1 << 3)| (0 << 4));
  record.setField(1,inputTuple);
  out.collect(record);
}
Program: 55770
Project: 55770
Buggy source:
@Override public void writeRecord(PactRecord record) throws IOException {
  record.getField(0,key);
  record.getField(1,value);
  this.buffer.setLength(0);
  this.buffer.append(key.getFirst().toString());
  this.buffer.append('|');
  this.buffer.append(key.getSecond().toString());
  this.buffer.append('|');
  this.buffer.append(value.toString());
  this.buffer.append('\n');
  byte[] bytes=this.buffer.toString().getBytes();
  this.stream.write(bytes);
}

Fixed version (ground truth):
@Override public void writeRecord(PactRecord record) throws IOException {
  key=record.getField(0,key);
  value=record.getField(1,value);
  this.buffer.setLength(0);
  this.buffer.append(key.getFirst().toString());
  this.buffer.append('|');
  this.buffer.append(key.getSecond().toString());
  this.buffer.append('|');
  this.buffer.append(value.toString());
  this.buffer.append('\n');
  byte[] bytes=this.buffer.toString().getBytes();
  this.stream.write(bytes);
}
Program: 55771
Project: 55771
Buggy source:
/** 
 * Project "supplier". Output Schema: Key: nationkey Value: suppkey
 */
@Override public void map(PactRecord record,Collector out) throws Exception {
  record.getField(0,suppKey);
  record.getField(1,inputTuple);
  PactInteger nationKey=new PactInteger(Integer.parseInt(inputTuple.getStringValueAt(3)));
  record.setField(0,nationKey);
  record.setField(1,suppKey);
  out.collect(record);
}

Fixed version (ground truth):
/** 
 * Project "supplier". Output Schema: Key: nationkey Value: suppkey
 */
@Override public void map(PactRecord record,Collector out) throws Exception {
  suppKey=record.getField(0,suppKey);
  inputTuple=record.getField(1,inputTuple);
  PactInteger nationKey=new PactInteger(Integer.parseInt(inputTuple.getStringValueAt(3)));
  record.setField(0,nationKey);
  record.setField(1,suppKey);
  out.collect(record);
}
Program: 55772
Project: 55772
Buggy source:
/** 
 * Join "nation" and "supplier" by "nationkey". Output Schema: Key: suppkey Value: "nation" (name of the nation)
 */
@Override public void match(PactRecord value1,PactRecord value2,Collector out) throws Exception {
  value1.getField(1,suppKey);
  value2.getField(1,nationVal);
  PactString nationName=new PactString(nationVal.getStringValueAt(1));
  value1.setField(0,suppKey);
  value1.setField(1,nationName);
  out.collect(value1);
}

Fixed version (ground truth):
/** 
 * Join "nation" and "supplier" by "nationkey". Output Schema: Key: suppkey Value: "nation" (name of the nation)
 */
@Override public void match(PactRecord value1,PactRecord value2,Collector out) throws Exception {
  suppKey=value1.getField(1,suppKey);
  nationVal=value2.getField(1,nationVal);
  PactString nationName=new PactString(nationVal.getStringValueAt(1));
  value1.setField(0,suppKey);
  value1.setField(1,nationName);
  out.collect(value1);
}
Program: 55773
Project: 55773
Buggy source:
/** 
 * Compute the new position (coordinate vector) of a cluster center.
 */
@Override public void reduce(Iterator<PactRecord> dataPoints,Collector out){
  PactRecord next=null;
  this.coordinates.setCoordinates(null);
  double[] coordinateSum=null;
  int count=0;
  while (dataPoints.hasNext()) {
    next=dataPoints.next();
    double[] thisCoords=next.getField(1,CoordVector.class).getCoordinates();
    int thisCount=next.getField(2,PactInteger.class).getValue();
    if (coordinateSum == null) {
      if (this.coordinates.getCoordinates() != null) {
        coordinateSum=this.coordinates.getCoordinates();
      }
 else {
        coordinateSum=new double[thisCoords.length];
      }
    }
    addToCoordVector(coordinateSum,thisCoords);
    count+=thisCount;
  }
  for (int i=0; i < coordinateSum.length; i++) {
    coordinateSum[i]/=count;
  }
  this.coordinates.setCoordinates(coordinateSum);
  next.setField(1,this.coordinates);
  out.collect(next);
}

Fixed version (ground truth):
/** 
 * Compute the new position (coordinate vector) of a cluster center.
 */
@Override public void reduce(Iterator<PactRecord> dataPoints,Collector out){
  PactRecord next=null;
  CoordVector coordinates=new CoordVector();
  double[] coordinateSum=null;
  int count=0;
  while (dataPoints.hasNext()) {
    next=dataPoints.next();
    double[] thisCoords=next.getField(1,CoordVector.class).getCoordinates();
    int thisCount=next.getField(2,PactInteger.class).getValue();
    if (coordinateSum == null) {
      if (coordinates.getCoordinates() != null) {
        coordinateSum=coordinates.getCoordinates();
      }
 else {
        coordinateSum=new double[thisCoords.length];
      }
    }
    addToCoordVector(coordinateSum,thisCoords);
    count+=thisCount;
  }
  for (int i=0; i < coordinateSum.length; i++) {
    coordinateSum[i]/=count;
  }
  coordinates.setCoordinates(coordinateSum);
  next.setField(1,coordinates);
  out.collect(next);
}
Program: 55774
Project: 55774
Buggy source:
/** 
 * Computes a pre-aggregated average value of a coordinate vector.
 */
@Override public void combine(Iterator<PactRecord> dataPoints,Collector out){
  PactRecord next=null;
  this.coordinates.setCoordinates(null);
  double[] coordinateSum=null;
  int count=0;
  while (dataPoints.hasNext()) {
    next=dataPoints.next();
    double[] thisCoords=next.getField(1,CoordVector.class).getCoordinates();
    int thisCount=next.getField(2,PactInteger.class).getValue();
    if (coordinateSum == null) {
      if (this.coordinates.getCoordinates() != null) {
        coordinateSum=this.coordinates.getCoordinates();
      }
 else {
        coordinateSum=new double[thisCoords.length];
      }
    }
    addToCoordVector(coordinateSum,thisCoords);
    count+=thisCount;
  }
  this.coordinates.setCoordinates(coordinateSum);
  this.count.setValue(count);
  next.setField(1,this.coordinates);
  next.setField(2,this.count);
  out.collect(next);
}

Fixed version (ground truth):
/** 
 * Computes a pre-aggregated average value of a coordinate vector.
 */
@Override public void combine(Iterator<PactRecord> dataPoints,Collector out){
  PactRecord next=null;
  CoordVector coordinates=new CoordVector();
  double[] coordinateSum=null;
  int count=0;
  while (dataPoints.hasNext()) {
    next=dataPoints.next();
    double[] thisCoords=next.getField(1,CoordVector.class).getCoordinates();
    int thisCount=next.getField(2,PactInteger.class).getValue();
    if (coordinateSum == null) {
      if (coordinates.getCoordinates() != null) {
        coordinateSum=coordinates.getCoordinates();
      }
 else {
        coordinateSum=new double[thisCoords.length];
      }
    }
    addToCoordVector(coordinateSum,thisCoords);
    count+=thisCount;
  }
  coordinates.setCoordinates(coordinateSum);
  this.count.setValue(count);
  next.setField(1,coordinates);
  next.setField(2,this.count);
  out.collect(next);
}
Program: 55775
Project: 55775
Buggy source:
/** 
 * Compute the new position (coordinate vector) of a cluster center.
 */
@Override public void reduce(Iterator<PactRecord> dataPoints,Collector out){
  this.coordinates.setCoordinates(null);
  double[] coordinateSum=null;
  int count=0;
  while (dataPoints.hasNext()) {
    PactRecord next=dataPoints.next();
    next.getField(0,cid);
    double[] thisCoords=next.getField(1,CoordVector.class).getCoordinates();
    int thisCount=next.getField(2,PactInteger.class).getValue();
    if (coordinateSum == null) {
      if (this.coordinates.getCoordinates() != null) {
        coordinateSum=this.coordinates.getCoordinates();
      }
 else {
        coordinateSum=new double[thisCoords.length];
      }
    }
    addToCoordVector(coordinateSum,thisCoords);
    count+=thisCount;
  }
  for (int i=0; i < coordinateSum.length; i++) {
    coordinateSum[i]/=count;
  }
  this.coordinates.setCoordinates(coordinateSum);
  result.setField(0,cid);
  result.setField(1,this.coordinates);
  out.collect(result);
}

Fixed version (ground truth):
/** 
 * Compute the new position (coordinate vector) of a cluster center.
 */
@Override public void reduce(Iterator<PactRecord> dataPoints,Collector out){
  PactRecord next=null;
  this.coordinates.setCoordinates(null);
  double[] coordinateSum=null;
  int count=0;
  while (dataPoints.hasNext()) {
    next=dataPoints.next();
    double[] thisCoords=next.getField(1,CoordVector.class).getCoordinates();
    int thisCount=next.getField(2,PactInteger.class).getValue();
    if (coordinateSum == null) {
      if (this.coordinates.getCoordinates() != null) {
        coordinateSum=this.coordinates.getCoordinates();
      }
 else {
        coordinateSum=new double[thisCoords.length];
      }
    }
    addToCoordVector(coordinateSum,thisCoords);
    count+=thisCount;
  }
  for (int i=0; i < coordinateSum.length; i++) {
    coordinateSum[i]/=count;
  }
  this.coordinates.setCoordinates(coordinateSum);
  next.setField(1,this.coordinates);
  out.collect(next);
}