nus-yam/ex-repair huggingface dataset:
Program: 169212
Project: 169212
Buggy source:
private void populateLegacyAPIEntry(JSONObject json,EGRecord record) throws Exception {
  Date date=DATE_FORMAT.parse(record.getDisplayTime().toString());
  json.put("String_Node_Str","String_Node_Str");
  json.put("String_Node_Str",date.getTime());
  json.put("String_Node_Str",Integer.parseInt(String.valueOf(record.getBGValue())));
  json.put("String_Node_Str",record.getTrend());
}

Fixed version (ground truth):
private void populateLegacyAPIEntry(JSONObject json,EGRecord record) throws Exception {
  json.put("String_Node_Str","String_Node_Str");
  json.put("String_Node_Str",record.getDisplayTime().getTime());
  json.put("String_Node_Str",Integer.parseInt(String.valueOf(record.getBGValue())));
  json.put("String_Node_Str",record.getTrend());
}
Program: 169213
Project: 169213
Buggy source:
public EGVRecord loadClassFile(File f){
  try {
    ObjectInputStream ois=new ObjectInputStream(new FileInputStream(f));
    Object o=ois.readObject();
    return (EGVRecord)o;
  }
 catch (  Exception ex) {
    Log.e(TAG,"String_Node_Str",ex);
  }
  return new EGVRecord();
}

Fixed version (ground truth):
public EGVRecord loadClassFile(File f){
  try {
    ObjectInputStream ois=new ObjectInputStream(new FileInputStream(f));
    Object o=ois.readObject();
    return (EGVRecord)o;
  }
 catch (  Exception ex) {
    Log.w(TAG,"String_Node_Str");
  }
  return new EGVRecord();
}
Program: 169214
Project: 169214
Buggy source:
private boolean isConnected(){
  mSerialDevice=UsbSerialProber.acquire(mUsbManager);
  return mSerialDevice == null;
}

Fixed version (ground truth):
private boolean isConnected(){
  mSerialDevice=UsbSerialProber.acquire(mUsbManager);
  return mSerialDevice != null;
}
Program: 169215
Project: 169215
Buggy source:
public EGVRecord loadClassFile(File f){
  try {
    ObjectInputStream ois=new ObjectInputStream(new FileInputStream(f));
    Object o=ois.readObject();
    return (EGVRecord)o;
  }
 catch (  Exception ex) {
    Log.e(TAG,"String_Node_Str",ex);
  }
  return new EGVRecord();
}

Fixed version (ground truth):
public EGVRecord loadClassFile(File f){
  try {
    ObjectInputStream ois=new ObjectInputStream(new FileInputStream(f));
    Object o=ois.readObject();
    return (EGVRecord)o;
  }
 catch (  Exception ex) {
    Log.w(TAG,"String_Node_Str");
  }
  return new EGVRecord();
}
Program: 169216
Project: 169216
Buggy source:
private boolean isConnected(){
  mSerialDevice=UsbSerialProber.acquire(mUsbManager);
  return mSerialDevice == null;
}

Fixed version (ground truth):
private boolean isConnected(){
  mSerialDevice=UsbSerialProber.acquire(mUsbManager);
  return mSerialDevice != null;
}
Program: 169218
Project: 169218
Buggy source:
private static double getScore(ssw.Alignment alignment,String qry,String ref){
  Pattern cigarPattern=Pattern.compile("String_Node_Str");
  Matcher matcher=cigarPattern.matcher(alignment.cigar);
  int errors=0;
  int len=0;
  int qryPos=alignment.read_begin1;
  int refPos=alignment.ref_begin1;
  while (matcher.find()) {
    String cVal=matcher.group();
    int cLen=Integer.parseInt(cVal.substring(0,cVal.length() - 1));
    char cLetter=cVal.toUpperCase().charAt(cVal.length() - 1);
switch (cLetter) {
case 'H':
      break;
case 'S':
case '=':
    len+=cLen;
  break;
case 'M':
for (int i=0; i < cLen; i++) {
  if (ref.charAt(refPos) != qry.charAt(qryPos)) {
    errors++;
  }
 else {
  }
  refPos++;
  qryPos++;
}
len+=cLen;
break;
case 'I':
errors+=cLen;
qryPos+=cLen;
len+=cLen;
break;
case 'D':
errors+=cLen;
refPos+=cLen;
len+=cLen;
break;
default :
System.err.println("String_Node_Str" + cLetter);
System.exit(1);
break;
}
}
return 1 - (errors / (double)len);
}

Fixed version (ground truth):
private static double getScore(ssw.Alignment alignment,String qry,String ref){
  Pattern cigarPattern=Pattern.compile("String_Node_Str");
  Matcher matcher=cigarPattern.matcher(alignment.cigar);
  int errors=0;
  int len=0;
  int qryPos=alignment.read_begin1;
  int refPos=alignment.ref_begin1;
  while (matcher.find()) {
    String cVal=matcher.group();
    int cLen=Integer.parseInt(cVal.substring(0,cVal.length() - 1));
    char cLetter=cVal.toUpperCase().charAt(cVal.length() - 1);
switch (cLetter) {
case 'H':
      break;
case 'S':
case '=':
    len+=cLen;
  break;
case 'M':
for (int i=0; i < cLen; i++) {
  if (ref.toUpperCase().charAt(refPos) != qry.toUpperCase().charAt(qryPos)) {
    errors++;
  }
 else {
  }
  refPos++;
  qryPos++;
}
len+=cLen;
break;
case 'I':
errors+=cLen;
qryPos+=cLen;
len+=cLen;
break;
case 'D':
errors+=cLen;
refPos+=cLen;
len+=cLen;
break;
default :
System.err.println("String_Node_Str" + cLetter);
System.exit(1);
break;
}
}
return 1 - (errors / (double)len);
}
Program: 169219
Project: 169219
Buggy source:
public FrequencyCounts(Map<Long,Double> fractionCounts,double filterCutoff){
  this.fractionCounts=new HashMap<>(fractionCounts);
  this.filterCutoff=filterCutoff;
  double maxValue=Double.NEGATIVE_INFINITY;
  for (  double val : this.fractionCounts.values())   maxValue=Math.max(maxValue,val);
  this.maxValue=maxValue;
  this.minValue=this.filterCutoff * 0.1;
  this.minIdfValue=idf(this.maxValue);
  this.maxIdfValue=idf(this.minValue);
}

Fixed version (ground truth):
public FrequencyCounts(Map<Long,Double> fractionCounts,double filterCutoff){
  this.fractionCounts=new HashMap<>(fractionCounts);
  this.filterCutoff=filterCutoff;
  double maxValue=Double.NEGATIVE_INFINITY;
  for (  double val : this.fractionCounts.values())   maxValue=Math.max(maxValue,val);
  this.maxValue=maxValue;
  this.minValue=this.filterCutoff;
  this.minIdfValue=idf(this.maxValue);
  this.maxIdfValue=idf(this.minValue);
}
Program: 169221
Project: 169221
Buggy source:
public AlignElementSketch(T[] sketchArray){
  this.elements=sketchArray;
}

Fixed version (ground truth):
public AlignElementSketch(T[] sketchArray,int stepSize,int seqLength){
  this.elements=sketchArray;
  this.stepSize=stepSize;
  this.seqLength=seqLength;
}
Program: 169224
Project: 169224
Buggy source:
public MatchResult(SequenceId fromId,SequenceId toId,OverlapInfo overlap,int fromLength,int toLength){
  this.fromId=fromId;
  this.toId=toId;
  this.fromLength=fromLength;
  this.toLength=toLength;
  this.a1=getFromId().isForward() ? overlap.a1 : fromLength - overlap.a2;
  this.a2=getFromId().isForward() ? overlap.a2 : fromLength - overlap.a1;
  this.b1=getToId().isForward() ? overlap.b1 : toLength - overlap.b2;
  this.b2=getToId().isForward() ? overlap.b2 : toLength - overlap.b1;
  this.rawScore=overlap.rawScore;
  if (overlap.score > 1.0)   this.score=1.0;
 else   this.score=overlap.score;
}

Fixed version (ground truth):
protected MatchResult(SequenceId fromId,SequenceId toId,OverlapInfo overlap,int fromLength,int toLength){
  this.fromId=fromId;
  this.toId=toId;
  this.fromLength=fromLength;
  this.toLength=toLength;
  this.a1=getFromId().isForward() ? overlap.a1 : fromLength - overlap.a2 - 1;
  this.a2=getFromId().isForward() ? overlap.a2 : fromLength - overlap.a1 - 1;
  this.b1=getToId().isForward() ? overlap.b1 : toLength - overlap.b2 - 1;
  this.b2=getToId().isForward() ? overlap.b2 : toLength - overlap.b1 - 1;
  this.rawScore=overlap.rawScore;
  if (overlap.score > 1.0)   this.score=1.0;
 else   this.score=overlap.score;
}
Program: 169226
Project: 169226
Buggy source:
public SequenceSketch(Sequence seq,int kmerSize,int numHashes,int orderedKmerSize,boolean storeHashes,HashSet<Long> filter,NGramCounts kmerCount,boolean weighted,boolean useAlignment){
  this.sequenceLength=seq.length();
  this.id=seq.getId();
  this.mainHashes=new MinHashSketch(seq.toString(),kmerSize,numHashes,filter,kmerCount,weighted);
  if (useAlignment) {
    this.orderedHashes=null;
    this.alignmentSketches=new MinHashBitSequenceSubSketches(seq.toString(),BIT_KMER_SIZE,SUBSEQUENCE_SIZE,BIT_SKETCH_SIZE);
  }
 else {
    this.orderedHashes=new OrderedNGramHashes(seq.toString(),orderedKmerSize);
    this.alignmentSketches=null;
  }
}

Fixed version (ground truth):
public SequenceSketch(Sequence seq,int kmerSize,int numHashes,int orderedKmerSize,boolean storeHashes,HashSet<Long> filter,NGramCounts kmerCount,boolean weighted,boolean useAlignment){
  this.sequenceLength=seq.length();
  this.id=seq.getId();
  this.mainHashes=new MinHashSketch(seq.getSquenceString(),kmerSize,numHashes,filter,kmerCount,weighted);
  if (useAlignment) {
    this.orderedHashes=null;
    this.alignmentSketches=new MinHashBitSequenceSubSketches(seq.getSquenceString(),BIT_KMER_SIZE,SUBSEQUENCE_SIZE,BIT_SKETCH_SIZE);
  }
 else {
    this.orderedHashes=new OrderedNGramHashes(seq.getSquenceString(),orderedKmerSize);
    this.alignmentSketches=null;
  }
}
Program: 169229
Project: 169229
Buggy source:
public OverlapInfo getOverlapInfo(Aligner<AlignElementSketch<T>> aligner,AlignElementSketch<T> b){
  Alignment<AlignElementSketch<T>> aligment=localAlignOneSkip(aligner,b);
  int a1=aligment.getA1();
  int a2=aligment.getA2();
  int b1=aligment.getB1();
  int b2=aligment.getB2();
  a1=Math.min(getSequenceLength() - 1,aligment.getA1() * getStepSize());
  if (a2 >= length() - 1)   a2=getSequenceLength() - 1;
 else   a2=aligment.getA2() * getStepSize() + getStepSize();
  b1=Math.min(b.getSequenceLength() - 1,aligment.getB1() * b.getStepSize());
  if (b2 >= b.length() - 1)   b2=b.getSequenceLength() - 1;
 else   b2=aligment.getB2() * b.getStepSize() + b.getStepSize();
  return new OverlapInfo(aligment.getScore() / 100000.0,aligment.getScore(),a1,a2,b1,b2);
}

Fixed version (ground truth):
public OverlapInfo getOverlapInfo(Aligner<AlignElementSketch<T>> aligner,AlignElementSketch<T> b){
  Alignment<AlignElementSketch<T>> alignment=localAlignOneSkip(aligner,b);
  int a1=alignment.getA1();
  int a2=alignment.getA2();
  int b1=alignment.getB1();
  int b2=alignment.getB2();
  a1=alignment.getA1() * this.stepSize;
  a2=Math.min(getSequenceLength() - 1,alignment.getA2() * this.stepSize + this.stepSize - 1);
  b1=alignment.getB1() * b.stepSize;
  b2=Math.min(b.getSequenceLength() - 1,alignment.getB2() * b.stepSize + b.stepSize - 1);
  double score=alignment.getScore();
  return new OverlapInfo(score / 100000.0,score,a1,a2,b1,b2);
}
Program: 169232
Project: 169232
Buggy source:
private final static MinHashBitSketch[] computeSequences(String seq,int kmerSize,int stepSize,int numWords){
  int remainder=seq.length() % stepSize;
  int numSequence=seq.length() / stepSize;
  if (remainder >= kmerSize)   numSequence++;
  MinHashBitSketch[] sequence=new MinHashBitSketch[numSequence];
  int start=0;
  for (int iter=0; iter < sequence.length; iter++) {
    int end=Math.min(seq.length(),start + stepSize);
    sequence[iter]=new MinHashBitSketch(seq.substring(start,end),kmerSize,numWords);
    start+=stepSize;
  }
  return sequence;
}

Fixed version (ground truth):
public final static MinHashBitSketch[] computeSequences(String seq,int nGramSize,int stepSize,int numWords){
  int remainder=seq.length() % stepSize;
  int numSequence=(seq.length() - remainder) / stepSize;
  if (remainder > 0)   numSequence++;
  int start=0;
  MinHashBitSketch[] sequence=new MinHashBitSketch[numSequence];
  for (int iter=0; iter < numSequence; iter++) {
    int end=Math.min(seq.length(),start + stepSize);
    int currStart=Math.max(0,end - stepSize);
    int[] sketch=computeNgramMinHashesWeighted(seq.substring(currStart,end),nGramSize,numWords * 64);
    sequence[iter]=new MinHashBitSketch(sketch);
    start+=stepSize;
  }
  return sequence;
}
Program: 169235
Project: 169235
Buggy source:
public MinHashSearch(SequenceSketchStreamer data,int numHashes,int numMinMatches,int numThreads,boolean storeResults,int minStoreLength,double maxShift,double acceptScore) throws IOException {
  super(numThreads,storeResults);
  this.minStoreLength=minStoreLength;
  this.numMinMatches=numMinMatches;
  this.maxShift=maxShift;
  this.acceptScore=acceptScore;
  this.numberSubSequencesHit=new AtomicLong();
  this.numberSequencesHit=new AtomicLong();
  this.numberSequencesFullyCompared=new AtomicLong();
  this.numberSubSequences=new AtomicLong();
  this.numberSequencesMinHashed=new AtomicLong();
  this.numberElementsProcessed=new AtomicLong();
  this.minhashSearchTime=new AtomicLong();
  this.sortMergeSearchTime=new AtomicLong();
  data.enqueueFullFile(false,this.numThreads);
  this.aligner=new Aligner<AlignElementSketch<MinHashBitSketch>>(true,0.0,0.0,-0.52);
  this.sequenceVectorsHash=new HashMap<SequenceId,SequenceSketch>(data.getNumberProcessed() + 100,(float)0.75);
  this.hashes=new ArrayList<Map<Integer,ArrayList<SequenceId>>>(numHashes);
  for (int iter=0; iter < numHashes; iter++) {
    Map<Integer,ArrayList<SequenceId>> map=new HashMap<Integer,ArrayList<SequenceId>>(data.getNumberSubSequencesProcessed() + 100);
    this.hashes.add(map);
  }
  addData(data);
  System.err.println("String_Node_Str" + this.sequenceVectorsHash.size() + "String_Node_Str");
}

Fixed version (ground truth):
public MinHashSearch(SequenceSketchStreamer data,int numHashes,int numMinMatches,int numThreads,boolean storeResults,int minStoreLength,double maxShift,double acceptScore,double alignmentOffset) throws IOException {
  super(numThreads,storeResults);
  this.minStoreLength=minStoreLength;
  this.numMinMatches=numMinMatches;
  this.maxShift=maxShift;
  this.acceptScore=acceptScore;
  this.numberSubSequencesHit=new AtomicLong();
  this.numberSequencesHit=new AtomicLong();
  this.numberSequencesFullyCompared=new AtomicLong();
  this.numberSubSequences=new AtomicLong();
  this.numberSequencesMinHashed=new AtomicLong();
  this.numberElementsProcessed=new AtomicLong();
  this.minhashSearchTime=new AtomicLong();
  this.sortMergeSearchTime=new AtomicLong();
  data.enqueueFullFile(false,this.numThreads);
  this.aligner=new Aligner<AlignElementSketch<MinHashBitSketch>>(true,0.0,0.0,alignmentOffset);
  this.sequenceVectorsHash=new HashMap<SequenceId,SequenceSketch>(data.getNumberProcessed() + 100,(float)0.75);
  this.hashes=new ArrayList<Map<Integer,ArrayList<SequenceId>>>(numHashes);
  for (int iter=0; iter < numHashes; iter++) {
    Map<Integer,ArrayList<SequenceId>> map=new HashMap<Integer,ArrayList<SequenceId>>(data.getNumberSubSequencesProcessed() + 100);
    this.hashes.add(map);
  }
  addData(data);
  System.err.println("String_Node_Str" + this.sequenceVectorsHash.size() + "String_Node_Str");
}
Program: 169237
Project: 169237
Buggy source:
public MhapMain(ParseOptions options) throws IOException {
  this.processFile=options.get("String_Node_Str").getString();
  this.inFile=options.get("String_Node_Str").getString();
  this.toFile=options.get("String_Node_Str").getString();
  this.noSelf=options.get("String_Node_Str").getBoolean();
  this.numThreads=options.get("String_Node_Str").getInteger();
  this.numHashes=options.get("String_Node_Str").getInteger();
  this.kmerSize=options.get("String_Node_Str").getInteger();
  this.numMinMatches=options.get("String_Node_Str").getInteger();
  this.minStoreLength=options.get("String_Node_Str").getInteger();
  this.maxShift=options.get("String_Node_Str").getDouble();
  this.acceptScore=options.get("String_Node_Str").getDouble();
  this.weighted=options.get("String_Node_Str").getBoolean();
  this.useAlignment=options.get("String_Node_Str").getBoolean();
  String filterFile=options.get("String_Node_Str").getString();
  if (!filterFile.isEmpty()) {
    long startTime=System.nanoTime();
    System.err.println("String_Node_Str" + filterFile + "String_Node_Str");
    try {
      this.filter=Utils.createKmerFilter(filterFile,options.get("String_Node_Str").getDouble(),this.kmerSize,0);
    }
 catch (    Exception e) {
      throw new MhapRuntimeException("String_Node_Str",e);
    }
    System.err.println("String_Node_Str" + (System.nanoTime() - startTime) * 1.0e-9);
    this.kmerCounter=null;
  }
 else {
    this.filter=null;
    this.kmerCounter=null;
  }
}

Fixed version (ground truth):
public MhapMain(ParseOptions options) throws IOException {
  this.processFile=options.get("String_Node_Str").getString();
  this.inFile=options.get("String_Node_Str").getString();
  this.toFile=options.get("String_Node_Str").getString();
  this.noSelf=options.get("String_Node_Str").getBoolean();
  this.numThreads=options.get("String_Node_Str").getInteger();
  this.numHashes=options.get("String_Node_Str").getInteger();
  this.kmerSize=options.get("String_Node_Str").getInteger();
  this.numMinMatches=options.get("String_Node_Str").getInteger();
  this.minStoreLength=options.get("String_Node_Str").getInteger();
  this.maxShift=options.get("String_Node_Str").getDouble();
  this.acceptScore=options.get("String_Node_Str").getDouble();
  this.weighted=options.get("String_Node_Str").getBoolean();
  this.useAlignment=options.get("String_Node_Str").getBoolean();
  this.alignmentOffset=options.get("String_Node_Str").getDouble();
  String filterFile=options.get("String_Node_Str").getString();
  if (!filterFile.isEmpty()) {
    long startTime=System.nanoTime();
    System.err.println("String_Node_Str" + filterFile + "String_Node_Str");
    try {
      this.filter=Utils.createKmerFilter(filterFile,options.get("String_Node_Str").getDouble(),this.kmerSize,0);
    }
 catch (    Exception e) {
      throw new MhapRuntimeException("String_Node_Str",e);
    }
    System.err.println("String_Node_Str" + (System.nanoTime() - startTime) * 1.0e-9);
    this.kmerCounter=null;
  }
 else {
    this.filter=null;
    this.kmerCounter=null;
  }
}
Program: 169238
Project: 169238
Buggy source:
public MinHashSearch getMatchSearch(SequenceSketchStreamer hashStreamer) throws IOException {
  return new MinHashSearch(hashStreamer,this.numHashes,this.numMinMatches,this.numThreads,false,this.minStoreLength,this.maxShift,this.acceptScore);
}

Fixed version (ground truth):
public MinHashSearch getMatchSearch(SequenceSketchStreamer hashStreamer) throws IOException {
  return new MinHashSearch(hashStreamer,this.numHashes,this.numMinMatches,this.numThreads,false,this.minStoreLength,this.maxShift,this.acceptScore,this.alignmentOffset);
}
Program: 169239
Project: 169239
Buggy source:
protected AbstractSequenceSubSketches(S[] sequence,int stepSize){
  this.sequence=sequence;
  this.stepSize=stepSize;
}

Fixed version (ground truth):
protected AbstractSequenceSubSketches(S[] sequence,int stepSize,int seqLength){
  this.sequence=sequence;
  this.stepSize=stepSize;
  this.seqLength=seqLength;
}
Program: 169240
Project: 169240
Buggy source:
public OverlapInfo getOverlapInfo(Aligner<AlignElementSketch<S>> aligner,T b){
  Alignment<AlignElementSketch<S>> aligment=localAlignOneSkip(aligner,b);
  return new OverlapInfo(aligment.getScore() / 100000.0,aligment.getScore(),aligment.getA1() * stepSize,aligment.getA2() * stepSize,aligment.getB1() * stepSize,aligment.getB2() * stepSize);
}

Fixed version (ground truth):
public OverlapInfo getOverlapInfo(Aligner<AlignElementSketch<S>> aligner,T b){
  Alignment<AlignElementSketch<S>> aligment=localAlignOneSkip(aligner,b);
  int a1=Math.min(getSequenceLength(),aligment.getA1() * this.stepSize);
  int a2=Math.min(this.getSequenceLength(),aligment.getA2() * this.stepSize);
  int b1=Math.min(b.getSequenceLength(),aligment.getB1() * this.stepSize);
  int b2=Math.min(b.getSequenceLength(),aligment.getB2() * this.stepSize);
  return new OverlapInfo(aligment.getScore() / 100000.0,aligment.getScore(),a1,a2,b1,b2);
}
Program: 169241
Project: 169241
Buggy source:
public MinHashBitSequenceSubSketches(String seq,int kmerSize,int stepSize,int numWords){
  super(computeSequences(seq,kmerSize,stepSize,numWords),stepSize);
}

Fixed version (ground truth):
public MinHashBitSequenceSubSketches(String seq,int kmerSize,int stepSize,int numWords){
  super(computeSequences(seq,kmerSize,stepSize,numWords),stepSize,seq.length());
}
Program: 169242
Project: 169242
Buggy source:
public byte[] getAsByteArray(){
  int numWords=this.sequence[0].numberOfWords();
  ByteBuffer bb=ByteBuffer.allocate(8 * numWords * this.sequence.length + 4 + 4 + 4);
  bb.putInt(this.sequence.length);
  bb.putInt(numWords);
  bb.putInt(getStepSize());
  for (int hash=0; hash < this.sequence.length; hash++) {
    MinHashBitSketch sketch=this.sequence[hash];
    for (int word=0; word < numWords; word++)     bb.putLong(sketch.getWord(word));
  }
  return bb.array();
}

Fixed version (ground truth):
public byte[] getAsByteArray(){
  int numWords=this.sequence[0].numberOfWords();
  ByteBuffer bb=ByteBuffer.allocate(8 * numWords * this.sequence.length + 4 + 4 + 4 + 4);
  bb.putInt(this.sequence.length);
  bb.putInt(numWords);
  bb.putInt(getStepSize());
  bb.putInt(getSequenceLength());
  for (int hash=0; hash < this.sequence.length; hash++) {
    MinHashBitSketch sketch=this.sequence[hash];
    for (int word=0; word < numWords; word++)     bb.putLong(sketch.getWord(word));
  }
  return bb.array();
}
Program: 169243
Project: 169243
Buggy source:
public final static MinHashBitSequenceSubSketches fromByteStream(DataInputStream input) throws IOException {
  try {
    int numSubSequences=input.readInt();
    int numWords=input.readInt();
    int stepSize=input.readInt();
    MinHashBitSketch[] sequence=new MinHashBitSketch[numSubSequences];
    for (int iter=0; iter < numSubSequences; iter++) {
      long[] bits=new long[numWords];
      for (int word=0; word < numWords; word++)       bits[word]=input.readLong();
      sequence[iter]=new MinHashBitSketch(bits);
    }
    return new MinHashBitSequenceSubSketches(sequence,stepSize);
  }
 catch (  EOFException e) {
    return null;
  }
}

Fixed version (ground truth):
public final static MinHashBitSequenceSubSketches fromByteStream(DataInputStream input) throws IOException {
  try {
    int numSubSequences=input.readInt();
    int numWords=input.readInt();
    int stepSize=input.readInt();
    int seqLength=input.readInt();
    MinHashBitSketch[] sequence=new MinHashBitSketch[numSubSequences];
    for (int iter=0; iter < numSubSequences; iter++) {
      long[] bits=new long[numWords];
      for (int word=0; word < numWords; word++)       bits[word]=input.readLong();
      sequence[iter]=new MinHashBitSketch(bits);
    }
    return new MinHashBitSequenceSubSketches(sequence,stepSize,seqLength);
  }
 catch (  EOFException e) {
    return null;
  }
}
Program: 169244
Project: 169244
Buggy source:
public MinHashSketch(String str,int nGramSize,int numHashes){
  this.minHashes=MinHashSketch.computeNgramMinHashesWeightedIntSuper(str,nGramSize,numHashes,null,null,true);
}

Fixed version (ground truth):
public MinHashSketch(String str,int nGramSize,int numHashes){
  this.minHashes=MinHashSketch.computeNgramMinHashesWeighted(str,nGramSize,numHashes,null,null,true);
}
Program: 169246
Project: 169246
Buggy source:
@SuppressWarnings("String_Node_Str") public MinHashSearchArray(AbstractSequenceHashStreamer<SequenceMinHashes> data,int numHashes,int numMinMatches,int numThreads,boolean storeResults,int minStoreLength,double maxShift,double acceptScore) throws IOException {
  super(numThreads,storeResults);
  this.minStoreLength=minStoreLength;
  this.numMinMatches=numMinMatches;
  this.maxShift=maxShift;
  this.acceptScore=acceptScore;
  this.numberSubSequencesHit=new AtomicLong();
  this.numberSequencesHit=new AtomicLong();
  this.numberSequencesFullyCompared=new AtomicLong();
  this.numberSubSequences=new AtomicLong();
  this.numberSequencesMinHashed=new AtomicLong();
  this.numberElementsProcessed=new AtomicLong();
  data.enqueueFullFile(false,this.numThreads);
  this.sequenceVectorsHash=new HashMap<SequenceId,SequenceMinHashes>(data.getNumberProcessed() + 100,(float)0.75);
  this.hashes=new ArrayList[numHashes][];
  int numElements=data.getNumberSubSequencesProcessed() + 100;
  for (int iter=0; iter < numHashes; iter++)   this.hashes[iter]=new ArrayList[numElements * 8];
  addData(data);
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public MinHashSearchArray(AbstractSequenceHashStreamer<SequenceMinHashes> data,int numHashes,int numMinMatches,int numThreads,boolean storeResults,int minStoreLength,double maxShift,double acceptScore) throws IOException {
  super(numThreads,storeResults);
  this.minStoreLength=minStoreLength;
  this.numMinMatches=numMinMatches;
  this.maxShift=maxShift;
  this.acceptScore=acceptScore;
  this.numberSubSequencesHit=new AtomicLong();
  this.numberSequencesHit=new AtomicLong();
  this.numberSequencesFullyCompared=new AtomicLong();
  this.numberSubSequences=new AtomicLong();
  this.numberSequencesMinHashed=new AtomicLong();
  this.numberElementsProcessed=new AtomicLong();
  this.minhashSearchTime=new AtomicLong();
  data.enqueueFullFile(false,this.numThreads);
  this.sequenceVectorsHash=new HashMap<SequenceId,SequenceMinHashes>(data.getNumberProcessed() + 100,(float)0.75);
  this.hashes=new ArrayList[numHashes][];
  int numElements=data.getNumberSubSequencesProcessed() + 100;
  for (int iter=0; iter < numHashes; iter++)   this.hashes[iter]=new ArrayList[numElements * 4];
  addData(data);
}
Program: 169249
Project: 169249
Buggy source:
private boolean computeDP(String id,String id2){
  if (this.doDP == false) {
    return false;
  }
  Logger logger=Logger.getLogger(SmithWatermanGotoh.class.getName());
  logger.setLevel(Level.OFF);
  logger=Logger.getLogger(MatrixLoader.class.getName());
  logger.setLevel(Level.OFF);
  Overlap ovl=this.ovlInfo.get(getOvlName(id,id2));
  jaligner.Sequence s1=new jaligner.Sequence(this.dataSeq[Integer.parseInt(ovl.id1) - 1].toString().substring(ovl.afirst,ovl.asecond));
  jaligner.Sequence s2=null;
  if (ovl.isFwd) {
    s2=new jaligner.Sequence(this.dataSeq[Integer.parseInt(ovl.id2) - 1].toString().substring(ovl.bfirst,ovl.bsecond));
  }
 else {
    s2=new jaligner.Sequence(this.dataSeq[Integer.parseInt(ovl.id2) - 1].getReverseCompliment().toString().substring(ovl.bfirst,ovl.bsecond));
  }
  Alignment alignment;
  try {
    alignment=SmithWatermanGotoh.align(s1,s2,MatrixLoader.load("String_Node_Str"),2f,1f);
  }
 catch (  MatrixLoaderException e) {
    return false;
  }
  return (AlignmentHashRun.getScoreWithNoTerminalGaps(alignment) > MIN_IDENTITY);
}

Fixed version (ground truth):
private boolean computeDP(String id,String id2){
  if (this.doDP == false) {
    return false;
  }
  Logger logger=Logger.getLogger(SmithWatermanGotoh.class.getName());
  logger.setLevel(Level.OFF);
  logger=Logger.getLogger(MatrixLoader.class.getName());
  logger.setLevel(Level.OFF);
  Overlap ovl=this.ovlInfo.get(getOvlName(id,id2));
  jaligner.Sequence s1=new jaligner.Sequence(this.dataSeq[Integer.parseInt(ovl.id1) - 1].getString().substring(ovl.afirst,ovl.asecond));
  jaligner.Sequence s2=null;
  if (ovl.isFwd) {
    s2=new jaligner.Sequence(this.dataSeq[Integer.parseInt(ovl.id2) - 1].getString().substring(ovl.bfirst,ovl.bsecond));
  }
 else {
    s2=new jaligner.Sequence(this.dataSeq[Integer.parseInt(ovl.id2) - 1].getReverseCompliment().getString().substring(ovl.bfirst,ovl.bsecond));
  }
  Alignment alignment;
  try {
    alignment=SmithWatermanGotoh.align(s1,s2,MatrixLoader.load("String_Node_Str"),2f,1f);
  }
 catch (  MatrixLoaderException e) {
    return false;
  }
  return (AlignmentHashRun.getScoreWithNoTerminalGaps(alignment) > MIN_IDENTITY);
}
Program: 169251
Project: 169251
Buggy source:
@Override public String toString(){
  StringBuilder stringBuilder=new StringBuilder();
  stringBuilder.append("String_Node_Str");
  stringBuilder.append(this.id1);
  stringBuilder.append("String_Node_Str");
  stringBuilder.append(this.afirst);
  stringBuilder.append("String_Node_Str");
  stringBuilder.append(this.asecond);
  stringBuilder.append("String_Node_Str");
  stringBuilder.append(this.id2);
  stringBuilder.append("String_Node_Str");
  stringBuilder.append(this.bfirst);
  stringBuilder.append("String_Node_Str");
  stringBuilder.append(this.bsecond);
  return stringBuilder.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  StringBuilder stringBuilder=new StringBuilder();
  stringBuilder.append("String_Node_Str" + this.isFwd);
  stringBuilder.append("String_Node_Str");
  stringBuilder.append(this.id1);
  stringBuilder.append("String_Node_Str");
  stringBuilder.append(this.afirst);
  stringBuilder.append("String_Node_Str");
  stringBuilder.append(this.asecond);
  stringBuilder.append("String_Node_Str");
  stringBuilder.append(this.id2);
  stringBuilder.append("String_Node_Str");
  stringBuilder.append(this.bfirst);
  stringBuilder.append("String_Node_Str");
  stringBuilder.append(this.bsecond);
  stringBuilder.append("String_Node_Str");
  return stringBuilder.toString();
}
Program: 169252
Project: 169252
Buggy source:
private boolean computeDP(String id,String id2){
  if (this.doDP == false) {
    return false;
  }
  Logger logger=Logger.getLogger(SmithWatermanGotoh.class.getName());
  logger.setLevel(Level.OFF);
  logger=Logger.getLogger(MatrixLoader.class.getName());
  logger.setLevel(Level.OFF);
  Overlap ovl=this.ovlInfo.get(getOvlName(id,id2));
  jaligner.Sequence s1=new jaligner.Sequence(this.dataSeq[Integer.parseInt(ovl.id1) - 1].toString().substring(ovl.afirst,ovl.asecond));
  jaligner.Sequence s2=null;
  if (ovl.isFwd) {
    s2=new jaligner.Sequence(this.dataSeq[Integer.parseInt(ovl.id2) - 1].toString().substring(ovl.bfirst,ovl.bsecond));
  }
 else {
    s2=new jaligner.Sequence(this.dataSeq[Integer.parseInt(ovl.id2) - 1].getReverseCompliment().toString().substring(ovl.bfirst,ovl.bsecond));
  }
  Alignment alignment;
  try {
    alignment=SmithWatermanGotoh.align(s1,s2,MatrixLoader.load("String_Node_Str"),2f,1f);
  }
 catch (  MatrixLoaderException e) {
    return false;
  }
  return (AlignmentHashRun.getScoreWithNoTerminalGaps(alignment) > MIN_IDENTITY);
}

Fixed version (ground truth):
private boolean computeDP(String id,String id2){
  if (this.doDP == false) {
    return false;
  }
  Logger logger=Logger.getLogger(SmithWatermanGotoh.class.getName());
  logger.setLevel(Level.OFF);
  logger=Logger.getLogger(MatrixLoader.class.getName());
  logger.setLevel(Level.OFF);
  Overlap ovl=this.ovlInfo.get(getOvlName(id,id2));
  jaligner.Sequence s1=new jaligner.Sequence(this.dataSeq[Integer.parseInt(ovl.id1) - 1].getString().substring(ovl.afirst,ovl.asecond));
  jaligner.Sequence s2=null;
  if (ovl.isFwd) {
    s2=new jaligner.Sequence(this.dataSeq[Integer.parseInt(ovl.id2) - 1].getString().substring(ovl.bfirst,ovl.bsecond));
  }
 else {
    s2=new jaligner.Sequence(this.dataSeq[Integer.parseInt(ovl.id2) - 1].getReverseCompliment().getString().substring(ovl.bfirst,ovl.bsecond));
  }
  Alignment alignment;
  try {
    alignment=SmithWatermanGotoh.align(s1,s2,MatrixLoader.load("String_Node_Str"),2f,1f);
  }
 catch (  MatrixLoaderException e) {
    return false;
  }
  return (AlignmentHashRun.getScoreWithNoTerminalGaps(alignment) > MIN_IDENTITY);
}
Program: 169254
Project: 169254
Buggy source:
@Override public String toString(){
  StringBuilder stringBuilder=new StringBuilder();
  stringBuilder.append("String_Node_Str");
  stringBuilder.append(this.id1);
  stringBuilder.append("String_Node_Str");
  stringBuilder.append(this.afirst);
  stringBuilder.append("String_Node_Str");
  stringBuilder.append(this.asecond);
  stringBuilder.append("String_Node_Str");
  stringBuilder.append(this.id2);
  stringBuilder.append("String_Node_Str");
  stringBuilder.append(this.bfirst);
  stringBuilder.append("String_Node_Str");
  stringBuilder.append(this.bsecond);
  return stringBuilder.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  StringBuilder stringBuilder=new StringBuilder();
  stringBuilder.append("String_Node_Str" + this.isFwd);
  stringBuilder.append("String_Node_Str");
  stringBuilder.append(this.id1);
  stringBuilder.append("String_Node_Str");
  stringBuilder.append(this.afirst);
  stringBuilder.append("String_Node_Str");
  stringBuilder.append(this.asecond);
  stringBuilder.append("String_Node_Str");
  stringBuilder.append(this.id2);
  stringBuilder.append("String_Node_Str");
  stringBuilder.append(this.bfirst);
  stringBuilder.append("String_Node_Str");
  stringBuilder.append(this.bsecond);
  stringBuilder.append("String_Node_Str");
  return stringBuilder.toString();
}
Program: 169255
Project: 169255
Buggy source:
public static SequenceMinHashes fromByteStream(DataInputStream input,int offset) throws IOException {
  try {
    input.SequenceId id=new SequenceId(input.readInt() + offset,input.readBoolean());
    MinHash mainHashes=MinHash.fromByteStream(input);
    if (mainHashes == null)     throw new FastAlignRuntimeException("String_Node_Str");
    int hashLength=input.readInt();
    int[][] completeHash=new int[hashLength][];
    for (int iter=0; iter < hashLength; iter++) {
      completeHash[iter]=new int[2];
      completeHash[iter][0]=input.readInt();
      completeHash[iter][1]=input.readInt();
    }
    return new SequenceMinHashes(id,mainHashes,null);
  }
 catch (  EOFException e) {
    return null;
  }
}

Fixed version (ground truth):
public static SequenceMinHashes fromByteStream(DataInputStream input,int offset) throws IOException {
  try {
    SequenceId id=new SequenceId(input.readInt() + offset,input.readBoolean());
    MinHash mainHashes=MinHash.fromByteStream(input);
    if (mainHashes == null)     throw new FastAlignRuntimeException("String_Node_Str");
    int hashLength=input.readInt();
    int[][] completeHash=new int[hashLength][];
    for (int iter=0; iter < hashLength; iter++) {
      completeHash[iter]=new int[2];
      completeHash[iter][0]=input.readInt();
      completeHash[iter][1]=input.readInt();
    }
    return new SequenceMinHashes(id,mainHashes,null);
  }
 catch (  EOFException e) {
    return null;
  }
}
Program: 169256
Project: 169256
Buggy source:
public static SequenceMinHashes fromByteStream(DataInputStream input,int offset) throws IOException {
  try {
    input.SequenceId id=new SequenceId(input.readInt() + offset,input.readBoolean());
    MinHash mainHashes=MinHash.fromByteStream(input);
    if (mainHashes == null)     throw new FastAlignRuntimeException("String_Node_Str");
    int hashLength=input.readInt();
    int[][] completeHash=new int[hashLength][];
    for (int iter=0; iter < hashLength; iter++) {
      completeHash[iter]=new int[2];
      completeHash[iter][0]=input.readInt();
      completeHash[iter][1]=input.readInt();
    }
    return new SequenceMinHashes(id,mainHashes,null);
  }
 catch (  EOFException e) {
    return null;
  }
}

Fixed version (ground truth):
public static SequenceMinHashes fromByteStream(DataInputStream input,int offset) throws IOException {
  try {
    SequenceId id=new SequenceId(input.readInt() + offset,input.readBoolean());
    MinHash mainHashes=MinHash.fromByteStream(input);
    if (mainHashes == null)     throw new FastAlignRuntimeException("String_Node_Str");
    int hashLength=input.readInt();
    int[][] completeHash=new int[hashLength][];
    for (int iter=0; iter < hashLength; iter++) {
      completeHash[iter]=new int[2];
      completeHash[iter][0]=input.readInt();
      completeHash[iter][1]=input.readInt();
    }
    return new SequenceMinHashes(id,mainHashes,null);
  }
 catch (  EOFException e) {
    return null;
  }
}
Program: 169257
Project: 169257
Buggy source:
public void process() throws NumberFormatException, IOException {
  double variance=0;
  double sum=0;
  int total=0;
  for (  int val : histogram.keySet()) {
    int count=histogram.get(val);
    for (int i=0; i < count; i++) {
      total++;
      double delta=(val - mean);
      mean+=(delta / total);
      variance+=delta * (val - mean);
      sum+=val;
    }
  }
  variance/=total;
  stdev=Math.sqrt(variance);
  double runningSum=0;
  for (  int val : histogram.keySet()) {
    int count=histogram.get(val);
    runningSum+=(double)val * count;
    if ((runningSum / sum) > percent) {
      cut=val;
      break;
    }
  }
}

Fixed version (ground truth):
public void process() throws NumberFormatException, IOException {
  double variance=0;
  double sum=0;
  int total=0;
  for (  int val : this.histogram.keySet()) {
    int count=this.histogram.get(val);
    for (int i=0; i < count; i++) {
      total++;
      double delta=(val - this.mean);
      this.mean+=(delta / total);
      variance+=delta * (val - this.mean);
      sum+=val;
    }
  }
  variance/=total;
  this.stdev=Math.sqrt(variance);
  double runningSum=0;
  for (  int val : this.histogram.keySet()) {
    int count=this.histogram.get(val);
    runningSum+=(double)val * count;
    if ((runningSum / sum) > this.percent) {
      this.cut=val;
      break;
    }
  }
}
Program: 169258
Project: 169258
Buggy source:
@Override public String toString(){
  return nf.format(mean) + "String_Node_Str" + nf.format(stdev)+ "String_Node_Str"+ "String_Node_Str"+ cut+ "String_Node_Str"+ nf.format(mean + NUM_SD * stdev);
}

Fixed version (ground truth):
@Override public String toString(){
  return nf.format(this.mean) + "String_Node_Str" + nf.format(this.stdev)+ "String_Node_Str"+ "String_Node_Str"+ this.cut+ "String_Node_Str"+ nf.format(this.mean + NUM_SD * this.stdev);
}
Program: 169259
Project: 169259
Buggy source:
public GetHistogramStats(String fileName,double p){
  try {
    BufferedReader bf=Utils.getFile(fileName,"String_Node_Str");
    String line=null;
    while ((line=bf.readLine()) != null) {
      String[] split=line.trim().split("String_Node_Str");
      int val=Integer.parseInt(split[0]);
      int count=Integer.parseInt(split[1]);
      histogram.put(val,count);
    }
    bf.close();
    percent=p;
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public GetHistogramStats(String fileName,double p){
  try {
    BufferedReader bf=Utils.getFile(fileName,"String_Node_Str");
    String line=null;
    while ((line=bf.readLine()) != null) {
      String[] split=line.trim().split("String_Node_Str");
      int val=Integer.parseInt(split[0]);
      int count=Integer.parseInt(split[1]);
      this.histogram.put(val,count);
    }
    bf.close();
    this.percent=p;
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}
Program: 169260
Project: 169260
Buggy source:
public double compareKmers(String first,String second){
  HashSet<String> firstSeqs=new HashSet<String>();
  HashSet<String> totalSeqs=new HashSet<String>();
  HashSet<String> shared=new HashSet<String>();
  for (int i=0; i <= first.length() - this.kmer; i++) {
    String fmer=first.substring(i,i + this.kmer);
    if (!skipMers.containsKey(fmer)) {
      firstSeqs.add(fmer);
    }
    totalSeqs.add(fmer);
  }
  for (int i=0; i <= second.length() - this.kmer; i++) {
    String smer=second.substring(i,i + this.kmer);
    if (firstSeqs.contains(smer)) {
      shared.add(smer);
    }
 else {
      totalSeqs.add(smer);
    }
  }
  this.sharedCount=shared.size();
  return shared.size() / (double)totalSeqs.size();
}

Fixed version (ground truth):
public double compareKmers(String first,String second){
  HashSet<String> firstSeqs=new HashSet<String>();
  HashSet<String> totalSeqs=new HashSet<String>();
  HashSet<String> shared=new HashSet<String>();
  for (int i=0; i <= first.length() - this.kmer; i++) {
    String fmer=first.substring(i,i + this.kmer);
    if (!this.skipMers.containsKey(fmer)) {
      firstSeqs.add(fmer);
    }
    totalSeqs.add(fmer);
  }
  for (int i=0; i <= second.length() - this.kmer; i++) {
    String smer=second.substring(i,i + this.kmer);
    if (firstSeqs.contains(smer)) {
      shared.add(smer);
    }
 else {
      totalSeqs.add(smer);
    }
  }
  this.sharedCount=shared.size();
  return shared.size() / (double)totalSeqs.size();
}
Program: 169261
Project: 169261
Buggy source:
private void loadSkipMers(String file) throws Exception {
  BufferedReader bf=Utils.getFile(file,"String_Node_Str");
  String line=null;
  while ((line=bf.readLine()) != null) {
    String[] split=line.trim().split("String_Node_Str");
    String mer=split[0].trim();
    int count=Integer.parseInt(split[1]);
    skipMers.put(mer,count);
  }
  bf.close();
}

Fixed version (ground truth):
private void loadSkipMers(String file) throws Exception {
  BufferedReader bf=Utils.getFile(file,"String_Node_Str");
  String line=null;
  while ((line=bf.readLine()) != null) {
    String[] split=line.trim().split("String_Node_Str");
    String mer=split[0].trim();
    int count=Integer.parseInt(split[1]);
    this.skipMers.put(mer,count);
  }
  bf.close();
}
Program: 169263
Project: 169263
Buggy source:
@Override public boolean addDirectionalSequence(Sequence seq){
  SequenceMinHashes currHash=getSequenceHash(seq);
  int[][] currMinHashes=currHash.getMainHashes().getSubSeqMinHashes();
  if (currMinHashes[0].length != this.hashes.size())   throw new FastAlignRuntimeException("String_Node_Str");
  SequenceMinHashes minHash=this.sequenceVectorsHash.put(seq.getId(),currHash);
  if (minHash != null) {
    this.sequenceVectorsHash.put(seq.getId(),minHash);
    throw new FastAlignRuntimeException("String_Node_Str");
  }
  if (seq.length() < minStoreLength)   return false;
  int count=0;
  for (  HashMap<Integer,ArrayList<SubSequenceId>> hash : this.hashes) {
    for (int subSequences=0; subSequences < currMinHashes.length; subSequences++) {
      ArrayList<SubSequenceId> currList;
      final int hashVal=currMinHashes[subSequences][count];
synchronized (hash) {
        currList=hash.get(hashVal);
        if (currList == null) {
          currList=new ArrayList<SubSequenceId>(2);
          hash.put(hashVal,currList);
        }
      }
synchronized (currList) {
        currList.add(new SubSequenceId(seq.getId(),(short)subSequences));
      }
    }
    count++;
  }
  return true;
}

Fixed version (ground truth):
@Override public boolean addDirectionalSequence(Sequence seq){
  SequenceMinHashes currHash=getSequenceHash(seq);
  int[][] currMinHashes=currHash.getMainHashes().getSubSeqMinHashes();
  if (currMinHashes[0].length != this.hashes.size())   throw new FastAlignRuntimeException("String_Node_Str");
  SequenceMinHashes minHash=this.sequenceVectorsHash.put(seq.getId(),currHash);
  if (minHash != null) {
    this.sequenceVectorsHash.put(seq.getId(),minHash);
    throw new FastAlignRuntimeException("String_Node_Str");
  }
  if (seq.length() < this.minStoreLength)   return true;
  int count=0;
  for (  HashMap<Integer,ArrayList<SubSequenceId>> hash : this.hashes) {
    for (int subSequences=0; subSequences < currMinHashes.length; subSequences++) {
      ArrayList<SubSequenceId> currList;
      final int hashVal=currMinHashes[subSequences][count];
synchronized (hash) {
        currList=hash.get(hashVal);
        if (currList == null) {
          currList=new ArrayList<SubSequenceId>(2);
          hash.put(hashVal,currList);
        }
      }
synchronized (currList) {
        currList.add(new SubSequenceId(seq.getId(),(short)subSequences));
      }
    }
    count++;
  }
  return true;
}
Program: 169266
Project: 169266
Buggy source:
public MinHashSearch(FastaData data,int kmerSize,int numHashes,int numMinMatches,int subSequenceSize,int numThreads,boolean storeKmerInMemory,boolean storeResults,HashSet<Integer> filter) throws IOException {
  super(kmerSize,numHashes,numThreads,storeResults);
  this.numMinMatches=numMinMatches;
  this.subSequenceSize=subSequenceSize;
  this.storeKmerInMemory=storeKmerInMemory;
  this.numberSubSequencesHit=new AtomicLong();
  this.numberSequencesHit=new AtomicLong();
  this.numberSequencesFullyCompared=new AtomicLong();
  this.filter=filter;
  data.enqueueFullFile();
  this.sequenceVectorsHash=new ConcurrentHashMap<SequenceId,SequenceMinHashes>((int)data.getNumberProcessed() * 2 + 100,(float)0.75,this.numThreads);
  this.hashes=new ArrayList<HashMap<Integer,ArrayList<SubSequenceId>>>(numHashes);
  for (int iter=0; iter < numHashes; iter++)   this.hashes.add(new HashMap<Integer,ArrayList<SubSequenceId>>((int)data.getNumberProcessed() * 2 * 10));
  addData(data);
}

Fixed version (ground truth):
public MinHashSearch(FastaData data,int kmerSize,int numHashes,int numMinMatches,int subSequenceSize,int numThreads,boolean storeKmerInMemory,boolean storeResults,HashSet<Integer> filter,int maxShift) throws IOException {
  super(kmerSize,numHashes,numThreads,storeResults);
  this.numMinMatches=numMinMatches;
  this.subSequenceSize=subSequenceSize;
  this.storeKmerInMemory=storeKmerInMemory;
  this.numberSubSequencesHit=new AtomicLong();
  this.numberSequencesHit=new AtomicLong();
  this.numberSequencesFullyCompared=new AtomicLong();
  this.maxShift=maxShift;
  this.filter=filter;
  data.enqueueFullFile();
  this.sequenceVectorsHash=new ConcurrentHashMap<SequenceId,SequenceMinHashes>((int)data.getNumberProcessed() * 2 + 100,(float)0.75,this.numThreads);
  this.hashes=new ArrayList<HashMap<Integer,ArrayList<SubSequenceId>>>(numHashes);
  for (int iter=0; iter < numHashes; iter++)   this.hashes.add(new HashMap<Integer,ArrayList<SubSequenceId>>((int)data.getNumberProcessed() * 2 * 10));
  addData(data);
}
Program: 169269
Project: 169269
Buggy source:
public void process() throws NumberFormatException, IOException {
  double variance=0;
  double sum=0;
  int total=0;
  for (  int val : histogram.keySet()) {
    int count=histogram.get(val);
    for (int i=0; i < count; i++) {
      total++;
      double delta=(val - mean);
      mean+=(delta / total);
      variance+=delta * (val - mean);
      sum+=val;
    }
  }
  variance/=total;
  stdev=Math.sqrt(variance);
  double runningSum=0;
  for (  int val : histogram.keySet()) {
    int count=histogram.get(val);
    runningSum+=(double)val * count;
    if ((runningSum / sum) > percent) {
      cut=val;
      break;
    }
  }
}

Fixed version (ground truth):
public void process() throws NumberFormatException, IOException {
  double variance=0;
  double sum=0;
  int total=0;
  for (  int val : this.histogram.keySet()) {
    int count=this.histogram.get(val);
    for (int i=0; i < count; i++) {
      total++;
      double delta=(val - this.mean);
      this.mean+=(delta / total);
      variance+=delta * (val - this.mean);
      sum+=val;
    }
  }
  variance/=total;
  this.stdev=Math.sqrt(variance);
  double runningSum=0;
  for (  int val : this.histogram.keySet()) {
    int count=this.histogram.get(val);
    runningSum+=(double)val * count;
    if ((runningSum / sum) > this.percent) {
      this.cut=val;
      break;
    }
  }
}
Program: 169270
Project: 169270
Buggy source:
@Override public String toString(){
  return nf.format(mean) + "String_Node_Str" + nf.format(stdev)+ "String_Node_Str"+ "String_Node_Str"+ cut+ "String_Node_Str"+ nf.format(mean + NUM_SD * stdev);
}

Fixed version (ground truth):
@Override public String toString(){
  return nf.format(this.mean) + "String_Node_Str" + nf.format(this.stdev)+ "String_Node_Str"+ "String_Node_Str"+ this.cut+ "String_Node_Str"+ nf.format(this.mean + NUM_SD * this.stdev);
}
Program: 169271
Project: 169271
Buggy source:
public GetHistogramStats(String fileName,double p){
  try {
    BufferedReader bf=Utils.getFile(fileName,"String_Node_Str");
    String line=null;
    while ((line=bf.readLine()) != null) {
      String[] split=line.trim().split("String_Node_Str");
      int val=Integer.parseInt(split[0]);
      int count=Integer.parseInt(split[1]);
      histogram.put(val,count);
    }
    bf.close();
    percent=p;
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
public GetHistogramStats(String fileName,double p){
  try {
    BufferedReader bf=Utils.getFile(fileName,"String_Node_Str");
    String line=null;
    while ((line=bf.readLine()) != null) {
      String[] split=line.trim().split("String_Node_Str");
      int val=Integer.parseInt(split[0]);
      int count=Integer.parseInt(split[1]);
      this.histogram.put(val,count);
    }
    bf.close();
    this.percent=p;
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
}