nus-yam/ex-repair huggingface dataset:
Program: 87969
Project: 87969
Buggy source:
/** 
 * Aggregate "amount": sum(amount) GROUP BY nation, year Output Schema: Key: (nation, year) Value: amount
 */
@Override public void reduce(Iterator<PactRecord> records,Collector out) throws Exception {
  float amount=0;
  while (records.hasNext()) {
    record=records.next();
    record.getField(1,value);
    amount+=Float.parseFloat(value.toString());
  }
  if (value != null) {
    value.setValue("String_Node_Str" + amount);
    record.setField(1,value);
    out.collect(record);
  }
}

Fixed version (ground truth):
/** 
 * Aggregate "amount": sum(amount) GROUP BY nation, year Output Schema: Key: (nation, year) Value: amount
 */
@Override public void reduce(Iterator<PactRecord> records,Collector out) throws Exception {
  PactRecord record=null;
  float amount=0;
  while (records.hasNext()) {
    record=records.next();
    PactString value=record.getField(1,PactString.class);
    amount+=Float.parseFloat(value.toString());
  }
  value.setValue(String.valueOf(amount));
  record.setField(1,value);
  out.collect(record);
}
Program: 87970
Project: 87970
Buggy source:
/** 
 * Join together parts and orderedParts by matching partkey and suppkey. Output Schema: Key: suppkey Value: (amount, year)
 */
@Override public void match(PactRecord value1,PactRecord value2,Collector out) throws Exception {
  value1.getField(0,partAndSupplierKey);
  value1.getField(1,supplyCostStr);
  value2.getField(1,ordersValue);
  PactInteger year=new PactInteger(Integer.parseInt(ordersValue.getStringValueAt(0)));
  float quantity=Float.parseFloat(ordersValue.getStringValueAt(1));
  float price=Float.parseFloat(ordersValue.getStringValueAt(2));
  float supplyCost=Float.parseFloat(supplyCostStr.toString());
  float amount=price - supplyCost * quantity;
  value1.setField(0,partAndSupplierKey.getSecond());
  value1.setField(1,new StringIntPair(new PactString("String_Node_Str" + amount),year));
  out.collect(value1);
}

Fixed version (ground truth):
/** 
 * Join together parts and orderedParts by matching partkey and suppkey. Output Schema: Key: suppkey Value: (amount, year)
 */
@Override public void match(PactRecord value1,PactRecord value2,Collector out) throws Exception {
  IntPair partAndSupplierKey=value1.getField(0,this.partAndSupplierKey);
  PactString supplyCostStr=value1.getField(1,this.supplyCostStr);
  Tuple ordersValue=value2.getField(1,this.ordersValue);
  PactInteger year=new PactInteger(Integer.parseInt(ordersValue.getStringValueAt(0)));
  float quantity=Float.parseFloat(ordersValue.getStringValueAt(1));
  float price=Float.parseFloat(ordersValue.getStringValueAt(2));
  float supplyCost=Float.parseFloat(supplyCostStr.toString());
  float amount=price - supplyCost * quantity;
  value1.setField(0,partAndSupplierKey.getSecond());
  value1.setField(1,new StringIntPair(new PactString("String_Node_Str" + amount),year));
  out.collect(value1);
}
Program: 87971
Project: 87971
Buggy source:
/** 
 * Filter "lineitem". Output Schema: Key: orderkey Value: (partkey, suppkey, quantity, price)
 */
@Override public void map(PactRecord record,Collector out) throws Exception {
  record.getField(1,inputTuple);
  float price=Float.parseFloat(inputTuple.getStringValueAt(5)) * (1 - Float.parseFloat(inputTuple.getStringValueAt(6)));
  inputTuple.project((0 << 0) | (1 << 1) | (1 << 2)| (0 << 3)| (1 << 4));
  inputTuple.addAttribute("String_Node_Str" + price);
  record.setField(1,inputTuple);
  out.collect(record);
}

Fixed version (ground truth):
/** 
 * Filter "lineitem". Output Schema: Key: orderkey Value: (partkey, suppkey, quantity, price)
 */
@Override public void map(PactRecord record,Collector out) throws Exception {
  Tuple inputTuple=record.getField(1,Tuple.class);
  float price=Float.parseFloat(inputTuple.getStringValueAt(5)) * (1 - Float.parseFloat(inputTuple.getStringValueAt(6)));
  inputTuple.project((0 << 0) | (1 << 1) | (1 << 2)| (0 << 3)| (1 << 4));
  inputTuple.addAttribute("String_Node_Str" + price);
  record.setField(1,inputTuple);
  out.collect(record);
}
Program: 87972
Project: 87972
Buggy source:
/** 
 * Project "orders" Output Schema: Key: orderkey Value: year (from date)
 */
@Override public void map(PactRecord record,Collector out) throws Exception {
  record.getField(1,inputTuple);
  int year=Integer.parseInt(inputTuple.getStringValueAt(4).substring(0,4));
  record.setField(1,new PactInteger(year));
  out.collect(record);
}

Fixed version (ground truth):
/** 
 * Project "orders" Output Schema: Key: orderkey Value: year (from date)
 */
@Override public void map(PactRecord record,Collector out) throws Exception {
  Tuple inputTuple=record.getField(1,this.inputTuple);
  int year=Integer.parseInt(inputTuple.getStringValueAt(4).substring(0,4));
  record.setField(1,new PactInteger(year));
  out.collect(record);
}
Program: 87973
Project: 87973
Buggy source:
/** 
 * Join "orders" and "lineitem" by "orderkey". Output Schema: Key: (partkey, suppkey) Value: (year, quantity, price)
 */
@Override public void match(PactRecord value1,PactRecord value2,Collector out) throws Exception {
  value1.getField(1,year);
  value2.getField(1,lineItem);
  IntPair newKey=new IntPair(new PactInteger(Integer.parseInt(lineItem.getStringValueAt(0))),new PactInteger(Integer.parseInt(lineItem.getStringValueAt(1))));
  Tuple newValue=new Tuple();
  newValue.addAttribute(year.toString());
  newValue.addAttribute(lineItem.getStringValueAt(2));
  newValue.addAttribute(lineItem.getStringValueAt(3));
  value1.setField(0,newKey);
  value1.setField(1,newValue);
  out.collect(value1);
}

Fixed version (ground truth):
/** 
 * Join "orders" and "lineitem" by "orderkey". Output Schema: Key: (partkey, suppkey) Value: (year, quantity, price)
 */
@Override public void match(PactRecord value1,PactRecord value2,Collector out) throws Exception {
  PactInteger year=value1.getField(1,PactInteger.class);
  Tuple lineItem=value2.getField(1,Tuple.class);
  IntPair newKey=new IntPair(new PactInteger(Integer.parseInt(lineItem.getStringValueAt(0))),new PactInteger(Integer.parseInt(lineItem.getStringValueAt(1))));
  Tuple newValue=new Tuple();
  newValue.addAttribute(year.toString());
  newValue.addAttribute(lineItem.getStringValueAt(2));
  newValue.addAttribute(lineItem.getStringValueAt(3));
  value1.setField(0,newKey);
  value1.setField(1,newValue);
  out.collect(value1);
}
Program: 87974
Project: 87974
Buggy source:
/** 
 * Filter and project "part". The parts are filtered by "name LIKE %green%". Output Schema: Key: partkey Value: (empty)
 */
@Override public void map(PactRecord record,Collector out) throws Exception {
  record.getField(1,inputTuple);
  if (inputTuple.getStringValueAt(1).indexOf(COLOR) != -1) {
    record.setField(1,PactNull.getInstance());
    out.collect(record);
  }
}

Fixed version (ground truth):
/** 
 * Filter and project "part". The parts are filtered by "name LIKE %green%". Output Schema: Key: partkey Value: (empty)
 */
@Override public void map(PactRecord record,Collector out) throws Exception {
  Tuple inputTuple=record.getField(1,this.inputTuple);
  if (inputTuple.getStringValueAt(1).indexOf(COLOR) != -1) {
    record.setField(1,PactNull.getInstance());
    out.collect(record);
  }
}
Program: 87975
Project: 87975
Buggy source:
/** 
 * Join "part" and "partsupp" by "partkey". Output Schema: Key: (partkey, suppkey) Value: supplycost
 */
@Override public void match(PactRecord value1,PactRecord value2,Collector out) throws Exception {
  value1.getField(0,partKey);
  value2.getField(1,partSuppValue);
  IntPair newKey=new IntPair(partKey,new PactInteger(Integer.parseInt(partSuppValue.getStringValueAt(0))));
  String supplyCost=partSuppValue.getStringValueAt(1);
  value1.setField(0,newKey);
  value1.setField(1,new PactString(supplyCost));
  out.collect(value1);
}

Fixed version (ground truth):
/** 
 * Join "part" and "partsupp" by "partkey". Output Schema: Key: (partkey, suppkey) Value: supplycost
 */
@Override public void match(PactRecord value1,PactRecord value2,Collector out) throws Exception {
  PactInteger partKey=value1.getField(0,this.partKey);
  Tuple partSuppValue=value2.getField(1,this.partSuppValue);
  IntPair newKey=new IntPair(partKey,new PactInteger(Integer.parseInt(partSuppValue.getStringValueAt(0))));
  String supplyCost=partSuppValue.getStringValueAt(1);
  value1.setField(0,newKey);
  value1.setField(1,new PactString(supplyCost));
  out.collect(value1);
}
Program: 87976
Project: 87976
Buggy source:
/** 
 * Join "filteredParts" and "suppliers" by "suppkey". Output Schema: Key: (nation, year) Value: amount
 */
@Override public void match(PactRecord value1,PactRecord value2,Collector out) throws Exception {
  value1.getField(1,amountYearPair);
  value2.getField(1,nationName);
  PactInteger year=amountYearPair.getSecond();
  PactString amount=amountYearPair.getFirst();
  StringIntPair key=new StringIntPair(nationName,year);
  value1.setField(0,key);
  value1.setField(1,amount);
  out.collect(value1);
}

Fixed version (ground truth):
/** 
 * Join "filteredParts" and "suppliers" by "suppkey". Output Schema: Key: (nation, year) Value: amount
 */
@Override public void match(PactRecord value1,PactRecord value2,Collector out) throws Exception {
  StringIntPair amountYearPair=value1.getField(1,this.amountYearPair);
  PactString nationName=value2.getField(1,this.nationName);
  PactInteger year=amountYearPair.getSecond();
  PactString amount=amountYearPair.getFirst();
  StringIntPair key=new StringIntPair(nationName,year);
  value1.setField(0,key);
  value1.setField(1,amount);
  out.collect(value1);
}
Program: 87978
Project: 87978
Buggy source:
private CombinerThread(AsynchronousPartialSorterCollector sorter,int[] keyPositions,Class<? extends Key>[] keyClasses,ReduceStub stub,Collector output){
  super("String_Node_Str");
  setDaemon(true);
  this.sorter=sorter;
  this.keyPositions=keyPositions;
  this.keyClasses=keyClasses;
  this.stub=stub;
  this.output=output;
}

Fixed version (ground truth):
private CombinerThread(AsynchronousPartialSorterCollector sorter,int[] keyPositions,Class<? extends Key>[] keyClasses,ReduceStub stub,Collector output){
  super("String_Node_Str");
  setDaemon(true);
  this.sorter=sorter;
  this.keyPositions=keyPositions;
  this.keyClasses=keyClasses;
  this.stub=stub;
  this.output=output;
  this.running=true;
}
Program: 87979
Project: 87979
Buggy source:
protected ThreadBase getReadingThread(ExceptionHandler<IOException> exceptionHandler,MutableObjectIterator<PactRecord> reader,CircularQueues queues,AbstractTask parentTask,long startSpillingBytes){
  this.collector=new InputDataCollector(queues,startSpillingBytes);
  return new DummyThread(exceptionHandler,queues,parentTask);
}

Fixed version (ground truth):
@Override protected ThreadBase getReadingThread(ExceptionHandler<IOException> exceptionHandler,MutableObjectIterator<PactRecord> reader,CircularQueues queues,AbstractInvokable parentTask,long startSpillingBytes){
  this.collector=new InputDataCollector(queues,startSpillingBytes);
  return new DummyThread(exceptionHandler,queues,parentTask);
}
Program: 87980
Project: 87980
Buggy source:
/** 
 * This method step over all inputs recursively and combines all alternatives per input with all other alternative of all other inputs.
 * @param inPlans		all alternative plans for all incoming connections (which are unioned)
 * @param predList		list of currently chosen alternative plans (has one entry for each incoming connection)[this list is build up recursively within the method]
 * @param estimator		the cost estimator
 * @param alternativeSubPlans	all generated alternative for this node
 */
@SuppressWarnings("String_Node_Str") final protected void getAlternativeSubPlanCombinationsRecursively(List<? extends OptimizerNode>[] inPlans,ArrayList<OptimizerNode> predList,List<List<OptimizerNode>> alternativeSubPlans){
  final int inputNumberToProcess=predList.size();
  final int numberOfAlternatives=inPlans[inputNumberToProcess].size();
  for (int i=0; i < numberOfAlternatives; ++i) {
    predList.add(inPlans[inputNumberToProcess].get(i));
    if (inputNumberToProcess + 1 == inPlans.length) {
      alternativeSubPlans.add(predList);
      predList=(ArrayList<OptimizerNode>)predList.clone();
    }
 else {
      getAlternativeSubPlanCombinationsRecursively(inPlans,predList,alternativeSubPlans);
    }
    predList.remove(inputNumberToProcess);
  }
}

Fixed version (ground truth):
/** 
 * This method step over all inputs recursively and combines all alternatives per input with all other alternative of all other inputs.
 * @param inPlans		all alternative plans for all incoming connections (which are unioned)
 * @param predList		list of currently chosen alternative plans (has one entry for each incoming connection)[this list is build up recursively within the method]
 * @param estimator		the cost estimator
 * @param alternativeSubPlans	all generated alternative for this node
 */
@SuppressWarnings("String_Node_Str") final protected void getAlternativeSubPlanCombinationsRecursively(List<? extends OptimizerNode>[] inPlans,ArrayList<OptimizerNode> predList,List<List<OptimizerNode>> alternativeSubPlans){
  final int inputNumberToProcess=predList.size();
  final int numberOfAlternatives=inPlans[inputNumberToProcess].size();
  for (int i=0; i < numberOfAlternatives; ++i) {
    predList.add(inPlans[inputNumberToProcess].get(i));
    if (inputNumberToProcess + 1 == inPlans.length) {
      alternativeSubPlans.add((ArrayList<OptimizerNode>)predList.clone());
    }
 else {
      getAlternativeSubPlanCombinationsRecursively(inPlans,predList,alternativeSubPlans);
    }
    predList.remove(inputNumberToProcess);
  }
}
Program: 87983
Project: 87983
Buggy source:
@SuppressWarnings("String_Node_Str") private final <K extends Key,V extends Value>RecordReader<KeyValuePair<K,V>> getReader1(){
  return (RecordReader<KeyValuePair<K,V>>)this.reader1;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private final <K extends Key,V extends Value>Reader<KeyValuePair<K,V>> getReader1(){
  return (Reader<KeyValuePair<K,V>>)this.reader1;
}
Program: 87984
Project: 87984
Buggy source:
@SuppressWarnings("String_Node_Str") private final <K extends Key,V extends Value>RecordReader<KeyValuePair<K,V>> getReader2(){
  return (RecordReader<KeyValuePair<K,V>>)this.reader2;
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") private final <K extends Key,V extends Value>Reader<KeyValuePair<K,V>> getReader2(){
  return (Reader<KeyValuePair<K,V>>)this.reader2;
}
Program: 87986
Project: 87986
Buggy source:
void shareInstancesWith(final ExecutionGroupVertex groupVertex) throws GraphConversionException {
  if (userDefinedVertexToShareInstancesWith && this.vertexToShareInstancesWith != null) {
    throw new GraphConversionException("String_Node_Str");
  }
  if (groupVertex == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final ExecutionGroupVertex oldVertex=this.vertexToShareInstancesWith.getAndSet(groupVertex);
  if (oldVertex != null) {
    oldVertex.removeFromVerticesSharingInstances(this);
  }
  groupVertex.addToVerticesSharingInstances(this);
  reassignInstances();
  this.executionGraph.repairInstanceAssignment();
}

Fixed version (ground truth):
void shareInstancesWith(final ExecutionGroupVertex groupVertex) throws GraphConversionException {
  if (userDefinedVertexToShareInstancesWith && this.vertexToShareInstancesWith.get() != null) {
    throw new GraphConversionException("String_Node_Str");
  }
  if (groupVertex == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  final ExecutionGroupVertex oldVertex=this.vertexToShareInstancesWith.getAndSet(groupVertex);
  if (oldVertex != null) {
    oldVertex.removeFromVerticesSharingInstances(this);
  }
  groupVertex.addToVerticesSharingInstances(this);
  reassignInstances();
  this.executionGraph.repairInstanceAssignment();
}
Program: 87987
Project: 87987
Buggy source:
private List<AllocatedResource> collectAvailableResources(){
  List<AllocatedResource> availableResources;
  if (this.vertexToShareInstancesWith != null) {
    availableResources=this.vertexToShareInstancesWith.get().collectAvailableResources();
  }
 else {
    availableResources=new ArrayList<AllocatedResource>();
synchronized (this.groupMembers) {
      final Iterator<ExecutionVertex> it=this.groupMembers.iterator();
      while (it.hasNext()) {
        final ExecutionVertex vertex=it.next();
        final AllocatedResource allocatedResource=vertex.getAllocatedResource();
        if (allocatedResource != null) {
          if (!availableResources.contains(allocatedResource)) {
            availableResources.add(allocatedResource);
          }
        }
      }
    }
  }
  return availableResources;
}

Fixed version (ground truth):
private List<AllocatedResource> collectAvailableResources(){
  List<AllocatedResource> availableResources;
  if (this.vertexToShareInstancesWith.get() != null) {
    availableResources=this.vertexToShareInstancesWith.get().collectAvailableResources();
  }
 else {
    availableResources=new ArrayList<AllocatedResource>();
synchronized (this.groupMembers) {
      final Iterator<ExecutionVertex> it=this.groupMembers.iterator();
      while (it.hasNext()) {
        final ExecutionVertex vertex=it.next();
        final AllocatedResource allocatedResource=vertex.getAllocatedResource();
        if (allocatedResource != null) {
          if (!availableResources.contains(allocatedResource)) {
            availableResources.add(allocatedResource);
          }
        }
      }
    }
  }
  return availableResources;
}
Program: 87988
Project: 87988
Buggy source:
private static final int readLengthIncludingLengthBytes(MemorySegment seg,List<MemorySegment> sources,int segmentNum,int segmentOffset){
  int lenBytes=1;
  if (seg.size() - segmentOffset > 5) {
    int val=seg.get(segmentOffset++) & 0xff;
    if (val >= MAX_BIT) {
      int shift=7;
      int curr;
      val=val & 0x7f;
      while ((curr=seg.get(segmentOffset++) & 0xff) >= MAX_BIT) {
        val|=(curr & 0x7f) << shift;
        shift+=7;
        lenBytes++;
      }
      val|=curr << shift;
    }
    return val + lenBytes;
  }
 else {
    int end=seg.size();
    int val=seg.get(segmentOffset++) & 0xff;
    if (segmentOffset == end) {
      segmentOffset=0;
      seg=sources.get(++segmentNum);
    }
    if (val >= MAX_BIT) {
      int shift=7;
      int curr;
      val=val & 0x7f;
      while ((curr=seg.get(segmentOffset++) & 0xff) >= MAX_BIT) {
        val|=(curr & 0x7f) << shift;
        shift+=7;
        lenBytes++;
        if (segmentOffset == end) {
          segmentOffset=0;
          seg=sources.get(++segmentNum);
        }
      }
      val|=curr << shift;
    }
    return val + lenBytes;
  }
}

Fixed version (ground truth):
private static final int readLengthIncludingLengthBytes(MemorySegment seg,List<MemorySegment> sources,int segmentNum,int segmentOffset){
  int lenBytes=1;
  if (seg.size() - segmentOffset > 5) {
    int val=seg.get(segmentOffset++) & 0xff;
    if (val >= MAX_BIT) {
      int shift=7;
      int curr;
      val=val & 0x7f;
      while ((curr=seg.get(segmentOffset++) & 0xff) >= MAX_BIT) {
        val|=(curr & 0x7f) << shift;
        shift+=7;
        lenBytes++;
      }
      val|=curr << shift;
      lenBytes++;
    }
    return val + lenBytes;
  }
 else {
    int end=seg.size();
    int val=seg.get(segmentOffset++) & 0xff;
    if (segmentOffset == end) {
      segmentOffset=0;
      seg=sources.get(++segmentNum);
    }
    if (val >= MAX_BIT) {
      int shift=7;
      int curr;
      val=val & 0x7f;
      while ((curr=seg.get(segmentOffset++) & 0xff) >= MAX_BIT) {
        val|=(curr & 0x7f) << shift;
        shift+=7;
        lenBytes++;
        if (segmentOffset == end) {
          segmentOffset=0;
          seg=sources.get(++segmentNum);
        }
      }
      val|=curr << shift;
    }
    return val + lenBytes;
  }
}
Program: 87990
Project: 87990
Buggy source:
/** 
 * Implements the join between LineItem and Order table on the  order key. WHERE l_orderkey = o_orderkey Output Schema - 0:ORDERKEY, 1:SHIPPRIORITY, 2:EXTENDEDPRICE
 */
@Override public void match(PactRecord first,PactRecord second,Collector out){
  first.unionFields(second);
  out.collect(first);
}

Fixed version (ground truth):
/** 
 * Implements the join between LineItem and Order table on the  order key. WHERE l_orderkey = o_orderkey Output Schema - 0:ORDERKEY, 1:SHIPPRIORITY, 2:EXTENDEDPRICE
 */
@Override public void match(PactRecord first,PactRecord second,Collector out){
  first.setField(1,second.getField(1,PactString.class));
  out.collect(first);
}
Program: 87992
Project: 87992
Buggy source:
@Override public int serializeRecord(PactRecord rec,byte[] target) throws Exception {
  Tuple tuple=rec.getField(0,Tuple.class);
  String tupleStr=tuple.toString();
  byte[] tupleBytes=tupleStr.getBytes();
  if (target.length >= tupleBytes.length) {
    System.arraycopy(tupleBytes,0,target,0,tupleBytes.length);
    return tupleBytes.length;
  }
 else {
    return -1 * tupleBytes.length;
  }
}

Fixed version (ground truth):
@Override public int serializeRecord(PactRecord rec,byte[] target) throws Exception {
  String string=rec.getField(0,PactString.class).toString();
  byte[] stringBytes=string.getBytes();
  Tuple tuple=rec.getField(1,Tuple.class);
  String tupleStr=tuple.toString();
  byte[] tupleBytes=tupleStr.getBytes();
  int totalLength=stringBytes.length + 1 + tupleBytes.length;
  if (target.length >= totalLength) {
    System.arraycopy(stringBytes,0,target,0,stringBytes.length);
    target[stringBytes.length]='|';
    System.arraycopy(tupleBytes,0,target,stringBytes.length + 1,tupleBytes.length);
    return totalLength;
  }
 else {
    return -1 * totalLength;
  }
}
Program: 87993
Project: 87993
Buggy source:
public void setContents(byte[] bytes,int offset,int len,char delimiter){
  if (this.bytes == null || this.bytes.length < len) {
    this.bytes=new byte[len];
  }
  System.arraycopy(bytes,offset,this.bytes,0,len);
  int readPos=offset;
  if (this.offsets == null) {
    this.offsets=new short[4];
  }
  int col=1;
  int startPos=readPos;
  while (readPos < offset + len) {
    if (bytes[readPos++] == delimiter) {
      if (offsets.length <= col) {
        this.offsets=new short[this.offsets.length * 2];
      }
      this.offsets[col++]=(short)(readPos - startPos);
    }
  }
  this.numCols=col - 1;
}

Fixed version (ground truth):
public void setContents(byte[] bytes,int offset,int len,char delimiter){
  if (this.bytes == null || this.bytes.length < len) {
    this.bytes=new byte[len];
  }
  System.arraycopy(bytes,offset,this.bytes,0,len);
  int readPos=offset;
  if (this.offsets == null) {
    this.offsets=new short[4];
  }
  int col=1;
  int startPos=readPos;
  while (readPos < offset + len) {
    if (bytes[readPos++] == delimiter) {
      if (offsets.length <= col) {
        short newOffsets[]=new short[this.offsets.length * 2];
        System.arraycopy(this.offsets,0,newOffsets,0,this.offsets.length);
        this.offsets=newOffsets;
      }
      this.offsets[col++]=(short)(readPos - startPos);
    }
  }
  this.numCols=col - 1;
}
Program: 87994
Project: 87994
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override protected int getTimeout(){
  return 30000;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override protected int getTimeout(){
  return 30;
}
Program: 87995
Project: 87995
Buggy source:
@Override public void reduce(Iterator<PactRecord> records,Collector out) throws Exception {
  long count=0;
  PactRecord rec=null;
  while (records.hasNext()) {
    rec=records.next();
    count++;
  }
  if (rec != null) {
    Tuple tuple=rec.getField(1,Tuple.class);
    tuple.addAttribute("String_Node_Str" + count);
    rec.setField(1,tuple);
  }
  out.collect(rec);
}

Fixed version (ground truth):
@Override public void reduce(Iterator<PactRecord> records,Collector out) throws Exception {
  long count=0;
  PactRecord rec=null;
  while (records.hasNext()) {
    rec=records.next();
    count++;
  }
  if (rec != null) {
    Tuple tuple=new Tuple();
    tuple.addAttribute("String_Node_Str" + count);
    rec.setField(1,tuple);
  }
  out.collect(rec);
}
Program: 87996
Project: 87996
Buggy source:
/** 
 * Join together parts and orderedParts by matching partkey and suppkey. Output Schema: Key: suppkey Value: (amount, year)
 */
@Override public void match(PactRecord value1,PactRecord value2,Collector out) throws Exception {
  value1.getField(0,partAndSupplierKey);
  value1.getField(1,supplyCostStr);
  value2.getField(1,ordersValue);
  PactInteger year=new PactInteger(Integer.parseInt(ordersValue.getStringValueAt(0)));
  float quantity=Float.parseFloat(ordersValue.getStringValueAt(1));
  float price=Float.parseFloat(ordersValue.getStringValueAt(2));
  float supplyCost=Float.parseFloat(supplyCostStr.toString());
  float amount=price - supplyCost * quantity;
  value1.setField(0,partAndSupplierKey);
  value1.setField(1,new StringIntPair(new PactString("String_Node_Str" + amount),year));
  out.collect(value1);
}

Fixed version (ground truth):
/** 
 * Join together parts and orderedParts by matching partkey and suppkey. Output Schema: Key: suppkey Value: (amount, year)
 */
@Override public void match(PactRecord value1,PactRecord value2,Collector out) throws Exception {
  value1.getField(0,partAndSupplierKey);
  value1.getField(1,supplyCostStr);
  value2.getField(1,ordersValue);
  PactInteger year=new PactInteger(Integer.parseInt(ordersValue.getStringValueAt(0)));
  float quantity=Float.parseFloat(ordersValue.getStringValueAt(1));
  float price=Float.parseFloat(ordersValue.getStringValueAt(2));
  float supplyCost=Float.parseFloat(supplyCostStr.toString());
  float amount=price - supplyCost * quantity;
  value1.setField(0,partAndSupplierKey.getSecond());
  value1.setField(1,new StringIntPair(new PactString("String_Node_Str" + amount),year));
  out.collect(value1);
}
Program: 87997
Project: 87997
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));
  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 {
  record.getField(1,inputTuple);
  inputTuple.project((0 << 0) | (1 << 1) | (0 << 2)| (1 << 3)| (0 << 4));
  record.setField(1,inputTuple);
  out.collect(record);
}
Program: 87998
Project: 87998
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);
}

Fixed version (ground truth):
/** 
 * 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);
}
Program: 87999
Project: 87999
Buggy source:
@Override public void writeRecord(PactRecord record) throws IOException {
  int numFields=record.getNumFields();
  for (int i=0; i < numFields; i++) {
    buffer.append(record.getField(0,PactString.class).getValue());
    char delim=(i == numFields - 1) ? '\n' : '|';
    buffer.append(delim);
  }
  byte[] bytes=this.buffer.toString().getBytes();
  this.stream.write(bytes);
}

Fixed version (ground truth):
@Override public void writeRecord(PactRecord record) throws IOException {
  buffer.setLength(0);
  buffer.append(record.getField(1,PactInteger.class).toString());
  buffer.append('|');
  buffer.append(record.getField(0,PactString.class).toString());
  buffer.append('|');
  buffer.append(record.getField(2,PactInteger.class).toString());
  buffer.append('|');
  buffer.append('\n');
  byte[] bytes=this.buffer.toString().getBytes();
  this.stream.write(bytes);
}
Program: 88001
Project: 88001
Buggy source:
/** 
 * @param target
 */
public void copyTo(PactRecord target){
  updateBinaryRepresenation();
  if (target.binaryData == null || target.binaryData.length < this.binaryLen) {
    target.binaryData=new byte[this.binaryLen];
  }
  if (target.offsets == null || target.offsets.length < this.numFields) {
    target.offsets=new int[this.numFields];
  }
  if (target.lengths == null || target.lengths.length < this.numFields) {
    target.lengths=new int[this.numFields];
  }
  if (target.fields == null || target.fields.length < this.numFields) {
    target.fields=new Value[this.numFields];
  }
  System.arraycopy(this.binaryData,0,target.binaryData,0,this.binaryLen);
  System.arraycopy(this.offsets,0,target.offsets,0,this.numFields);
  System.arraycopy(this.lengths,0,target.lengths,0,this.numFields);
  target.binaryLen=this.binaryLen;
  target.numFields=this.numFields;
  target.firstModifiedPos=Integer.MAX_VALUE;
  target.lastUnmodifiedPos=this.numFields - 1;
}

Fixed version (ground truth):
/** 
 * @param target
 */
public void copyTo(PactRecord target){
  updateBinaryRepresenation();
  if (target.binaryData == null || target.binaryData.length < this.binaryLen) {
    target.binaryData=new byte[this.binaryLen];
  }
  if (target.offsets == null || target.offsets.length < this.numFields) {
    target.offsets=new int[this.numFields];
  }
  if (target.lengths == null || target.lengths.length < this.numFields) {
    target.lengths=new int[this.numFields];
  }
  if (target.fields == null || target.fields.length < this.numFields) {
    target.fields=new Value[this.numFields];
  }
  System.arraycopy(this.binaryData,0,target.binaryData,0,this.binaryLen);
  System.arraycopy(this.offsets,0,target.offsets,0,this.numFields);
  System.arraycopy(this.lengths,0,target.lengths,0,this.numFields);
  target.binaryLen=this.binaryLen;
  target.numFields=this.numFields;
  target.firstModifiedPos=Integer.MAX_VALUE;
  target.modified=false;
}
Program: 88002
Project: 88002
Buggy source:
/** 
 * Sets the number of fields in the record. If the new number of fields is longer than the current number of fields, then null fields are appended. If the new number of fields is smaller than the current number of fields, then the last fields are truncated.
 * @param numFields The new number of fields.
 */
public void setNumFields(final int numFields){
  final int oldNumFields=this.numFields;
  if (numFields > oldNumFields) {
    makeSpace(numFields);
    for (int i=oldNumFields; i < numFields; i++) {
      this.offsets[i]=NULL_INDICATOR_OFFSET;
    }
  }
 else {
    if (this.lastUnmodifiedPos >= numFields)     this.lastUnmodifiedPos=numFields - 1;
    markModified(numFields);
  }
  this.numFields=numFields;
}

Fixed version (ground truth):
/** 
 * Sets the number of fields in the record. If the new number of fields is longer than the current number of fields, then null fields are appended. If the new number of fields is smaller than the current number of fields, then the last fields are truncated.
 * @param numFields The new number of fields.
 */
public void setNumFields(final int numFields){
  final int oldNumFields=this.numFields;
  if (numFields > oldNumFields) {
    makeSpace(numFields);
    for (int i=oldNumFields; i < numFields; i++) {
      this.offsets[i]=NULL_INDICATOR_OFFSET;
    }
  }
 else {
    markModified(numFields);
  }
  this.numFields=numFields;
}
Program: 88003
Project: 88003
Buggy source:
/** 
 * Clears the record. After this operation, the record will have zero fields.
 */
public void clear(){
  this.numFields=0;
  this.lastUnmodifiedPos=-1;
  this.firstModifiedPos=Integer.MAX_VALUE;
}

Fixed version (ground truth):
/** 
 * Clears the record. After this operation, the record will have zero fields.
 */
public void clear(){
  if (this.numFields > 0) {
    this.numFields=0;
    this.firstModifiedPos=Integer.MAX_VALUE;
    this.modified=true;
  }
}
Program: 88004
Project: 88004
Buggy source:
private final void markModified(int field){
  if (this.firstModifiedPos > field) {
    this.firstModifiedPos=field;
  }
  if (field == this.lastUnmodifiedPos) {
    this.lastUnmodifiedPos--;
  }
}

Fixed version (ground truth):
private final void markModified(int field){
  if (this.firstModifiedPos > field) {
    this.firstModifiedPos=field;
  }
  this.modified=true;
}
Program: 88006
Project: 88006
Buggy source:
private List<ExecutionVertex> findFollowers(ExecutionVertex vertex,ArrayList<ExecutionVertex> restart){
  ArrayList<ExecutionVertex> follower=new ArrayList<ExecutionVertex>();
  for (int i=0; i < vertex.getNumberOfSuccessors(); i++) {
    ExecutionVertex successor=vertex.getSuccessor(i);
    if (!restart.contains(successor)) {
      follower.add(successor);
      if (successor.getCheckpointState() == CheckpointState.PARTIAL) {
        this.checkpoints.remove(successor);
        final List<ExecutionVertexID> checkpointsToRemove=new ArrayList<ExecutionVertexID>();
        checkpointsToRemove.add(successor.getID());
        try {
          successor.getAllocatedResource().getInstance().removeCheckpoints(checkpointsToRemove);
        }
 catch (        IOException e) {
          e.printStackTrace();
        }
      }
    }
  }
  return follower;
}

Fixed version (ground truth):
private List<ExecutionVertex> findFollowers(ExecutionVertex vertex,ArrayList<ExecutionVertex> restart){
  ArrayList<ExecutionVertex> follower=new ArrayList<ExecutionVertex>();
  for (int i=0; i < vertex.getNumberOfSuccessors(); i++) {
    ExecutionVertex successor=vertex.getSuccessor(i);
    if (!restart.contains(successor)) {
      follower.add(successor);
      if (successor.getCheckpointState() == CheckpointState.PARTIAL) {
        this.checkpoints.remove(successor);
        this.globalConsistentCheckpoint.remove(successor.getID());
        final SerializableArrayList<ExecutionVertexID> checkpointsToRemove=new SerializableArrayList<ExecutionVertexID>();
        checkpointsToRemove.add(successor.getID());
        try {
          successor.getAllocatedResource().getInstance().removeCheckpoints(checkpointsToRemove);
        }
 catch (        IOException e) {
          e.printStackTrace();
        }
      }
    }
  }
  return follower;
}
Program: 88007
Project: 88007
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void run(){
  if (this.failedVertices.isEmpty()) {
    LOG.error("String_Node_Str");
  }
  Iterator<ExecutionVertex> vertexIter=this.failedVertices.iterator();
  while (vertexIter.hasNext()) {
    ExecutionVertex failed=vertexIter.next();
    LOG.info("String_Node_Str" + failed);
    List<ExecutionVertex> restart=findRestarts(failed);
    Iterator<ExecutionVertex> restartIterator=restart.iterator();
    while (restartIterator.hasNext()) {
      ExecutionVertex vertex=restartIterator.next();
      if (!vertex.equals(failed)) {
        LOG.info("String_Node_Str" + vertex.getName());
        final List<ExecutionVertexID> checkpointsToReplay=new ArrayList<ExecutionVertexID>();
        checkpointsToReplay.add(vertex.getID());
        try {
          vertex.getAllocatedResource().getInstance().replayCheckpoints(checkpointsToReplay);
        }
 catch (        Exception e) {
          LOG.info("String_Node_Str" + StringUtils.stringifyException(e) + "String_Node_Str");
        }
      }
    }
    LOG.info("String_Node_Str" + failed);
  }
  this.job.executionStateChanged(this.job.getJobID(),null,ExecutionState.RERUNNING,null);
  LOG.info("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void run(){
  if (this.failedVertices.isEmpty()) {
    LOG.error("String_Node_Str");
  }
  List<CheckpointReplayResult> replayCheckpoints=new ArrayList();
  Iterator<ExecutionVertex> vertexIter=this.failedVertices.iterator();
  while (vertexIter.hasNext()) {
    ExecutionVertex failed=vertexIter.next();
    LOG.info("String_Node_Str" + failed);
    findRestarts(failed);
    Iterator<ExecutionVertexID> checkpointIterator=this.globalConsistentCheckpoint.iterator();
    while (checkpointIterator.hasNext()) {
      ExecutionVertexID checkpoint=checkpointIterator.next();
      AbstractInstance instance=job.getVertexByID(checkpoint).getAllocatedResource().getInstance();
      try {
        replayCheckpoints.addAll(instance.replayCheckpoints(this.globalConsistentCheckpoint));
      }
 catch (      IOException e) {
        e.printStackTrace();
      }
    }
  }
  for (  CheckpointReplayResult replayResult : replayCheckpoints) {
    if (replayResult.getReturnCode() == ReturnCode.ERROR) {
      LOG.info("String_Node_Str" + replayResult.getDescription());
      return;
    }
  }
  this.job.executionStateChanged(this.job.getJobID(),null,ExecutionState.RERUNNING,null);
  LOG.info("String_Node_Str");
}
Program: 88009
Project: 88009
Buggy source:
void executionStateChanged(final JobID jobID,final ExecutionVertexID id,final Task task,final ExecutionState newExecutionState,final String optionalDescription){
  if (newExecutionState == ExecutionState.RUNNING || newExecutionState == ExecutionState.RUNNING) {
synchronized (this.runningTasks) {
      this.runningTasks.put(id,task);
    }
  }
  if (newExecutionState == ExecutionState.FINISHED || newExecutionState == ExecutionState.CANCELED) {
synchronized (this.runningTasks) {
      this.runningTasks.remove(id);
    }
    unregisterTask(id,task);
  }
synchronized (this.jobManager) {
    try {
      this.jobManager.updateTaskExecutionState(new TaskExecutionState(jobID,id,newExecutionState,optionalDescription));
    }
 catch (    IOException e) {
      LOG.error(StringUtils.stringifyException(e));
    }
  }
}

Fixed version (ground truth):
void executionStateChanged(final JobID jobID,final ExecutionVertexID id,final Task task,final ExecutionState newExecutionState,final String optionalDescription){
  if (newExecutionState == ExecutionState.RUNNING || newExecutionState == ExecutionState.RUNNING) {
synchronized (this.runningTasks) {
      this.runningTasks.put(id,task);
    }
  }
  if (newExecutionState == ExecutionState.FINISHED || newExecutionState == ExecutionState.CANCELED) {
synchronized (this.runningTasks) {
      this.runningTasks.remove(id);
    }
    unregisterTask(id,task);
  }
  if (newExecutionState == ExecutionState.FAILED) {
    this.runningTasks.remove(id);
  }
synchronized (this.jobManager) {
    try {
      this.jobManager.updateTaskExecutionState(new TaskExecutionState(jobID,id,newExecutionState,optionalDescription));
    }
 catch (    IOException e) {
      LOG.error(StringUtils.stringifyException(e));
    }
  }
}
Program: 88010
Project: 88010
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public List<CheckpointReplayResult> replayCheckpoints(final List<ExecutionVertexID> vertexIDs) throws IOException {
  final List<CheckpointReplayResult> checkpointResultList=new SerializableArrayList<CheckpointReplayResult>();
  for (  final ExecutionVertexID vertexID : vertexIDs) {
    if (!this.checkpointManager.hasCompleteCheckpointAvailable(vertexID)) {
      if (this.checkpointManager.hasPartialCheckpointAvailable(vertexID)) {
synchronized (this.runningTasks) {
          if (!this.runningTasks.containsKey(vertexID)) {
            final CheckpointReplayResult result=new CheckpointReplayResult(vertexID,ReturnCode.ERROR);
            result.setDescription("String_Node_Str");
            checkpointResultList.add(result);
            continue;
          }
        }
      }
 else {
        final CheckpointReplayResult result=new CheckpointReplayResult(vertexID,ReturnCode.ERROR);
        result.setDescription("String_Node_Str");
        checkpointResultList.add(result);
        continue;
      }
    }
    this.checkpointManager.replayCheckpoint(vertexID);
    checkpointResultList.add(new CheckpointReplayResult(vertexID,ReturnCode.SUCCESS));
  }
  return checkpointResultList;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public SerializableArrayList<CheckpointReplayResult> replayCheckpoints(final List<ExecutionVertexID> vertexIDs) throws IOException {
  final SerializableArrayList<CheckpointReplayResult> checkpointResultList=new SerializableArrayList<CheckpointReplayResult>();
  for (  final ExecutionVertexID vertexID : vertexIDs) {
    if (!this.checkpointManager.hasCompleteCheckpointAvailable(vertexID)) {
      if (this.checkpointManager.hasPartialCheckpointAvailable(vertexID)) {
synchronized (this.runningTasks) {
          if (!this.runningTasks.containsKey(vertexID)) {
            final CheckpointReplayResult result=new CheckpointReplayResult(vertexID,ReturnCode.ERROR);
            result.setDescription("String_Node_Str");
            checkpointResultList.add(result);
            continue;
          }
        }
      }
 else {
        final CheckpointReplayResult result=new CheckpointReplayResult(vertexID,ReturnCode.ERROR);
        result.setDescription("String_Node_Str");
        checkpointResultList.add(result);
        continue;
      }
    }
    this.checkpointManager.replayCheckpoint(vertexID);
    checkpointResultList.add(new CheckpointReplayResult(vertexID,ReturnCode.SUCCESS));
  }
  return checkpointResultList;
}
Program: 88011
Project: 88011
Buggy source:
/** 
 * {@inheritDoc}
 */
@Override public void processEnvelopeFromInputChannel(final TransferEnvelope transferEnvelope) throws IOException, InterruptedException {
  System.out.println("String_Node_Str");
  processEnvelope(transferEnvelope,false);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
@Override public void processEnvelopeFromInputChannel(final TransferEnvelope transferEnvelope) throws IOException, InterruptedException {
  processEnvelope(transferEnvelope,false);
}
Program: 88012
Project: 88012
Buggy source:
private boolean processEnvelopeEnvelopeWithoutBuffer(final TransferEnvelope transferEnvelope,final TransferEnvelopeReceiverList receiverList){
  System.out.println("String_Node_Str" + transferEnvelope.getEventList().size());
  final Iterator<ChannelID> localIt=receiverList.getLocalReceivers().iterator();
  while (localIt.hasNext()) {
    final ChannelID localReceiver=localIt.next();
    final ChannelContext channelContext=this.registeredChannels.get(localReceiver);
    if (channelContext == null) {
      if (LOG.isDebugEnabled()) {
        LOG.debug("String_Node_Str" + localReceiver + "String_Node_Str"+ transferEnvelope.getJobID());
      }
      continue;
    }
    channelContext.queueTransferEnvelope(transferEnvelope);
  }
  final Iterator<InetSocketAddress> remoteIt=receiverList.getRemoteReceivers().iterator();
  while (remoteIt.hasNext()) {
    final InetSocketAddress remoteReceiver=remoteIt.next();
    this.networkConnectionManager.queueEnvelopeForTransfer(remoteReceiver,transferEnvelope);
  }
  return true;
}

Fixed version (ground truth):
private boolean processEnvelopeEnvelopeWithoutBuffer(final TransferEnvelope transferEnvelope,final TransferEnvelopeReceiverList receiverList){
  final Iterator<ChannelID> localIt=receiverList.getLocalReceivers().iterator();
  while (localIt.hasNext()) {
    final ChannelID localReceiver=localIt.next();
    final ChannelContext channelContext=this.registeredChannels.get(localReceiver);
    if (channelContext == null) {
      if (LOG.isDebugEnabled()) {
        LOG.debug("String_Node_Str" + localReceiver + "String_Node_Str"+ transferEnvelope.getJobID());
      }
      continue;
    }
    channelContext.queueTransferEnvelope(transferEnvelope);
  }
  final Iterator<InetSocketAddress> remoteIt=receiverList.getRemoteReceivers().iterator();
  while (remoteIt.hasNext()) {
    final InetSocketAddress remoteReceiver=remoteIt.next();
    this.networkConnectionManager.queueEnvelopeForTransfer(remoteReceiver,transferEnvelope);
  }
  return true;
}
Program: 88013
Project: 88013
Buggy source:
@Override public void copyNormalizedKey(byte[] target,int offset,int len){
  if (len == 4) {
    target[offset]=(byte)((value >>> 24) & 0xff);
    target[offset + 1]=(byte)((value >>> 16) & 0xff);
    target[offset + 2]=(byte)((value >>> 8) & 0xff);
    target[offset + 3]=(byte)((value) & 0xff);
  }
 else   if (len < 4) {
    for (int i=0; len > 0; len--, i++) {
      target[offset + i]=(byte)((value >>> ((3 - i) << 3)) & 0xff);
    }
  }
 else {
    target[offset]=(byte)((value >>> 24) & 0xff);
    target[offset + 1]=(byte)((value >>> 16) & 0xff);
    target[offset + 2]=(byte)((value >>> 8) & 0xff);
    target[offset + 3]=(byte)((value) & 0xff);
    for (int i=4; i < len; i++) {
      target[offset + i]=0;
    }
  }
}

Fixed version (ground truth):
@Override public void copyNormalizedKey(byte[] target,int offset,int len){
  if (len == 4) {
    int highByte=((value >>> 24) & 0xff);
    highByte-=Byte.MIN_VALUE;
    target[offset]=(byte)highByte;
    target[offset + 1]=(byte)((value >>> 16) & 0xff);
    target[offset + 2]=(byte)((value >>> 8) & 0xff);
    target[offset + 3]=(byte)((value) & 0xff);
  }
 else   if (len <= 0) {
  }
 else   if (len < 4) {
    int highByte=((value >>> 24) & 0xff);
    highByte-=Byte.MIN_VALUE;
    target[offset]=(byte)highByte;
    len--;
    for (int i=1; len > 0; len--, i++) {
      target[offset + i]=(byte)((value >>> ((3 - i) << 3)) & 0xff);
    }
  }
 else {
    int highByte=((value >>> 24) & 0xff);
    highByte-=Byte.MIN_VALUE;
    target[offset]=(byte)highByte;
    target[offset + 1]=(byte)((value >>> 16) & 0xff);
    target[offset + 2]=(byte)((value >>> 8) & 0xff);
    target[offset + 3]=(byte)((value) & 0xff);
    for (int i=4; i < len; i++) {
      target[offset + i]=0;
    }
  }
}
Program: 88014
Project: 88014
Buggy source:
@Override public void copyNormalizedKey(byte[] target,int offset,int len){
  if (len == 8) {
    target[offset]=(byte)(value >>> 56);
    target[offset + 1]=(byte)(value >>> 48);
    target[offset + 2]=(byte)(value >>> 40);
    target[offset + 3]=(byte)(value >>> 32);
    target[offset + 4]=(byte)(value >>> 24);
    target[offset + 5]=(byte)(value >>> 16);
    target[offset + 6]=(byte)(value >>> 8);
    target[offset + 7]=(byte)(value);
  }
 else   if (len < 8) {
    for (int i=0; len > 0; len--, i++) {
      target[offset + i]=(byte)(value >>> ((7 - i) << 3));
    }
  }
 else {
    target[offset]=(byte)(value >>> 56);
    target[offset + 1]=(byte)(value >>> 48);
    target[offset + 2]=(byte)(value >>> 40);
    target[offset + 3]=(byte)(value >>> 32);
    target[offset + 4]=(byte)(value >>> 24);
    target[offset + 5]=(byte)(value >>> 16);
    target[offset + 6]=(byte)(value >>> 8);
    target[offset + 7]=(byte)(value);
    for (int i=8; i < len; i++) {
      target[offset + i]=0;
    }
  }
}

Fixed version (ground truth):
@Override public void copyNormalizedKey(byte[] target,int offset,int len){
  if (len == 8) {
    long highByte=((value >>> 56) & 0xff);
    highByte-=Byte.MIN_VALUE;
    target[offset]=(byte)highByte;
    target[offset + 1]=(byte)(value >>> 48);
    target[offset + 2]=(byte)(value >>> 40);
    target[offset + 3]=(byte)(value >>> 32);
    target[offset + 4]=(byte)(value >>> 24);
    target[offset + 5]=(byte)(value >>> 16);
    target[offset + 6]=(byte)(value >>> 8);
    target[offset + 7]=(byte)(value);
  }
 else   if (len <= 0) {
  }
 else   if (len < 8) {
    long highByte=((value >>> 56) & 0xff);
    highByte-=Byte.MIN_VALUE;
    target[offset]=(byte)highByte;
    len--;
    for (int i=1; len > 0; len--, i++) {
      target[offset + i]=(byte)(value >>> ((7 - i) << 3));
    }
  }
 else {
    long highByte=((value >>> 56) & 0xff);
    highByte-=Byte.MIN_VALUE;
    target[offset]=(byte)highByte;
    target[offset + 1]=(byte)(value >>> 48);
    target[offset + 2]=(byte)(value >>> 40);
    target[offset + 3]=(byte)(value >>> 32);
    target[offset + 4]=(byte)(value >>> 24);
    target[offset + 5]=(byte)(value >>> 16);
    target[offset + 6]=(byte)(value >>> 8);
    target[offset + 7]=(byte)(value);
    for (int i=8; i < len; i++) {
      target[offset + i]=0;
    }
  }
}
Program: 88015
Project: 88015
Buggy source:
/** 
 * Returns this PactString's internal character data.
 * @return The character data.
 */
public char[] getChars(){
  return this.value;
}

Fixed version (ground truth):
/** 
 * Returns this PactString's internal character data. The array might be larger than the string which is currently stored in the PactString.
 * @return The character data.
 */
public char[] getChars(){
  return this.value;
}