nus-yam/ex-repair huggingface dataset:
Program: 87921
Project: 87921
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: 87922
Project: 87922
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: 87923
Project: 87923
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: 87924
Project: 87924
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: 87925
Project: 87925
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: 87927
Project: 87927
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: 87929
Project: 87929
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: 87930
Project: 87930
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: 87931
Project: 87931
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: 87932
Project: 87932
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: 87933
Project: 87933
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: 87934
Project: 87934
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: 87935
Project: 87935
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: 87936
Project: 87936
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: 87937
Project: 87937
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: 87938
Project: 87938
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: 87939
Project: 87939
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: 87940
Project: 87940
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: 87941
Project: 87941
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: 87942
Project: 87942
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: 87943
Project: 87943
Buggy source:
public void refreshEdgeLatency(PathLatency pathLatency){
}

Fixed version (ground truth):
public void refreshEdgeLatency(PathLatency pathLatency){
  LOG.info("String_Node_Str" + pathLatency);
}
Program: 87944
Project: 87944
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: 87945
Project: 87945
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: 87946
Project: 87946
Buggy source:
public ManagementVertex getEnd(){
  return pathVertices.getFirst();
}

Fixed version (ground truth):
public ManagementVertex getEnd(){
  return pathVertices.getLast();
}
Program: 87947
Project: 87947
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: 87948
Project: 87948
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: 87949
Project: 87949
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: 87950
Project: 87950
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: 87951
Project: 87951
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: 87952
Project: 87952
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: 87953
Project: 87953
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: 87954
Project: 87954
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: 87955
Project: 87955
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: 87956
Project: 87956
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: 87957
Project: 87957
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: 87958
Project: 87958
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: 87959
Project: 87959
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: 87960
Project: 87960
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: 87961
Project: 87961
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: 87962
Project: 87962
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: 87963
Project: 87963
Buggy source:
boolean canBeAdded(final TransferEnvelope transferEnvelope){
  if (this.tailSequenceNumber == -1) {
    return true;
  }
  final EventList eventList=transferEnvelope.getEventList();
  if (eventList != null) {
    if (!eventList.isEmpty()) {
      return false;
    }
  }
  if (!this.jobID.equals(transferEnvelope.getJobID())) {
    return false;
  }
  if (!this.source.equals(transferEnvelope.getSource())) {
    return false;
  }
  if (this.tailSequenceNumber != (transferEnvelope.getSequenceNumber() - 1)) {
    return false;
  }
  return true;
}

Fixed version (ground truth):
boolean canBeAdded(final TransferEnvelope transferEnvelope){
  if (this.tailSequenceNumber == -1) {
    return true;
  }
  final EventList eventList=transferEnvelope.getEventList();
  if (eventList != null) {
    if (!eventList.isEmpty()) {
      return false;
    }
  }
  if (!this.jobID.equals(transferEnvelope.getJobID())) {
    return false;
  }
  if (!this.source.equals(transferEnvelope.getSource())) {
    return false;
  }
  if (this.tailSequenceNumber != (transferEnvelope.getSequenceNumber() - 1)) {
    return false;
  }
  if (this.size() >= SIZE_LIMIT) {
    return false;
  }
  return true;
}
Program: 87964
Project: 87964
Buggy source:
int unspill(final BufferProvider bufferProvider) throws IOException {
  if (this.headSequenceNumber == -1) {
    return 0;
  }
  if (this.headSequenceNumber == this.tailSequenceNumber) {
    final Buffer buffer=(Buffer)this.bufferRef;
    if (buffer == null) {
      return 0;
    }
    if (buffer.isBackedByMemory()) {
      return 0;
    }
    final int size=buffer.size();
    final Buffer memBuffer=bufferProvider.requestEmptyBuffer(size);
    if (memBuffer == null) {
      return 0;
    }
    buffer.copyToBuffer(memBuffer);
    this.bufferRef=memBuffer;
    buffer.recycleBuffer();
    return size;
  }
  @SuppressWarnings("String_Node_Str") final Queue<Object> bufferQueue=(Queue<Object>)this.bufferRef;
  final int queueSize=bufferQueue.size();
  int usedMemory=0;
  int count=0;
  while (count++ < queueSize) {
    final Object obj=bufferQueue.poll();
    if (obj == NULL_OBJECT) {
      bufferQueue.add(obj);
      continue;
    }
    final Buffer buffer=(Buffer)obj;
    if (buffer.isBackedByMemory()) {
      bufferQueue.add(buffer);
      continue;
    }
    final int size=buffer.size();
    final Buffer memBuffer=bufferProvider.requestEmptyBuffer(size);
    if (memBuffer != null) {
      buffer.copyToBuffer(memBuffer);
      bufferQueue.add(memBuffer);
      buffer.recycleBuffer();
    }
 else {
      bufferQueue.add(buffer);
      return usedMemory;
    }
    usedMemory+=size;
  }
  return usedMemory;
}

Fixed version (ground truth):
int unspill(final BufferProvider bufferProvider) throws IOException {
  if (this.headSequenceNumber == -1) {
    return 0;
  }
  if (this.headSequenceNumber == this.tailSequenceNumber) {
    final Buffer buffer=(Buffer)this.bufferRef;
    if (buffer == null) {
      return 0;
    }
    if (buffer.isBackedByMemory()) {
      return 0;
    }
    final int size=buffer.size();
    final Buffer memBuffer=bufferProvider.requestEmptyBuffer(size);
    if (memBuffer == null) {
      return 0;
    }
    buffer.copyToBuffer(memBuffer);
    this.bufferRef=memBuffer;
    buffer.recycleBuffer();
    return size;
  }
  @SuppressWarnings("String_Node_Str") final Queue<Object> bufferQueue=(Queue<Object>)this.bufferRef;
  final int queueSize=bufferQueue.size();
  int usedMemory=0;
  int count=0;
  while (count++ < queueSize) {
    final Object obj=bufferQueue.poll();
    if (obj == NULL_OBJECT) {
      bufferQueue.add(obj);
      continue;
    }
    final Buffer buffer=(Buffer)obj;
    if (buffer.isBackedByMemory()) {
      bufferQueue.add(buffer);
      continue;
    }
    final int size=buffer.size();
    final Buffer memBuffer=bufferProvider.requestEmptyBuffer(size);
    if (memBuffer != null) {
      buffer.copyToBuffer(memBuffer);
      bufferQueue.add(memBuffer);
      buffer.recycleBuffer();
    }
 else {
      bufferQueue.add(buffer);
      continue;
    }
    usedMemory+=size;
  }
  return usedMemory;
}
Program: 87965
Project: 87965
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);
}
Program: 87966
Project: 87966
Buggy source:
/** 
 * Computes the distance of one data point to one cluster center and emits a key-value-pair where the id of the data point is the key and a Distance object is the value.
 */
@Override public void cross(PactRecord dataPointRecord,PactRecord clusterCenterRecord,Collector out){
  dataPointRecord.getField(1,dataPoint);
  clusterCenterRecord.getField(0,clusterCenterId);
  clusterCenterRecord.getField(1,clusterPoint);
  this.distance.setValue(dataPoint.computeEuclidianDistance(clusterPoint));
  dataPointRecord.setField(2,clusterCenterId);
  dataPointRecord.setField(3,this.distance);
  out.collect(dataPointRecord);
}

Fixed version (ground truth):
/** 
 * Computes the distance of one data point to one cluster center and emits a key-value-pair where the id of the data point is the key and a Distance object is the value.
 */
@Override public void cross(PactRecord dataPointRecord,PactRecord clusterCenterRecord,Collector out){
  CoordVector dataPoint=dataPointRecord.getField(1,CoordVector.class);
  PactInteger clusterCenterId=clusterCenterRecord.getField(0,PactInteger.class);
  CoordVector clusterPoint=clusterCenterRecord.getField(1,CoordVector.class);
  this.distance.setValue(dataPoint.computeEuclidianDistance(clusterPoint));
  dataPointRecord.setField(2,clusterCenterId);
  dataPointRecord.setField(3,this.distance);
  out.collect(dataPointRecord);
}
Program: 87967
Project: 87967
Buggy source:
@Override public int serializeRecord(PactRecord record,byte[] target){
  record.getField(0,this.centerId);
  record.getField(1,this.centerPos);
  StringBuilder line=new StringBuilder();
  line.append(this.centerId.getValue());
  for (  double coord : this.centerPos.getCoordinates()) {
    line.append('|');
    line.append(df.format(coord));
  }
  line.append('|');
  byte[] byteString=line.toString().getBytes();
  if (byteString.length <= target.length) {
    System.arraycopy(byteString,0,target,0,byteString.length);
    return byteString.length;
  }
 else {
    return -1 * byteString.length;
  }
}

Fixed version (ground truth):
@Override public int serializeRecord(PactRecord record,byte[] target){
  line.setLength(0);
  PactInteger centerId=record.getField(0,PactInteger.class);
  CoordVector centerPos=record.getField(1,CoordVector.class);
  line.append(centerId.getValue());
  for (  double coord : centerPos.getCoordinates()) {
    line.append('|');
    line.append(df.format(coord));
  }
  line.append('|');
  byte[] byteString=line.toString().getBytes();
  if (byteString.length <= target.length) {
    System.arraycopy(byteString,0,target,0,byteString.length);
    return byteString.length;
  }
 else {
    return -byteString.length;
  }
}
Program: 87968
Project: 87968
Buggy source:
/** 
 * Computes a pre-aggregated average value of a coordinate vector.
 */
@Override public void combine(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;
  }
  this.coordinates.setCoordinates(coordinateSum);
  this.count.setValue(count);
  result.setField(0,cid);
  result.setField(1,this.coordinates);
  result.setField(2,this.count);
  out.collect(result);
}

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;
  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);
}