nus-yam/ex-repair huggingface dataset:
Program: 169272
Project: 169272
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: 169273
Project: 169273
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: 169275
Project: 169275
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: 169279
Project: 169279
Buggy source:
public static void printUsage(String error){
  if (error != null) {
    System.err.println(error);
  }
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str" + DEFAULT_KMER_SIZE);
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str" + DEFAULT_NUM_WORDS);
  System.err.println("String_Node_Str" + DEFAULT_THRESHOLD);
  System.err.println("String_Node_Str" + DEFAULT_NUM_MIN_MATCHES);
  System.err.println("String_Node_Str" + DEFAULT_NUM_THREADS);
  System.err.println("String_Node_Str" + DEFAULT_SUB_SEQUENCE_SIZE);
  System.err.println("String_Node_Str" + DEFAULT_NO_SELF);
  System.exit(1);
}

Fixed version (ground truth):
public static void printUsage(String error){
  if (error != null) {
    System.err.println(error);
  }
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str" + DEFAULT_KMER_SIZE);
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str" + DEFAULT_NUM_WORDS);
  System.err.println("String_Node_Str" + DEFAULT_THRESHOLD);
  System.err.println("String_Node_Str" + DEFAULT_MAX_SHIFT_ALLOWED);
  System.err.println("String_Node_Str" + DEFAULT_NUM_MIN_MATCHES);
  System.err.println("String_Node_Str" + DEFAULT_NUM_THREADS);
  System.err.println("String_Node_Str" + DEFAULT_SUB_SEQUENCE_SIZE);
  System.err.println("String_Node_Str" + DEFAULT_NO_SELF);
  System.exit(1);
}
Program: 169280
Project: 169280
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: 169283
Project: 169283
Buggy source:
public AbstractSequenceHashes(Sequence seq){
  this.id=seq.getId();
  this.length=seq.length();
}

Fixed version (ground truth):
public AbstractSequenceHashes(Sequence seq){
  this.length=seq.length();
}
Program: 169284
Project: 169284
Buggy source:
public int numKmers(int kmerSize){
  return this.sequence.length() - kmerSize;
}

Fixed version (ground truth):
public int numKmers(int kmerSize){
  return this.sequence.length() - kmerSize + 1;
}
Program: 169287
Project: 169287
Buggy source:
public MinHash(Sequence seq,int kmerSize,int numWords){
  super(seq);
  long[][] hashes=AbstractSequenceHashes.computeKmerHashes(seq,kmerSize,numWords / 2);
  int[] minHashes=new int[numWords];
  int[] pos=new int[numWords];
  Arrays.fill(minHashes,Integer.MAX_VALUE);
  for (int kmerIndex=0; kmerIndex < hashes.length; kmerIndex++)   for (int hashIndex=0; hashIndex < numWords; hashIndex+=2) {
    long val=hashes[kmerIndex][hashIndex / 2];
    int i1=(int)(val >> 32);
    int i2=(int)val;
    if (i1 < minHashes[hashIndex])     minHashes[hashIndex]=i1;
    if (i2 < minHashes[hashIndex + 1])     minHashes[hashIndex + 1]=i2;
  }
  this.minHashes=minHashes;
  this.hashPositions=pos;
}

Fixed version (ground truth):
public MinHash(Sequence seq,int kmerSize,int numWords){
  super(seq);
  long[][] hashes=Utils.computeKmerHashes(seq,kmerSize,numWords / 2);
  int[] minHashes=new int[numWords];
  int[] pos=new int[numWords];
  Arrays.fill(minHashes,Integer.MAX_VALUE);
  for (int kmerIndex=0; kmerIndex < hashes.length; kmerIndex++)   for (int hashIndex=0; hashIndex < numWords; hashIndex+=2) {
    long val=hashes[kmerIndex][hashIndex / 2];
    int i1=(int)(val >> 32);
    int i2=(int)val;
    if (i1 < minHashes[hashIndex])     minHashes[hashIndex]=i1;
    if (i2 < minHashes[hashIndex + 1])     minHashes[hashIndex + 1]=i2;
  }
  this.minHashes=minHashes;
  this.hashPositions=pos;
}
Program: 169288
Project: 169288
Buggy source:
public AbstractSequenceHashes(Sequence seq){
  this.id=seq.getId();
  this.length=seq.length();
}

Fixed version (ground truth):
public AbstractSequenceHashes(Sequence seq){
  this.length=seq.length();
}
Program: 169289
Project: 169289
Buggy source:
public int numKmers(int kmerSize){
  return this.sequence.length() - kmerSize;
}

Fixed version (ground truth):
public int numKmers(int kmerSize){
  return this.sequence.length() - kmerSize + 1;
}
Program: 169292
Project: 169292
Buggy source:
public MinHash(Sequence seq,int kmerSize,int numWords){
  super(seq);
  long[][] hashes=AbstractSequenceHashes.computeKmerHashes(seq,kmerSize,numWords / 2);
  int[] minHashes=new int[numWords];
  int[] pos=new int[numWords];
  Arrays.fill(minHashes,Integer.MAX_VALUE);
  for (int kmerIndex=0; kmerIndex < hashes.length; kmerIndex++)   for (int hashIndex=0; hashIndex < numWords; hashIndex+=2) {
    long val=hashes[kmerIndex][hashIndex / 2];
    int i1=(int)(val >> 32);
    int i2=(int)val;
    if (i1 < minHashes[hashIndex])     minHashes[hashIndex]=i1;
    if (i2 < minHashes[hashIndex + 1])     minHashes[hashIndex + 1]=i2;
  }
  this.minHashes=minHashes;
  this.hashPositions=pos;
}

Fixed version (ground truth):
public MinHash(Sequence seq,int kmerSize,int numWords){
  super(seq);
  long[][] hashes=Utils.computeKmerHashes(seq,kmerSize,numWords / 2);
  int[] minHashes=new int[numWords];
  int[] pos=new int[numWords];
  Arrays.fill(minHashes,Integer.MAX_VALUE);
  for (int kmerIndex=0; kmerIndex < hashes.length; kmerIndex++)   for (int hashIndex=0; hashIndex < numWords; hashIndex+=2) {
    long val=hashes[kmerIndex][hashIndex / 2];
    int i1=(int)(val >> 32);
    int i2=(int)val;
    if (i1 < minHashes[hashIndex])     minHashes[hashIndex]=i1;
    if (i2 < minHashes[hashIndex + 1])     minHashes[hashIndex + 1]=i2;
  }
  this.minHashes=minHashes;
  this.hashPositions=pos;
}
Program: 169294
Project: 169294
Buggy source:
public static void printUsage(String error){
  if (error != null) {
    System.err.println(error);
  }
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str" + DEFAULT_K);
  System.err.println("String_Node_Str" + DEFAULT_HASHES);
  System.err.println("String_Node_Str" + DEFAULT_THRESHOLD);
  System.err.println("String_Node_Str" + DEFAULT_SKIP);
  System.exit(1);
}

Fixed version (ground truth):
public static void printUsage(String error){
  if (error != null) {
    System.err.println(error);
  }
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str" + DEFAULT_KMER_SIZE);
  System.err.println("String_Node_Str" + DEFAULT_NUM_HASHES);
  System.err.println("String_Node_Str" + DEFAULT_THRESHOLD);
  System.err.println("String_Node_Str" + DEFAULT_SKIP);
  System.exit(1);
}
Program: 169295
Project: 169295
Buggy source:
@Override public int compareTo(MatchResult o){
  return Double.compare(this.score,o.score);
}

Fixed version (ground truth):
@Override public int compareTo(MatchResult o){
  return -Double.compare(this.score,o.score);
}
Program: 169296
Project: 169296
Buggy source:
public List<MatchResult> findMatches(Sequence seq,double threshold){
  HashMap<SequenceId,Integer> counts=new HashMap<SequenceId,Integer>();
  long[] hashes=getHashes(seq);
  for (int hashIndex=0; hashIndex < this.numHashes; hashIndex++) {
    ArrayList<SequenceId> matchedList=this.hashes.get(hashIndex).get(hashes[hashIndex]);
    if (matchedList != null) {
      for (      SequenceId matchedId : matchedList) {
        Integer currentCount=counts.get(matchedId);
        if (currentCount == null)         counts.put(matchedId,1);
 else         counts.put(matchedId,currentCount + 1);
      }
    }
  }
  ArrayList<MatchResult> matches=new ArrayList<MatchResult>();
  for (  SequenceId id : counts.keySet()) {
    int count=counts.get(id);
    double ratio=(double)this.seqLengths.get(id) / (double)seq.length();
    if (ratio < 1.0)     ratio=1.0 / ratio;
    double score=(double)count * ratio;
    if (score > threshold)     matches.add(new MatchResult(seq.getId(),id,score));
  }
  Collections.sort(matches);
  return matches;
}

Fixed version (ground truth):
public List<MatchResult> findMatches(Sequence seq,double threshold){
  HashMap<SequenceId,Integer> counts=new HashMap<SequenceId,Integer>();
  long[] hashes=getHashes(seq);
  for (int hashIndex=0; hashIndex < this.numHashes; hashIndex++) {
    ArrayList<SequenceId> matchedList=this.hashes.get(hashIndex).get(hashes[hashIndex]);
    if (matchedList != null) {
      for (      SequenceId matchedId : matchedList) {
        Integer currentCount=counts.get(matchedId);
        if (currentCount == null)         counts.put(matchedId,1);
 else         counts.put(matchedId,currentCount + 1);
      }
    }
  }
  ArrayList<MatchResult> matches=new ArrayList<MatchResult>();
  for (  SequenceId id : counts.keySet()) {
    int count=counts.get(id);
    double ratio=(double)this.seqLengths.get(id) / (double)seq.length();
    if (ratio < 1.0)     ratio=1.0 / ratio;
    double score=(double)count * ratio / (double)this.numHashes;
    if (score > threshold)     matches.add(new MatchResult(seq.getId(),id,score));
  }
  Collections.sort(matches);
  return matches;
}
Program: 169297
Project: 169297
Buggy source:
public void addData(ReadData data){
  for (  Sequence seq : data.getSequences()) {
    addSequence(seq);
  }
}

Fixed version (ground truth):
public void addData(FastaData data){
  for (  Sequence seq : data.getSequences()) {
    addSequence(seq);
  }
}
Program: 169298
Project: 169298
Buggy source:
private long[] getHashes(Sequence seq){
  long[] hashes=new long[this.numHashes];
  for (int iter=0; iter < seq.numKmers(); iter++) {
    String kmer=seq.getKmer(iter);
    for (int hashIndex=0; hashIndex < this.numHashes; hashIndex++) {
      long salt=hashIndex * 10;
      long hash=hashBasic(kmer,salt);
      if (hash < hashes[hashIndex])       hashes[hashIndex]=hash;
    }
  }
  return hashes;
}

Fixed version (ground truth):
private long[] getHashes(Sequence seq){
  long[] hashes=new long[this.numHashes];
  Arrays.fill(hashes,Long.MAX_VALUE);
  for (int iter=0; iter < seq.numKmers(); iter++) {
    String kmer=seq.getKmer(iter);
    for (int hashIndex=0; hashIndex < this.numHashes; hashIndex++) {
      long salt=hashIndex * 10;
      long hash=hashBasic(kmer,salt);
      if (hash < hashes[hashIndex])       hashes[hashIndex]=hash;
    }
  }
  return hashes;
}
Program: 169299
Project: 169299
Buggy source:
public void addSequence(Sequence seq){
  this.seqLengths.put(seq.getId(),seq.length());
  long[] hashValues=getHashes(seq);
  int count=0;
  for (  HashMap<Long,ArrayList<SequenceId>> hash : this.hashes) {
    ArrayList<SequenceId> currList=hash.get(hashValues[count]);
    if (currList == null)     currList=new ArrayList<SequenceId>();
    currList.add(seq.getId());
    count++;
  }
}

Fixed version (ground truth):
public void addSequence(Sequence seq){
  this.seqLengths.put(seq.getId(),seq.length());
  long[] hashValues=getHashes(seq);
  int count=0;
  for (  HashMap<Long,ArrayList<SequenceId>> hash : this.hashes) {
    ArrayList<SequenceId> currList=hash.get(hashValues[count]);
    if (currList == null) {
      currList=new ArrayList<SequenceId>();
      hash.put(hashValues[count],currList);
    }
    currList.add(seq.getId());
    count++;
  }
}
Program: 169301
Project: 169301
Buggy source:
public static void printUsage(String error){
  if (error != null) {
    System.err.println(error);
  }
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str" + DEFAULT_K);
  System.err.println("String_Node_Str" + DEFAULT_HASHES);
  System.err.println("String_Node_Str" + DEFAULT_THRESHOLD);
  System.err.println("String_Node_Str" + DEFAULT_SKIP);
  System.exit(1);
}

Fixed version (ground truth):
public static void printUsage(String error){
  if (error != null) {
    System.err.println(error);
  }
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str");
  System.err.println("String_Node_Str" + DEFAULT_KMER_SIZE);
  System.err.println("String_Node_Str" + DEFAULT_NUM_HASHES);
  System.err.println("String_Node_Str" + DEFAULT_THRESHOLD);
  System.err.println("String_Node_Str" + DEFAULT_SKIP);
  System.exit(1);
}
Program: 169302
Project: 169302
Buggy source:
@Override public int compareTo(MatchResult o){
  return Double.compare(this.score,o.score);
}

Fixed version (ground truth):
@Override public int compareTo(MatchResult o){
  return -Double.compare(this.score,o.score);
}
Program: 169303
Project: 169303
Buggy source:
public List<MatchResult> findMatches(Sequence seq,double threshold){
  HashMap<SequenceId,Integer> counts=new HashMap<SequenceId,Integer>();
  long[] hashes=getHashes(seq);
  for (int hashIndex=0; hashIndex < this.numHashes; hashIndex++) {
    ArrayList<SequenceId> matchedList=this.hashes.get(hashIndex).get(hashes[hashIndex]);
    if (matchedList != null) {
      for (      SequenceId matchedId : matchedList) {
        Integer currentCount=counts.get(matchedId);
        if (currentCount == null)         counts.put(matchedId,1);
 else         counts.put(matchedId,currentCount + 1);
      }
    }
  }
  ArrayList<MatchResult> matches=new ArrayList<MatchResult>();
  for (  SequenceId id : counts.keySet()) {
    int count=counts.get(id);
    double ratio=(double)this.seqLengths.get(id) / (double)seq.length();
    if (ratio < 1.0)     ratio=1.0 / ratio;
    double score=(double)count * ratio;
    if (score > threshold)     matches.add(new MatchResult(seq.getId(),id,score));
  }
  Collections.sort(matches);
  return matches;
}

Fixed version (ground truth):
public List<MatchResult> findMatches(Sequence seq,double threshold){
  HashMap<SequenceId,Integer> counts=new HashMap<SequenceId,Integer>();
  long[] hashes=getHashes(seq);
  for (int hashIndex=0; hashIndex < this.numHashes; hashIndex++) {
    ArrayList<SequenceId> matchedList=this.hashes.get(hashIndex).get(hashes[hashIndex]);
    if (matchedList != null) {
      for (      SequenceId matchedId : matchedList) {
        Integer currentCount=counts.get(matchedId);
        if (currentCount == null)         counts.put(matchedId,1);
 else         counts.put(matchedId,currentCount + 1);
      }
    }
  }
  ArrayList<MatchResult> matches=new ArrayList<MatchResult>();
  for (  SequenceId id : counts.keySet()) {
    int count=counts.get(id);
    double ratio=(double)this.seqLengths.get(id) / (double)seq.length();
    if (ratio < 1.0)     ratio=1.0 / ratio;
    double score=(double)count * ratio / (double)this.numHashes;
    if (score > threshold)     matches.add(new MatchResult(seq.getId(),id,score));
  }
  Collections.sort(matches);
  return matches;
}
Program: 169304
Project: 169304
Buggy source:
public void addData(ReadData data){
  for (  Sequence seq : data.getSequences()) {
    addSequence(seq);
  }
}

Fixed version (ground truth):
public void addData(FastaData data){
  for (  Sequence seq : data.getSequences()) {
    addSequence(seq);
  }
}
Program: 169305
Project: 169305
Buggy source:
private long[] getHashes(Sequence seq){
  long[] hashes=new long[this.numHashes];
  for (int iter=0; iter < seq.numKmers(); iter++) {
    String kmer=seq.getKmer(iter);
    for (int hashIndex=0; hashIndex < this.numHashes; hashIndex++) {
      long salt=hashIndex * 10;
      long hash=hashBasic(kmer,salt);
      if (hash < hashes[hashIndex])       hashes[hashIndex]=hash;
    }
  }
  return hashes;
}

Fixed version (ground truth):
private long[] getHashes(Sequence seq){
  long[] hashes=new long[this.numHashes];
  Arrays.fill(hashes,Long.MAX_VALUE);
  for (int iter=0; iter < seq.numKmers(); iter++) {
    String kmer=seq.getKmer(iter);
    for (int hashIndex=0; hashIndex < this.numHashes; hashIndex++) {
      long salt=hashIndex * 10;
      long hash=hashBasic(kmer,salt);
      if (hash < hashes[hashIndex])       hashes[hashIndex]=hash;
    }
  }
  return hashes;
}
Program: 169306
Project: 169306
Buggy source:
public void addSequence(Sequence seq){
  this.seqLengths.put(seq.getId(),seq.length());
  long[] hashValues=getHashes(seq);
  int count=0;
  for (  HashMap<Long,ArrayList<SequenceId>> hash : this.hashes) {
    ArrayList<SequenceId> currList=hash.get(hashValues[count]);
    if (currList == null)     currList=new ArrayList<SequenceId>();
    currList.add(seq.getId());
    count++;
  }
}

Fixed version (ground truth):
public void addSequence(Sequence seq){
  this.seqLengths.put(seq.getId(),seq.length());
  long[] hashValues=getHashes(seq);
  int count=0;
  for (  HashMap<Long,ArrayList<SequenceId>> hash : this.hashes) {
    ArrayList<SequenceId> currList=hash.get(hashValues[count]);
    if (currList == null) {
      currList=new ArrayList<SequenceId>();
      hash.put(hashValues[count],currList);
    }
    currList.add(seq.getId());
    count++;
  }
}
Program: 169307
Project: 169307
Buggy source:
public Ball(){
  this.name="String_Node_Str";
  Pixmap ballPixmap=new Pixmap(10,10,Pixmap.Format.RGBA8888);
  ballPixmap.setColor(Color.PINK);
  ballPixmap.fill();
  ballImage=new Texture(ballPixmap);
  resetPosition();
  this.width=ballImage.getWidth();
  this.height=ballImage.getHeight();
  this.xVel=-200f;
  this.yVel=-200f;
}

Fixed version (ground truth):
public Ball(){
  this.name="String_Node_Str";
  Pixmap ballPixmap=new Pixmap(12,12,Pixmap.Format.RGBA8888);
  ballPixmap.setColor(Color.WHITE);
  ballPixmap.fill();
  ballImage=new Texture(ballPixmap);
  resetPosition();
  this.width=ballImage.getWidth();
  this.height=ballImage.getHeight();
  this.xVel=-200f;
  this.yVel=-200f;
}
Program: 169308
Project: 169308
Buggy source:
public ParticleEmitter(){
  bigTexture=makeParticle(3,3,Color.ORANGE);
  mediumTexture=makeParticle(2,2,Color.YELLOW);
  smallTexture=makeParticle(1,1,Color.YELLOW);
  timer=TimeUtils.millis();
}

Fixed version (ground truth):
public ParticleEmitter(){
  bigTexture=makeParticle(4,4,Color.ORANGE);
  mediumTexture=makeParticle(3,3,Color.YELLOW);
  smallTexture=makeParticle(2,2,Color.YELLOW);
  timer=TimeUtils.millis();
}
Program: 169309
Project: 169309
Buggy source:
public void update(Ball ball,float delta){
  makeParticles(ball,delta);
  updateParticles(delta);
  killOldParticles();
}

Fixed version (ground truth):
public void update(Ball ball,float delta){
  if (state.equals("String_Node_Str")) {
    makeParticles(ball,delta);
    updateParticles(delta);
    killOldParticles();
  }
 else {
    updateParticles(delta);
    killOldParticles();
  }
}
Program: 169310
Project: 169310
Buggy source:
private void killOldParticles(){
  Iterator<Particle> itr=particles.iterator();
  while (itr.hasNext()) {
    Particle particle=itr.next();
    if (TimeUtils.timeSinceMillis(particle.birthTime) > 500) {
      particle.dispose();
      itr.remove();
    }
  }
}

Fixed version (ground truth):
private void killOldParticles(){
  Iterator<Particle> itr=particles.iterator();
  while (itr.hasNext()) {
    Particle particle=itr.next();
    if (TimeUtils.timeSinceMillis(particle.birthTime) > 500) {
      itr.remove();
    }
  }
}
Program: 169311
Project: 169311
Buggy source:
private void startScreenShake(){
  timeToShake=true;
  startOfShakeTime=TimeUtils.millis();
}

Fixed version (ground truth):
private void startScreenShake(){
  if (allowScreenShake) {
    timeToShake=true;
    startOfShakeTime=TimeUtils.millis();
  }
}
Program: 169312
Project: 169312
Buggy source:
private void checkTotalPaddleHits(){
  if (paddleHits >= 3) {
    state="String_Node_Str";
  }
}

Fixed version (ground truth):
private void checkTotalPaddleHits(){
  if (paddleHits >= 3) {
    particleEmitter.setState("String_Node_Str");
    allowScreenShake=true;
  }
}
Program: 169313
Project: 169313
Buggy source:
@Override public void render(float delta){
  camera.update();
  screenShake();
  updateBallMovement(delta);
  checkPaddleOutOfBounds();
  checkForGameOver();
  checkTotalPaddleHits();
  if (state.equals("String_Node_Str")) {
    particleEmitter.update(ball,delta);
  }
  Gdx.gl.glClearColor(0,0,0,1);
  Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
  batchDraw();
}

Fixed version (ground truth):
@Override public void render(float delta){
  camera.update();
  screenShake();
  updateBallMovement(delta);
  checkPaddleOutOfBounds();
  checkForGameOver();
  checkTotalPaddleHits();
  particleEmitter.update(ball,delta);
  Gdx.gl.glClearColor(0,0,0,1);
  Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
  batchDraw();
}
Program: 169314
Project: 169314
Buggy source:
private void enterNormalState(){
  paddleHits=0;
  state="String_Node_Str";
}

Fixed version (ground truth):
private void enterNormalState(){
  paddleHits=0;
  particleEmitter.setState("String_Node_Str");
  allowScreenShake=false;
}
Program: 169315
Project: 169315
Buggy source:
public PongBoard(final PongForAndroid gam){
  this.game=gam;
  state="String_Node_Str";
  timeToShake=false;
  arialFont=new BitmapFont();
  arialFont.scale(3);
  player1Score=0;
  player2Score=0;
  paddleHits=0;
  paddleCollisionSound=Gdx.audio.newSound(Gdx.files.internal("String_Node_Str"));
  mainMusic=Gdx.audio.newMusic(Gdx.files.internal("String_Node_Str"));
  setupPaddles();
  setupNet();
  ball=new Ball();
  camera=new OrthographicCamera();
  camera.setToOrtho(false,800,480);
  particleEmitter=new ParticleEmitter();
  Gdx.input.setInputProcessor(new MainInputProcessor());
}

Fixed version (ground truth):
public PongBoard(final PongForAndroid gam){
  this.game=gam;
  timeToShake=false;
  arialFont=new BitmapFont();
  arialFont.scale(3);
  player1Score=0;
  player2Score=0;
  paddleHits=0;
  paddleCollisionSound=Gdx.audio.newSound(Gdx.files.internal("String_Node_Str"));
  mainMusic=Gdx.audio.newMusic(Gdx.files.internal("String_Node_Str"));
  setupPaddles();
  setupNet();
  ball=new Ball();
  camera=new OrthographicCamera();
  camera.setToOrtho(false,800,480);
  particleEmitter=new ParticleEmitter();
  Gdx.input.setInputProcessor(new MainInputProcessor());
}
Program: 169316
Project: 169316
Buggy source:
private void batchDraw(){
  game.batch.setProjectionMatrix(camera.combined);
  game.batch.begin();
  game.batch.draw(paddle1.paddleImage,paddle1.x,paddle1.y);
  game.batch.draw(paddle2.paddleImage,paddle2.x,paddle2.y);
  game.batch.draw(ball.ballImage,ball.x,ball.y);
  for (  Rectangle netPiece : net) {
    game.batch.draw(netTexture,netPiece.getX(),netPiece.getY());
  }
  arialFont.draw(game.batch,String.valueOf(player1Score),200,HEIGHT - 50);
  arialFont.draw(game.batch,String.valueOf(player2Score),WIDTH - 200,HEIGHT - 50);
  particleEmitter.drawParticles(game.batch);
  game.batch.end();
}

Fixed version (ground truth):
private void batchDraw(){
  game.batch.setProjectionMatrix(camera.combined);
  game.batch.begin();
  game.batch.draw(paddle1.paddleImage,paddle1.x,paddle1.y);
  game.batch.draw(paddle2.paddleImage,paddle2.x,paddle2.y);
  for (  Rectangle netPiece : net) {
    game.batch.draw(netTexture,netPiece.getX(),netPiece.getY());
  }
  arialFont.draw(game.batch,String.valueOf(player1Score),200,HEIGHT - 50);
  arialFont.draw(game.batch,String.valueOf(player2Score),WIDTH - 200,HEIGHT - 50);
  particleEmitter.drawParticles(game.batch);
  game.batch.draw(ball.ballImage,ball.x,ball.y);
  game.batch.end();
}
Program: 169317
Project: 169317
Buggy source:
public void setPaddleLocation(int screenX,int screenY){
  if (screenX < (WIDTH / 2)) {
    paddle1.setCenterY(HEIGHT - screenY);
  }
 else   if (screenX > (WIDTH / 2)) {
    paddle2.setCenterY(HEIGHT - screenY);
  }
}

Fixed version (ground truth):
public void setPaddleLocation(Vector3 pos){
  if (pos.x < (WIDTH / 2)) {
    paddle1.setCenterY(pos.y);
  }
 else   if (pos.x > (WIDTH / 2)) {
    paddle2.setCenterY(pos.y);
  }
}
Program: 169318
Project: 169318
Buggy source:
private void checkPaddleOutOfBounds(){
  for (  Paddle paddle : paddleList) {
    if (paddle.getTop() > PongForAndroid.HEIGHT) {
      paddle.y=PongForAndroid.HEIGHT - paddle.height;
    }
 else     if (paddle.y < 0) {
      paddle.y=0;
    }
  }
}

Fixed version (ground truth):
private void checkPaddleOutOfBounds(){
  for (  Paddle paddle : paddleList) {
    if (paddle.getTop() > HEIGHT) {
      paddle.setTop(HEIGHT);
    }
 else     if (paddle.y < 0) {
      paddle.setY(0);
    }
  }
}
Program: 169319
Project: 169319
Buggy source:
public PongBoard(final PongForAndroid gam){
  this.game=gam;
  setupPaddles();
  setupNet();
  ball=new Ball();
  camera=new OrthographicCamera();
  camera.setToOrtho(false,PongForAndroid.WIDTH,PongForAndroid.HEIGHT);
  Gdx.input.setInputProcessor(new MainInputProcessor());
}

Fixed version (ground truth):
public PongBoard(final PongForAndroid gam){
  this.game=gam;
  setupPaddles();
  setupNet();
  ball=new Ball();
  camera=new OrthographicCamera();
  camera.setToOrtho(false,800,480);
  Gdx.input.setInputProcessor(new MainInputProcessor());
}
Program: 169320
Project: 169320
Buggy source:
@Override public boolean touchDown(int screenX,int screenY,int pointer,int button){
  setPaddleLocation(screenX,screenY);
  return true;
}

Fixed version (ground truth):
@Override public boolean touchDown(int screenX,int screenY,int pointer,int button){
  setPaddleLocation(camera.unproject(tmpV.set(screenX,screenY,0)));
  return true;
}
Program: 169321
Project: 169321
Buggy source:
@Override public boolean touchDragged(int screenX,int screenY,int pointer){
  setPaddleLocation(screenX,screenY);
  return true;
}

Fixed version (ground truth):
@Override public boolean touchDragged(int screenX,int screenY,int pointer){
  setPaddleLocation(camera.unproject(tmpV.set(screenX,screenY,0)));
  return true;
}
Program: 169322
Project: 169322
Buggy source:
private void checkForWallCollision(){
  if (ball.getTop() > PongForAndroid.HEIGHT) {
    ball.reverseDirectionY();
  }
 else   if (ball.getY() < 0) {
    ball.reverseDirectionY();
  }
}

Fixed version (ground truth):
private void checkForWallCollision(){
  if (ball.getTop() > HEIGHT) {
    ball.reverseDirectionY();
    ball.setTop(HEIGHT);
  }
 else   if (ball.getY() < 0) {
    ball.reverseDirectionY();
    ball.setBottom(0f);
  }
}
Program: 169323
Project: 169323
Buggy source:
public void setupNet(){
  net=new ArrayList<Rectangle>();
  for (int i=0; i < 6; i++) {
    int xPos=(PongForAndroid.WIDTH / 2);
    int yPos=0;
    Pixmap netPixmap=new Pixmap(5,5,Pixmap.Format.RGBA8888);
    netPixmap.setColor(Color.WHITE);
    netPixmap.fill();
    netTexture=new Texture(netPixmap);
    Rectangle newNetPiece=new Rectangle();
    newNetPiece.x=xPos;
    newNetPiece.y=yPos + (i * PongForAndroid.HEIGHT / 6) + 35;
    newNetPiece.width=netTexture.getWidth();
    newNetPiece.height=netTexture.getHeight();
    net.add(newNetPiece);
    netPixmap.dispose();
  }
}

Fixed version (ground truth):
public void setupNet(){
  net=new ArrayList<Rectangle>();
  for (int i=0; i < 6; i++) {
    int xPos=(WIDTH / 2);
    int yPos=0;
    Pixmap netPixmap=new Pixmap(5,5,Pixmap.Format.RGBA8888);
    netPixmap.setColor(Color.WHITE);
    netPixmap.fill();
    netTexture=new Texture(netPixmap);
    Rectangle newNetPiece=new Rectangle();
    newNetPiece.x=xPos;
    newNetPiece.y=yPos + (i * HEIGHT / 6) + 35;
    newNetPiece.width=netTexture.getWidth();
    newNetPiece.height=netTexture.getHeight();
    net.add(newNetPiece);
    netPixmap.dispose();
  }
}
Program: 169324
Project: 169324
Buggy source:
private void checkForBallOutOfBounds(){
  if (ball.x < 0 || ball.getRight() > PongForAndroid.WIDTH) {
    ball.resetPosition();
    ball.reverseDirectionX();
    ball.reverseDirectionY();
  }
}

Fixed version (ground truth):
private void checkForBallOutOfBounds(){
  if (ball.x < 0 || ball.getRight() > WIDTH) {
    ball.resetPosition();
    ball.reverseDirectionX();
    ball.reverseDirectionY();
  }
}
Program: 169325
Project: 169325
Buggy source:
public final synchronized int getRelativePollValue(int current_abs_value){
  int rel_value=current_abs_value - last_poll_value;
  last_poll_value=current_abs_value;
  return rel_value;
}

Fixed version (ground truth):
public final synchronized int getRelativePollValue(int current_abs_value){
  if (device.areAxesRelative())   return current_abs_value;
  int rel_value=current_abs_value - last_poll_value;
  last_poll_value=current_abs_value;
  return rel_value;
}
Program: 169326
Project: 169326
Buggy source:
private final boolean isAxis(){
  return (type & IDirectInputDevice.DIDFT_AXIS) != 0;
}

Fixed version (ground truth):
public final boolean isAxis(){
  return (type & IDirectInputDevice.DIDFT_AXIS) != 0;
}
Program: 169327
Project: 169327
Buggy source:
public final synchronized int getRelativeEventValue(int current_abs_value){
  int rel_value=current_abs_value - last_event_value;
  last_event_value=current_abs_value;
  return rel_value;
}

Fixed version (ground truth):
public final synchronized int getRelativeEventValue(int current_abs_value){
  if (device.areAxesRelative())   return current_abs_value;
  int rel_value=current_abs_value - last_event_value;
  last_event_value=current_abs_value;
  return rel_value;
}
Program: 169329
Project: 169329
Buggy source:
/** 
 * Returns the data from the last time the control has been polled. If this axis is a button, the value returned will be either 0.0f or 1.0f. If this axis is normalized, the value returned will be between -1.0f and 1.0f.
 * @return A float between -1.0 and 1.0
 */
public float getPollData(){
}

Fixed version (ground truth):
/** 
 * Returns the data from the last time the control has been polled. If this axis is a button, the value returned will be either 0.0f or 1.0f. If this axis is normalized, the value returned will be between -1.0f and 1.0f.
 * @return A float between -1.0 and 1.0
 */
public float getPollData(){
  int data=0;
  try {
    data=((device.data[offset] >> bitshift) & bitmask);
  }
 catch (  ArrayIndexOutOfBoundsException e) {
    System.out.println("String_Node_Str" + this.getName() + "String_Node_Str"+ offset+ "String_Node_Str"+ device.data.length+ "String_Node_Str");
  }
  if ((type & DIDFT_BUTTON) != 0) {
    return (float)((data & 0x80) >> 7);
  }
 else   if ((type & DIDFT_AXIS) != 0) {
    return ((float)data) / 32768;
  }
 else   if ((type & DIDFT_POV) != 0) {
    if (data == -1) {
      return Component.POV.OFF;
    }
 else     if (data == 0.0) {
      return Component.POV.UP;
    }
 else     if (data == 4500) {
      return Component.POV.UP_RIGHT;
    }
 else     if (data == 9000) {
      return Component.POV.RIGHT;
    }
 else     if (data == 13500) {
      return Component.POV.DOWN_RIGHT;
    }
 else     if (data == 18000) {
      return Component.POV.DOWN;
    }
 else     if (data == 22500) {
      return Component.POV.DOWN_LEFT;
    }
 else     if (data == 27000) {
      return Component.POV.LEFT;
    }
 else     if (data == 31500) {
      return Component.POV.UP_LEFT;
    }
 else {
      System.err.print("String_Node_Str" + data);
      return Component.POV.OFF;
    }
  }
 else {
    return (float)data;
  }
}
Program: 169330
Project: 169330
Buggy source:
/** 
 * Return the enumeration of supported button types for this device
 * @param supportedButtons Array to populate
 */
private void getSupportedButtons(int supportedButtons[]){
  getNativeSupportedButtons(nativeID,supportedButtons);
}

Fixed version (ground truth):
/** 
 * Return the enumeration of supported button types for this device
 * @param supportedButtons Array to populate
 */
private void getSupportedButtons(int supportedButtons[]){
  if (supportedButtons.length == 0) {
    return;
  }
  getNativeSupportedButtons(nativeID,supportedButtons);
}
Program: 169331
Project: 169331
Buggy source:
/** 
 * Create the buttons for the device
 * @param numButtons The number of buttons the device has
 */
private void createButtons(int numButtons){
  int supportedButtons[]=new int[numButtons];
  getSupportedButtons(supportedButtons);
  buttons=new LinuxAxis[numButtons];
  for (int i=0; i < numButtons; i++) {
    buttons[i]=createButton(i,supportedButtons[i]);
  }
}

Fixed version (ground truth):
/** 
 * Create the buttons for the device
 * @param numButtons The number of buttons the device has
 */
private void createButtons(int numButtons){
  int supportedButtons[]=new int[numButtons];
  buttons=new LinuxAxis[numButtons];
  if (numButtons > 0) {
    getSupportedButtons(supportedButtons);
    for (int i=0; i < numButtons; i++) {
      buttons[i]=createButton(i,supportedButtons[i]);
    }
  }
}
Program: 169333
Project: 169333
Buggy source:
/** 
 * Creates a new device, adding it to the list supplied.
 * @param lpDevice A pointer to the IDirectInputDevice for the device.
 * @param type The type of device to create, as defined by the constantsin dinput.h (see DI8DEVTYPE constants above).
 * @param productName The product name for the device
 * @param instanceName The name of the device
 */
private void addDevice(ArrayList list,long lpDevice,int type,String productName,String instanceName,boolean polled){
}

Fixed version (ground truth):
/** 
 * Creates a new device, adding it to the list supplied.
 * @param lpDevice A pointer to the IDirectInputDevice for the device.
 * @param type The type of device to create, as defined by the constantsin dinput.h (see DI8DEVTYPE constants above).
 * @param productName The product name for the device
 * @param instanceName The name of the device
 */
private void addDevice(ArrayList list,long lpDevice,int type,String productName,String instanceName,boolean polled){
  Controller c;
  int category=GET_DIDEVICE_TYPE(type);
  int subtype=GET_DIDEVICE_SUBTYPE(type);
  if (category == DI8DEVTYPE_MOUSE) {
    c=DirectInputMouse.createMouse(lpDevice,subtype,productName,instanceName);
  }
 else   if (category == DI8DEVTYPE_KEYBOARD) {
    c=DirectInputKeyboard.createKeyboard(lpDevice,subtype,productName,instanceName);
  }
 else {
    c=DirectInputDevice.createDevice(lpDevice,subtype,productName,instanceName,polled);
  }
  if (c != null) {
    list.add(c);
  }
}
Program: 169334
Project: 169334
Buggy source:
/** 
 * Public constructor
 */
public ButtonsImpl(){
  super(DirectInputMouse.this.getName() + "String_Node_Str");
  left=new ButtonImpl(ButtonID.LEFT);
  right=new ButtonImpl(ButtonID.RIGHT);
  middle=new ButtonImpl(ButtonID.MIDDLE);
}

Fixed version (ground truth):
/** 
 * Public constructor
 */
public ButtonsImpl(){
  super(DirectInputMouse.this.getName() + "String_Node_Str");
  numButtons=getNumButtons(lpDevice);
  left=new ButtonImpl(ButtonID.LEFT);
  right=new ButtonImpl(ButtonID.RIGHT);
  if (numButtons > 2) {
    middle=new ButtonImpl(ButtonID.MIDDLE);
  }
  if (numButtons > 3) {
    side=new ButtonImpl(ButtonID.SIDE);
  }
  if (numButtons > 4) {
    extra=new ButtonImpl(ButtonID.EXTRA);
  }
  if (numButtons > 5) {
    forward=new ButtonImpl(ButtonID.FORWARD);
  }
  if (numButtons > 6) {
    back=new ButtonImpl(ButtonID.BACK);
  }
}
Program: 169335
Project: 169335
Buggy source:
/** 
 * Returns the data from the last time the control has been polled. If this axis is a button, the value returned will be either 0.0f or 1.0f. If this axis is normalized, the value returned will be between -1.0f and 1.0f.
 * @return  data.  (Note that mice queue state in DX8 so whatis returned is the next stae in the queue, not necessarily the most current one.)
 */
public float getPollData(){
  int data=((int)mouseData[index] << 12) | ((int)mouseData[index + 1] << 8) | ((int)mouseData[index + 2] << 4)| ((int)mouseData[index + 3]);
  if (data == -1) {
    return -1.0f;
  }
 else   if (data >= 1) {
    return 1.0f;
  }
 else {
    return 0.0f;
  }
}

Fixed version (ground truth):
/** 
 * Returns the data from the last time the control has been polled.
 * @return data The total mouse axis change since the last poll
 */
public float getPollData(){
  int data=((int)mouseData[index + 3] << 24) | ((int)mouseData[index + 2] << 16) | ((int)mouseData[index + 1] << 8)| ((int)mouseData[index]);
  return (float)data;
}
Program: 169336
Project: 169336
Buggy source:
/** 
 * Public constructor
 */
public BallImpl(){
  super(DirectInputMouse.this.getName() + "String_Node_Str");
  x=new BallAxis(Axis.Identifier.X);
  y=new BallAxis(Axis.Identifier.Y);
  wheel=new BallAxis(Axis.Identifier.SLIDER);
}

Fixed version (ground truth):
/** 
 * Public constructor
 */
public BallImpl(){
  super(DirectInputMouse.this.getName() + "String_Node_Str");
  numAxes=getNumAxes(lpDevice);
  x=new BallAxis(Axis.Identifier.X);
  y=new BallAxis(Axis.Identifier.Y);
  if (numAxes > 2) {
    wheel=new BallAxis(Axis.Identifier.SLIDER);
  }
}
Program: 169337
Project: 169337
Buggy source:
/** 
 * Public constructor
 * @param id An ID of a button to create an obejct to represent.
 */
public ButtonImpl(ButtonID id){
  super(id.getName(),id);
  if (id == ButtonID.LEFT) {
    index=12;
  }
 else   if (id == ButtonID.RIGHT) {
    index=13;
  }
 else   if (id == ButtonID.MIDDLE) {
    index=14;
  }
 else {
    throw new RuntimeException("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Public constructor
 * @param id An ID of a button to create an obejct to represent.
 */
public ButtonImpl(ButtonID id){
  super(id.getName(),id);
  if (id == ButtonID.LEFT) {
    index=12;
  }
 else   if (id == ButtonID.RIGHT) {
    index=13;
  }
 else   if (id == ButtonID.MIDDLE) {
    index=14;
  }
 else   if (id == ButtonID.SIDE) {
    index=15;
  }
 else   if (id == ButtonID.EXTRA) {
    index=16;
  }
 else   if (id == ButtonID.FORWARD) {
    index=17;
  }
 else   if (id == ButtonID.BACK) {
    index=18;
  }
 else {
    throw new RuntimeException("String_Node_Str");
  }
}
Program: 169338
Project: 169338
Buggy source:
/** 
 * Private constructor
 * @param lpDevice A pointer to the IDirectInputDevice for the device.
 * @param subtype The subtype of mouse, as defined in the DIDEVTYPEconstants above
 * @param productName The product name for the device
 * @param instanceName The name of the device
 */
private DirectInputMouse(long lpDevice,int subtype,String productName,String instanceName){
  super(productName + "String_Node_Str" + instanceName);
  buttons=new ButtonsImpl();
  ball=new BallImpl();
  this.lpDevice=lpDevice;
switch (subtype) {
case DIDEVTYPEMOUSE_FINGERSTICK:
    type=Type.FINGERSTICK;
  break;
case DIDEVTYPEMOUSE_TOUCHPAD:
type=Type.TRACKPAD;
break;
case DIDEVTYPEMOUSE_TRACKBALL:
type=Type.TRACKBALL;
break;
case DIDEVTYPEMOUSE_TRADITIONAL:
case DIDEVTYPEMOUSE_UNKNOWN:
default :
type=Type.MOUSE;
break;
}
renameAxes(lpDevice);
}

Fixed version (ground truth):
/** 
 * Private constructor
 * @param lpDevice A pointer to the IDirectInputDevice for the device.
 * @param subtype The subtype of mouse, as defined in the DIDEVTYPEconstants above
 * @param productName The product name for the device
 * @param instanceName The name of the device
 */
private DirectInputMouse(long lpDevice,int subtype,String productName,String instanceName){
  super(productName + "String_Node_Str" + instanceName);
  this.lpDevice=lpDevice;
  buttons=new ButtonsImpl();
  ball=new BallImpl();
switch (subtype) {
case DIDEVTYPEMOUSE_FINGERSTICK:
    type=Type.FINGERSTICK;
  break;
case DIDEVTYPEMOUSE_TOUCHPAD:
type=Type.TRACKPAD;
break;
case DIDEVTYPEMOUSE_TRACKBALL:
type=Type.TRACKBALL;
break;
case DIDEVTYPEMOUSE_TRADITIONAL:
case DIDEVTYPEMOUSE_UNKNOWN:
default :
type=Type.MOUSE;
break;
}
renameAxes(lpDevice);
}
Program: 169339
Project: 169339
Buggy source:
@Override public void populateSolrInputDocument(SolrInputDocument solrInputDocument){
  if (timestamp != null)   solrInputDocument.addField(DATE,timestamp);
  if (params != null)   solrInputDocument.addField(PARAMS,params);
  if (qtime != -1)   solrInputDocument.addField(QTIME,qtime);
  solrInputDocument.addField(STATUS,"String_Node_Str");
  if (hits != -1)   solrInputDocument.addField(HITS,hits);
  String bitmask=new Classifier(this.getParams()).createBitMask();
  if (bitmask != "String_Node_Str")   solrInputDocument.addField(BITMASK,bitmask);
  solrInputDocument.addField(SLOWQUERY_TAG,slowQueryTagPresent);
  solrInputDocument.addField(SLOWQUERY_VALIDITY_PREDICTION,slowQueryTagPresent == QueryUtil.isSlowQuery((int)qtime));
}

Fixed version (ground truth):
@Override public void populateSolrInputDocument(SolrInputDocument solrInputDocument){
  if (timestamp != null)   solrInputDocument.addField(DATE,timestamp.toDate());
  if (params != null)   solrInputDocument.addField(PARAMS,params);
  if (qtime != -1)   solrInputDocument.addField(QTIME,qtime);
  solrInputDocument.addField(STATUS,"String_Node_Str");
  if (hits != -1)   solrInputDocument.addField(HITS,hits);
  String bitmask=new Classifier(this.getParams()).createBitMask();
  if (bitmask != "String_Node_Str")   solrInputDocument.addField(BITMASK,bitmask);
  solrInputDocument.addField(SLOWQUERY_TAG,slowQueryTagPresent);
  solrInputDocument.addField(SLOWQUERY_VALIDITY_PREDICTION,slowQueryTagPresent == QueryUtil.isSlowQuery((int)qtime));
}
Program: 169341
Project: 169341
Buggy source:
@Override public DateModel<Calendar> createModel(Calendar value){
  return (DateModel<Calendar>)new UtilCalendarModel(value);
}

Fixed version (ground truth):
@Override public DateModel<Calendar> createModel(Calendar value){
  return new UtilCalendarModel(value);
}
Program: 169342
Project: 169342
Buggy source:
/** 
 * Create by specifying the initial value of the widget.
 * @param value value
 * @return A new Datepanel
 */
public JDatePanel createJDatePanel(T value){
  if (value == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  DateModel<T> model=createModel(value);
  return new JDatePanelImpl(model);
}

Fixed version (ground truth):
/** 
 * Create by specifying the initial value of the widget.
 * @param value value
 * @return A new Datepanel
 */
public DatePanel createJDatePanel(T value){
  if (value == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  DateModel<T> model=createModel(value);
  return new JDatePanel(model);
}
Program: 169343
Project: 169343
Buggy source:
/** 
 * Create by specifying the initial value of the widget.
 * @param value value
 * @return A new Datepicker
 */
public JDatePicker createJDatePicker(T value){
  if (value == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  DateModel<T> model=createModel(value);
  return new JDatePickerImpl(new JDatePanelImpl(model));
}

Fixed version (ground truth):
/** 
 * Create by specifying the initial value of the widget.
 * @param value value
 * @return A new Datepicker
 */
public DatePicker createJDatePicker(T value){
  if (value == null) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  DateModel<T> model=createModel(value);
  return new JDatePicker(model);
}