nus-yam/ex-repair huggingface dataset:
Program: 19984
Project: 19984
Buggy source:
/** 
 * Returns the unigram probability of the given unigram.
 * @param wordSequence the unigram word sequence
 * @return the unigram probability
 */
private float getUnigramProbability(WordSequence wordSequence){
  String unigram=wordSequence.getWord(0);
  UnigramProbability unigramProb=(UnigramProbability)unigramIDMap.get(unigram);
  if (unigramProb == null) {
    unigram="String_Node_Str";
    unigramProb=(UnigramProbability)unigramIDMap.get(unigram);
    if (unigramProb == null) {
      throw new Error("String_Node_Str" + unigram);
    }
  }
  return unigramProb.getLogProbability();
}

Fixed version (ground truth):
/** 
 * Returns the unigram probability of the given unigram.
 * @param wordSequence the unigram word sequence
 * @return the unigram probability
 */
private float getUnigramProbability(WordSequence wordSequence){
  String unigram=wordSequence.getWord(0);
  UnigramProbability unigramProb=getUnigram(unigram);
  if (unigramProb == null) {
    throw new Error("String_Node_Str" + unigram);
  }
  return unigramProb.getLogProbability();
}
Program: 19987
Project: 19987
Buggy source:
/** 
 * Returns the unigram probability of the given unigram.
 * @param wordSequence the unigram word sequence
 * @return the unigram probability
 */
private float getUnigramProbability(WordSequence wordSequence){
  String unigram=wordSequence.getWord(0);
  UnigramProbability probability=(UnigramProbability)unigramIDMap.get(unigram);
  if (probability == null) {
    throw new Error("String_Node_Str" + unigram);
  }
 else {
    return probability.getLogProbability();
  }
}

Fixed version (ground truth):
/** 
 * Returns the unigram probability of the given unigram.
 * @param wordSequence the unigram word sequence
 * @return the unigram probability
 */
private float getUnigramProbability(WordSequence wordSequence){
  String unigram=wordSequence.getWord(0);
  Integer unigramID=(Integer)unigramIDMap.get(unigram);
  if (unigramID == null) {
    throw new Error("String_Node_Str" + unigram);
  }
 else {
    UnigramProbability probability=unigrams[unigramID.intValue()];
    return probability.getLogProbability();
  }
}
Program: 19988
Project: 19988
Buggy source:
/** 
 * Apply the unigram weight to the set of unigrams
 */
private void applyUnigramWeight(){
  float unigramWeight=props.getFloat(LanguageModel.PROP_UNIGRAM_WEIGHT,LanguageModel.PROP_UNIGRAM_WEIGHT_DEFAULT);
  float logUnigramWeight=logMath.linearToLog(unigramWeight);
  float logNotUnigramWeight=logMath.linearToLog(1.0f - unigrams.length);
  float logUniform=logMath.linearToLog(1.0f / (unigrams.length - 1));
  float p2=logUniform + logNotUnigramWeight;
  for (int i=0; i < unigrams.length; i++) {
    if (!words[i].equals(Dictionary.SENTENCE_START_SPELLING)) {
      float p1=unigrams[i].getLogProbability() + logUnigramWeight;
      unigrams[i].setLogProbability(logMath.addAsLinear(p1,p2));
    }
  }
}

Fixed version (ground truth):
/** 
 * Apply the unigram weight to the set of unigrams
 */
private void applyUnigramWeight(){
  float unigramWeight=props.getFloat(LanguageModel.PROP_UNIGRAM_WEIGHT,LanguageModel.PROP_UNIGRAM_WEIGHT_DEFAULT);
  float logUnigramWeight=logMath.linearToLog(unigramWeight);
  float logNotUnigramWeight=logMath.linearToLog(1.0f - unigramWeight);
  float logUniform=logMath.linearToLog(1.0f / (numberUnigrams));
  float p2=logUniform + logNotUnigramWeight;
  for (int i=0; i < numberUnigrams; i++) {
    if (!words[i].equals(Dictionary.SENTENCE_START_SPELLING)) {
      float p1=unigrams[i].getLogProbability() + logUnigramWeight;
      unigrams[i].setLogProbability(logMath.addAsLinear(p1,p2));
    }
  }
}
Program: 19989
Project: 19989
Buggy source:
/** 
 * Reads a float from the given DataInputStream.
 * @param stream the DataInputStream to read from
 * @param bigEndian true if the DataInputStream is in bigEndian,false otherwise
 */
private float readFloat(DataInputStream stream,boolean bigEndian) throws IOException {
  float value=stream.readFloat();
  bytesRead+=4;
  if (!bigEndian) {
    value=Utilities.swapFloat(value);
  }
  return value;
}

Fixed version (ground truth):
/** 
 * Reads a float from the given DataInputStream.
 * @param stream the DataInputStream to read from
 * @param bigEndian true if the DataInputStream is in bigEndian,false otherwise
 */
private float readFloat(DataInputStream stream,boolean bigEndian) throws IOException {
  bytesRead+=4;
  if (bigEndian) {
    return stream.readFloat();
  }
 else {
    return Utilities.readLittleEndianFloat(stream);
  }
}
Program: 19990
Project: 19990
Buggy source:
/** 
 * Reads an integer from the given DataInputStream.
 * @param stream the DataInputStream to read from
 * @param bigEndian true if the DataInputStream is in bigEndian,false otherwise
 */
private int readInt(DataInputStream stream,boolean bigEndian) throws IOException {
  int integer=stream.readInt();
  bytesRead+=4;
  if (!bigEndian) {
    integer=Utilities.swapInteger(integer);
  }
  return integer;
}

Fixed version (ground truth):
/** 
 * Reads an integer from the given DataInputStream.
 * @param stream the DataInputStream to read from
 * @param bigEndian true if the DataInputStream is in bigEndian,false otherwise
 */
private int readInt(DataInputStream stream,boolean bigEndian) throws IOException {
  bytesRead+=4;
  if (bigEndian) {
    return stream.readInt();
  }
 else {
    return Utilities.readLittleEndianInt(stream);
  }
}
Program: 19991
Project: 19991
Buggy source:
/** 
 * Read in the unigrams in the given DataInputStream.
 * @param stream the DataInputStream to read from
 * @param numberUnigrams the number of unigrams to read
 * @param bigEndian true if the DataInputStream is big-endian,false otherwise
 * @return an array of UnigramProbability index by the unigram ID
 */
private UnigramProbability[] readUnigrams(DataInputStream stream,int numberUnigrams,boolean bigEndian) throws IOException {
  UnigramProbability[] unigrams=new UnigramProbability[numberUnigrams];
  for (int i=0; i < numberUnigrams; i++) {
    int unigramID=readInt(stream,bigEndian);
    assert(unigramID == i);
    float unigramProbability=readFloat(stream,bigEndian);
    float unigramBackoff=readFloat(stream,bigEndian);
    int firstBigramEntry=readInt(stream,bigEndian);
    float logProbability=logMath.log10ToLog(unigramProbability);
    float logBackoff=logMath.log10ToLog(unigramBackoff);
    unigrams[i]=new UnigramProbability(logProbability,logBackoff,firstBigramEntry);
    if (false) {
      System.out.println("String_Node_Str" + unigramID + "String_Node_Str"+ unigramProbability+ "String_Node_Str"+ unigramBackoff+ "String_Node_Str"+ firstBigramEntry);
    }
  }
  return unigrams;
}

Fixed version (ground truth):
/** 
 * Read in the unigrams in the given DataInputStream.
 * @param stream the DataInputStream to read from
 * @param numberUnigrams the number of unigrams to read
 * @param bigEndian true if the DataInputStream is big-endian,false otherwise
 * @return an array of UnigramProbability index by the unigram ID
 */
private UnigramProbability[] readUnigrams(DataInputStream stream,int numberUnigrams,boolean bigEndian) throws IOException {
  UnigramProbability[] unigrams=new UnigramProbability[numberUnigrams];
  for (int i=0; i < numberUnigrams; i++) {
    int unigramID=readInt(stream,bigEndian);
    if (i != (numberUnigrams - 1)) {
      assert(unigramID == i);
    }
    float unigramProbability=readFloat(stream,bigEndian);
    float unigramBackoff=readFloat(stream,bigEndian);
    int firstBigramEntry=readInt(stream,bigEndian);
    float logProbability=logMath.log10ToLog(unigramProbability);
    float logBackoff=logMath.log10ToLog(unigramBackoff);
    unigrams[i]=new UnigramProbability(logProbability,logBackoff,firstBigramEntry);
    if (false) {
      System.out.println("String_Node_Str" + unigramID + "String_Node_Str"+ unigramProbability+ "String_Node_Str"+ unigramBackoff+ "String_Node_Str"+ firstBigramEntry);
    }
  }
  return unigrams;
}
Program: 19994
Project: 19994
Buggy source:
/** 
 * Loads the bigram followers of the given first word in a bigram from disk to memory.
 * @param firstWordID ID of the first word
 * @return the bigram followers of the given word
 */
private BigramFollowers loadBigramFollowers(int firstWordID){
  BigramFollowers followers=null;
  if ((followers=isBigramLoaded(firstWordID)) == null) {
    long position=(long)(bigramOffset + unigrams[firstWordID].getFirstBigramEntry());
    int numberFollowers=unigrams[firstWordID + 1].getFirstBigramEntry() - unigrams[firstWordID].getFirstBigramEntry();
    long size=(long)(numberFollowers + 1) * 8;
    try {
      MappedByteBuffer buffer=fileChannel.map(FileChannel.MapMode.READ_ONLY,position,size);
      followers=new BigramFollowers(buffer,numberFollowers);
      followers.load();
    }
 catch (    IOException ioe) {
      ioe.printStackTrace();
      throw new Error("String_Node_Str");
    }
    loadedBigramFollowers.put(new Integer(firstWordID),followers);
  }
  return followers;
}

Fixed version (ground truth):
/** 
 * Loads the bigram followers of the given first word in a bigram from disk to memory.
 * @param firstWordID ID of the first word
 * @return the bigram followers of the given word
 */
private BigramFollowers loadBigramFollowers(int firstWordID){
  BigramFollowers followers=null;
  if ((followers=isBigramLoaded(firstWordID)) == null) {
    System.out.println("String_Node_Str");
    int firstBigramEntry=unigrams[firstWordID].getFirstBigramEntry();
    int numberFollowers=unigrams[firstWordID + 1].getFirstBigramEntry() - firstBigramEntry;
    if (numberFollowers > 0) {
      long position=(long)(bigramOffset + (firstBigramEntry * BYTES_PER_BIGRAM));
      long size=(long)(numberFollowers + 1) * BYTES_PER_BIGRAM;
      System.out.println("String_Node_Str" + position + "String_Node_Str"+ size);
      try {
        assert((position + size) <= fileChannel.size());
        MappedByteBuffer buffer=fileChannel.map(FileChannel.MapMode.READ_ONLY,position,size);
        if (!bigEndian) {
          buffer.order(ByteOrder.LITTLE_ENDIAN);
        }
        followers=new BigramFollowers(buffer,numberFollowers);
        followers.load();
      }
 catch (      IOException ioe) {
        ioe.printStackTrace();
        throw new Error("String_Node_Str");
      }
      loadedBigramFollowers.put(new Integer(firstWordID),followers);
    }
  }
  return followers;
}
Program: 19995
Project: 19995
Buggy source:
/** 
 * Reads the probability table from the given DataInputStream.
 * @param stream the DataInputStream from which to read the table
 * @param bigEndian true if the given stream is bigEndian, false otherwise
 */
private float[] readProbabilitiesTable(DataInputStream stream,boolean bigEndian) throws IOException {
  int numProbs=readInt(stream,bigEndian);
  if (numProbs <= 0 || numProbs > 65536) {
    throw new Error("String_Node_Str" + numProbs);
  }
  float[] probTable=new float[numProbs];
  for (int i=0; i < numProbs; i++) {
    probTable[i]=readFloat(stream,bigEndian);
  }
  return probTable;
}

Fixed version (ground truth):
/** 
 * Reads the probability table from the given DataInputStream.
 * @param stream the DataInputStream from which to read the table
 * @param bigEndian true if the given stream is bigEndian, false otherwise
 */
private float[] readProbabilitiesTable(DataInputStream stream,boolean bigEndian) throws IOException {
  int numProbs=readInt(stream,bigEndian);
  if (numProbs <= 0 || numProbs > 65536) {
    throw new Error("String_Node_Str" + numProbs);
  }
  float[] probTable=new float[numProbs];
  for (int i=0; i < numProbs; i++) {
    probTable[i]=logMath.log10ToLog(readFloat(stream,bigEndian));
  }
  return probTable;
}
Program: 19996
Project: 19996
Buggy source:
/** 
 * Reads a float from the given DataInputStream.
 * @param stream the DataInputStream to read from
 * @param bigEndian true if the DataInputStream is in bigEndian,false otherwise
 */
private float readFloat(DataInputStream stream,boolean bigEndian) throws IOException {
  bytesRead+=4;
  if (bigEndian) {
    return stream.readFloat();
  }
 else {
    return Utilities.readLittleEndianFloat(stream);
  }
}

Fixed version (ground truth):
/** 
 * Reads a float from the given DataInputStream.
 * @param stream the DataInputStream to read from
 * @param bigEndian true if the DataInputStream is in bigEndian,false otherwise
 */
private final float readFloat(DataInputStream stream,boolean bigEndian) throws IOException {
  bytesRead+=4;
  if (bigEndian) {
    return stream.readFloat();
  }
 else {
    return Utilities.readLittleEndianFloat(stream);
  }
}
Program: 19997
Project: 19997
Buggy source:
/** 
 * Reads an integer from the given DataInputStream.
 * @param stream the DataInputStream to read from
 * @param bigEndian true if the DataInputStream is in bigEndian,false otherwise
 */
private int readInt(DataInputStream stream,boolean bigEndian) throws IOException {
  bytesRead+=4;
  if (bigEndian) {
    return stream.readInt();
  }
 else {
    return Utilities.readLittleEndianInt(stream);
  }
}

Fixed version (ground truth):
/** 
 * Reads an integer from the given DataInputStream.
 * @param stream the DataInputStream to read from
 * @param bigEndian true if the DataInputStream is in bigEndian,false otherwise
 */
private final int readInt(DataInputStream stream,boolean bigEndian) throws IOException {
  bytesRead+=4;
  if (bigEndian) {
    return stream.readInt();
  }
 else {
    return Utilities.readLittleEndianInt(stream);
  }
}
Program: 19998
Project: 19998
Buggy source:
/** 
 * Returns the unigram probability of the given unigram.
 * @param wordSequence the unigram word sequence
 * @return the unigram probability
 */
private float getBigramProbability(WordSequence wordSequence){
  String firstWord=wordSequence.getWord(0);
  if (numberBigrams == 0 || firstWord == null) {
    return getUnigramProbability(wordSequence.getNewest());
  }
  if (!hasUnigram(wordSequence.getWord(1))) {
    throw new Error("String_Node_Str" + wordSequence.getWord(1));
  }
  int firstWordID=getWordID(firstWord);
  int numberBigramFollowers=unigrams[firstWordID + 1].getFirstBigramEntry() - unigrams[firstWordID].getFirstBigramEntry();
  int secondWordID=getWordID(wordSequence.getWord(1));
  BigramProbability bigram=null;
  if (numberBigramFollowers > 0) {
    BigramFollowers bigramFollowers=loadBigramFollowers(firstWordID);
    bigram=bigramFollowers.findBigram(secondWordID);
  }
  if (bigram != null) {
    return bigramProbTable[bigram.getProbabilityID()];
  }
 else {
    return (unigrams[firstWordID].getLogBackoff() + unigrams[secondWordID].getLogProbability());
  }
}

Fixed version (ground truth):
/** 
 * Returns the unigram probability of the given unigram.
 * @param wordSequence the unigram word sequence
 * @return the unigram probability
 */
private float getBigramProbability(WordSequence wordSequence){
  String firstWord=wordSequence.getWord(0).toLowerCase();
  String secondWord=wordSequence.getWord(1).toLowerCase();
  System.out.println("String_Node_Str" + firstWord + "String_Node_Str"+ secondWord);
  if (numberBigrams == 0 || firstWord == null) {
    return getUnigramProbability(wordSequence.getNewest());
  }
  if (!hasUnigram(secondWord)) {
    throw new Error("String_Node_Str" + secondWord);
  }
  int firstWordID=getWordID(firstWord);
  int numberBigramFollowers=unigrams[firstWordID + 1].getFirstBigramEntry() - unigrams[firstWordID].getFirstBigramEntry();
  System.out.println(unigrams[firstWordID].getFirstBigramEntry() + "String_Node_Str" + unigrams[firstWordID + 1].getFirstBigramEntry());
  int secondWordID=getWordID(secondWord);
  BigramProbability bigram=null;
  if (numberBigramFollowers > 0) {
    BigramFollowers bigramFollowers=loadBigramFollowers(firstWordID);
    bigram=bigramFollowers.findBigram(secondWordID);
  }
  if (bigram != null) {
    assert(words[bigram.getWordID()].equals(secondWord));
    return bigramProbTable[bigram.getProbabilityID()];
  }
 else {
    return (unigrams[firstWordID].getLogBackoff() + unigrams[secondWordID].getLogProbability());
  }
}
Program: 19999
Project: 19999
Buggy source:
/** 
 * Returns the ID of the given word.
 * @param word the word to find the ID
 * @return the ID of the word
 */
private int getWordID(String word){
  Integer integer=(Integer)unigramIDMap.get(word);
  if (integer == null) {
    throw new IllegalArgumentException("String_Node_Str" + word);
  }
 else {
    return integer.intValue();
  }
}

Fixed version (ground truth):
/** 
 * Returns the ID of the given word.
 * @param word the word to find the ID
 * @return the ID of the word
 */
private final int getWordID(String word){
  Integer integer=(Integer)unigramIDMap.get(word);
  if (integer == null) {
    throw new IllegalArgumentException("String_Node_Str" + word);
  }
 else {
    return integer.intValue();
  }
}
Program: 20000
Project: 20000
Buggy source:
/** 
 * Read in the unigrams in the given DataInputStream.
 * @param stream the DataInputStream to read from
 * @param numberUnigrams the number of unigrams to read
 * @param bigEndian true if the DataInputStream is big-endian,false otherwise
 * @return an array of UnigramProbability index by the unigram ID
 */
private UnigramProbability[] readUnigrams(DataInputStream stream,int numberUnigrams,boolean bigEndian) throws IOException {
  UnigramProbability[] unigrams=new UnigramProbability[numberUnigrams];
  for (int i=0; i < numberUnigrams; i++) {
    int unigramID=readInt(stream,bigEndian);
    if (i != (numberUnigrams - 1)) {
      assert(unigramID == i);
    }
    float unigramProbability=readFloat(stream,bigEndian);
    float unigramBackoff=readFloat(stream,bigEndian);
    int firstBigramEntry=readInt(stream,bigEndian);
    float logProbability=logMath.log10ToLog(unigramProbability);
    float logBackoff=logMath.log10ToLog(unigramBackoff);
    unigrams[i]=new UnigramProbability(logProbability,logBackoff,firstBigramEntry);
    if (false) {
      System.out.println("String_Node_Str" + unigramID + "String_Node_Str"+ unigramProbability+ "String_Node_Str"+ unigramBackoff+ "String_Node_Str"+ firstBigramEntry);
    }
  }
  return unigrams;
}

Fixed version (ground truth):
/** 
 * Read in the unigrams in the given DataInputStream.
 * @param stream the DataInputStream to read from
 * @param numberUnigrams the number of unigrams to read
 * @param bigEndian true if the DataInputStream is big-endian,false otherwise
 * @return an array of UnigramProbability index by the unigram ID
 */
private UnigramProbability[] readUnigrams(DataInputStream stream,int numberUnigrams,boolean bigEndian) throws IOException {
  UnigramProbability[] unigrams=new UnigramProbability[numberUnigrams];
  for (int i=0; i < numberUnigrams; i++) {
    int unigramID=readInt(stream,bigEndian);
    if (i != (numberUnigrams - 1)) {
      assert(unigramID == i);
    }
    float unigramProbability=readFloat(stream,bigEndian);
    float unigramBackoff=readFloat(stream,bigEndian);
    int firstBigramEntry=readInt(stream,bigEndian);
    float logProbability=logMath.log10ToLog(unigramProbability);
    float logBackoff=logMath.log10ToLog(unigramBackoff);
    unigrams[i]=new UnigramProbability(logProbability,logBackoff,firstBigramEntry);
  }
  return unigrams;
}
Program: 20001
Project: 20001
Buggy source:
/** 
 * Reads a string of the given length from the given DataInputStream. It is assumed that the DataInputStream contains 8-bit chars.
 * @param stream the DataInputStream to read from
 * @param length the number of characters in the returned string
 * @return a string of the given length from the given DataInputStream
 */
private String readString(DataInputStream stream,int length) throws IOException {
  StringBuffer buffer=new StringBuffer();
  for (int i=0; i < length; i++) {
    buffer.append((char)stream.readByte());
    bytesRead++;
  }
  return buffer.toString();
}

Fixed version (ground truth):
/** 
 * Reads a string of the given length from the given DataInputStream. It is assumed that the DataInputStream contains 8-bit chars.
 * @param stream the DataInputStream to read from
 * @param length the number of characters in the returned string
 * @return a string of the given length from the given DataInputStream
 */
private final String readString(DataInputStream stream,int length) throws IOException {
  StringBuffer buffer=new StringBuffer();
  for (int i=0; i < length; i++) {
    buffer.append((char)readByte(stream));
  }
  return buffer.toString();
}
Program: 20002
Project: 20002
Buggy source:
/** 
 * Loads the bigram followers of the given first word in a bigram from disk to memory.
 * @param firstWordID ID of the first word
 * @return the bigram followers of the given word
 */
private BigramFollowers loadBigramFollowers(int firstWordID){
  BigramFollowers followers=null;
  if ((followers=isBigramLoaded(firstWordID)) == null) {
    long position=(long)(bigramOffset + unigrams[firstWordID].firstBigramEntry);
    int numberFollowers=unigrams[firstWordID + 1].firstBigramEntry - unigrams[firstWordID].firstBigramEntry;
    long size=(long)(numberFollowers + 1) * 8;
    try {
      MappedByteBuffer buffer=fileChannel.map(FileChannel.MapMode.READ_ONLY,position,size);
      followers=new BigramFollowers(buffer,numberFollowers);
      followers.load();
    }
 catch (    IOException ioe) {
      ioe.printStackTrace();
      throw new Error("String_Node_Str");
    }
    loadedBigramFollowers.put(new Integer(firstWordID),followers);
  }
  return followers;
}

Fixed version (ground truth):
/** 
 * Loads the bigram followers of the given first word in a bigram from disk to memory.
 * @param firstWordID ID of the first word
 * @return the bigram followers of the given word
 */
private BigramFollowers loadBigramFollowers(int firstWordID){
  BigramFollowers followers=null;
  if ((followers=isBigramLoaded(firstWordID)) == null) {
    long position=(long)(bigramOffset + unigrams[firstWordID].getFirstBigramEntry());
    int numberFollowers=unigrams[firstWordID + 1].getFirstBigramEntry() - unigrams[firstWordID].getFirstBigramEntry();
    long size=(long)(numberFollowers + 1) * 8;
    try {
      MappedByteBuffer buffer=fileChannel.map(FileChannel.MapMode.READ_ONLY,position,size);
      followers=new BigramFollowers(buffer,numberFollowers);
      followers.load();
    }
 catch (    IOException ioe) {
      ioe.printStackTrace();
      throw new Error("String_Node_Str");
    }
    loadedBigramFollowers.put(new Integer(firstWordID),followers);
  }
  return followers;
}
Program: 20003
Project: 20003
Buggy source:
/** 
 * Returns the unigram probability of the given unigram.
 * @param wordSequence the unigram word sequence
 * @return the unigram probability
 */
private float getUnigramProbability(WordSequence wordSequence){
  String unigram=wordSequence.getWord(0);
  UnigramProbability probability=(UnigramProbability)unigramIDMap.get(unigram);
  if (probability == null) {
    throw new Error("String_Node_Str" + unigram);
  }
 else {
    return probability.logProbability;
  }
}

Fixed version (ground truth):
/** 
 * Returns the unigram probability of the given unigram.
 * @param wordSequence the unigram word sequence
 * @return the unigram probability
 */
private float getUnigramProbability(WordSequence wordSequence){
  String unigram=wordSequence.getWord(0);
  UnigramProbability probability=(UnigramProbability)unigramIDMap.get(unigram);
  if (probability == null) {
    throw new Error("String_Node_Str" + unigram);
  }
 else {
    return probability.getLogProbability();
  }
}
Program: 20004
Project: 20004
Buggy source:
/** 
 * Apply the unigram weight to the set of unigrams
 */
private void applyUnigramWeight(){
  float unigramWeight=props.getFloat(LanguageModel.PROP_UNIGRAM_WEIGHT,LanguageModel.PROP_UNIGRAM_WEIGHT_DEFAULT);
  float logUnigramWeight=logMath.linearToLog(unigramWeight);
  float logNotUnigramWeight=logMath.linearToLog(1.0f - unigrams.length);
  float logUniform=logMath.linearToLog(1.0f / (unigrams.length - 1));
  float p2=logUniform + logNotUnigramWeight;
  for (int i=0; i < unigrams.length; i++) {
    if (!words[i].equals(Dictionary.SENTENCE_START_SPELLING)) {
      float p1=unigrams[i].logProbability + logUnigramWeight;
      unigrams[i].logProbability=logMath.addAsLinear(p1,p2);
    }
  }
}

Fixed version (ground truth):
/** 
 * Apply the unigram weight to the set of unigrams
 */
private void applyUnigramWeight(){
  float unigramWeight=props.getFloat(LanguageModel.PROP_UNIGRAM_WEIGHT,LanguageModel.PROP_UNIGRAM_WEIGHT_DEFAULT);
  float logUnigramWeight=logMath.linearToLog(unigramWeight);
  float logNotUnigramWeight=logMath.linearToLog(1.0f - unigrams.length);
  float logUniform=logMath.linearToLog(1.0f / (unigrams.length - 1));
  float p2=logUniform + logNotUnigramWeight;
  for (int i=0; i < unigrams.length; i++) {
    if (!words[i].equals(Dictionary.SENTENCE_START_SPELLING)) {
      float p1=unigrams[i].getLogProbability() + logUnigramWeight;
      unigrams[i].setLogProbability(logMath.addAsLinear(p1,p2));
    }
  }
}
Program: 20005
Project: 20005
Buggy source:
/** 
 * Returns the unigram probability of the given unigram.
 * @param wordSequence the unigram word sequence
 * @return the unigram probability
 */
private float getBigramProbability(WordSequence wordSequence){
  String firstWord=wordSequence.getWord(0);
  if (numberBigrams == 0 || firstWord == null) {
    return getUnigramProbability(wordSequence.getNewest());
  }
  if (!hasUnigram(wordSequence.getWord(1))) {
    throw new Error("String_Node_Str" + wordSequence.getWord(1));
  }
  int firstWordID=getWordID(firstWord);
  int numberBigramFollowers=unigrams[firstWordID + 1].firstBigramEntry - unigrams[firstWordID].firstBigramEntry;
  int secondWordID=getWordID(wordSequence.getWord(1));
  BigramProbability bigram=null;
  if (numberBigramFollowers > 0) {
    BigramFollowers bigramFollowers=loadBigramFollowers(firstWordID);
    bigram=bigramFollowers.findBigram(secondWordID);
  }
  if (bigram != null) {
    return bigramProbTable[bigram.getProbabilityID()];
  }
 else {
    return (unigrams[firstWordID].logBackoff + unigrams[secondWordID].logProbability);
  }
}

Fixed version (ground truth):
/** 
 * Returns the unigram probability of the given unigram.
 * @param wordSequence the unigram word sequence
 * @return the unigram probability
 */
private float getBigramProbability(WordSequence wordSequence){
  String firstWord=wordSequence.getWord(0);
  if (numberBigrams == 0 || firstWord == null) {
    return getUnigramProbability(wordSequence.getNewest());
  }
  if (!hasUnigram(wordSequence.getWord(1))) {
    throw new Error("String_Node_Str" + wordSequence.getWord(1));
  }
  int firstWordID=getWordID(firstWord);
  int numberBigramFollowers=unigrams[firstWordID + 1].getFirstBigramEntry() - unigrams[firstWordID].getFirstBigramEntry();
  int secondWordID=getWordID(wordSequence.getWord(1));
  BigramProbability bigram=null;
  if (numberBigramFollowers > 0) {
    BigramFollowers bigramFollowers=loadBigramFollowers(firstWordID);
    bigram=bigramFollowers.findBigram(secondWordID);
  }
  if (bigram != null) {
    return bigramProbTable[bigram.getProbabilityID()];
  }
 else {
    return (unigrams[firstWordID].getLogBackoff() + unigrams[secondWordID].getLogProbability());
  }
}
Program: 20006
Project: 20006
Buggy source:
/** 
 * Returns the backoff probability for the give sequence of words
 * @param the sequence of words
 * @return the backoff probability in LogMath log base
 */
public float getBackoff(WordSequence wordSequence){
  float logBackoff=0.0f;
  UnigramProbability prob=null;
  if (prob != null) {
    logBackoff=prob.logBackoff;
  }
  return logBackoff;
}

Fixed version (ground truth):
/** 
 * Returns the backoff probability for the give sequence of words
 * @param the sequence of words
 * @return the backoff probability in LogMath log base
 */
public float getBackoff(WordSequence wordSequence){
  float logBackoff=0.0f;
  UnigramProbability prob=null;
  if (prob != null) {
    logBackoff=prob.getLogBackoff();
  }
  return logBackoff;
}
Program: 20008
Project: 20008
Buggy source:
/** 
 * Scores the given set of states
 * @param scoreableList a list containing scoreable objects tobe scored
 * @return true if there are more features available
 */
public boolean calculateScores(List scoreableList){
  FeatureFrame ff;
  try {
    ff=frontEnd.getFeatureFrame(1,null);
    Feature feature;
    if (ff == null) {
      System.out.println("String_Node_Str");
      return false;
    }
    if (ff.getFeatures() == null) {
      System.out.println("String_Node_Str");
      return false;
    }
    feature=ff.getFeatures()[0];
    if (feature.getSignal() == Signal.UTTERANCE_START) {
      return true;
    }
    if (feature.getSignal() == Signal.UTTERANCE_END) {
      return false;
    }
    if (!feature.hasContent()) {
      throw new Error("String_Node_Str");
    }
    float logMaxScore=-Float.MAX_VALUE;
    for (Iterator i=scoreableList.iterator(); i.hasNext(); ) {
      Scoreable scoreable=(Scoreable)i.next();
      float logScore=scoreable.calculateScore(feature);
      if (logScore > logMaxScore) {
        logMaxScore=logScore;
      }
    }
    if (normalizeScores) {
      for (Iterator i=scoreableList.iterator(); i.hasNext(); ) {
        Scoreable scoreable=(Scoreable)i.next();
        scoreable.normalizeScore(logMaxScore);
      }
    }
  }
 catch (  IOException ioe) {
    System.out.println("String_Node_Str" + ioe);
    return false;
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Scores the given set of states
 * @param scoreableList a list containing scoreable objects tobe scored
 * @return true if there was a Feature available to scorefalse if there was no more Feature available to score
 */
public boolean calculateScores(List scoreableList){
  FeatureFrame ff;
  try {
    ff=frontEnd.getFeatureFrame(1,null);
    Feature feature;
    if (!hasFeatures(ff)) {
      return false;
    }
    feature=ff.getFeatures()[0];
    if (feature.getSignal() == Signal.UTTERANCE_START) {
      ff=frontEnd.getFeatureFrame(1,null);
      if (!hasFeatures(ff)) {
        return false;
      }
      feature=ff.getFeatures()[0];
    }
    if (feature.getSignal() == Signal.UTTERANCE_END) {
      return false;
    }
    if (!feature.hasContent()) {
      throw new Error("String_Node_Str");
    }
    float logMaxScore=-Float.MAX_VALUE;
    for (Iterator i=scoreableList.iterator(); i.hasNext(); ) {
      Scoreable scoreable=(Scoreable)i.next();
      float logScore=scoreable.calculateScore(feature);
      if (logScore > logMaxScore) {
        logMaxScore=logScore;
      }
    }
    if (normalizeScores) {
      for (Iterator i=scoreableList.iterator(); i.hasNext(); ) {
        Scoreable scoreable=(Scoreable)i.next();
        scoreable.normalizeScore(logMaxScore);
      }
    }
  }
 catch (  IOException ioe) {
    System.out.println("String_Node_Str" + ioe);
    return false;
  }
  return true;
}
Program: 20010
Project: 20010
Buggy source:
/** 
 * Given a linguist and an arc to the next token, determine a language probability for the next state
 * @param linguist  the linguist to use, null if there is nolinguist, in which case, the language probability for the SentenceHMMStateArc will be used.
 * @param arc the arc to the next state
 * @return the language probability for the transition to the nextstate (in LogMath log domain)
 */
private float getLanguageProbability(Token token,SentenceHMMStateArc arc){
  float logProbability=arc.getLanguageProbability();
  if (languageModel != null && arc.getNextState() instanceof WordState) {
    WordState state=(WordState)arc.getNextState();
    int depth=languageModel.getMaxDepth();
    String word=state.getWord().getSpelling();
    if (isWord(word)) {
      List wordList=new ArrayList(depth);
      wordList.add(word);
      while (token != null && wordList.size() < depth) {
        if (token.getSentenceHMMState() instanceof WordState) {
          WordState prevWord=(WordState)token.getSentenceHMMState();
          String prevSpelling=prevWord.getWord().getSpelling();
          if (isWord(prevSpelling)) {
            wordList.add(prevSpelling);
          }
        }
        token=token.getPredecessor();
      }
      if (token == null && wordList.size() < depth) {
        wordList.add(SENTENCE_START);
      }
      Collections.reverse(wordList);
      logProbability=(float)languageModel.getProbability(wordList);
    }
  }
  return logProbability * languageWeight;
}

Fixed version (ground truth):
/** 
 * Given a linguist and an arc to the next token, determine a language probability for the next state
 * @param linguist  the linguist to use, null if there is nolinguist, in which case, the language probability for the SentenceHMMStateArc will be used.
 * @param arc the arc to the next state
 * @return the language probability for the transition to the nextstate (in LogMath log domain)
 */
private float getLanguageProbability(Token token,SentenceHMMStateArc arc){
  float logProbability=arc.getLanguageProbability();
  if (languageModel != null && arc.getNextState() instanceof WordState) {
    WordState state=(WordState)arc.getNextState();
    int depth=languageModel.getMaxDepth();
    String word=state.getWord().getSpelling();
    if (isWord(word)) {
      List wordList=new ArrayList(depth);
      wordList.add(word);
      while (token != null && wordList.size() < depth) {
        if (token.getSentenceHMMState() instanceof WordState) {
          WordState prevWord=(WordState)token.getSentenceHMMState();
          String prevSpelling=prevWord.getWord().getSpelling();
          if (isWord(prevSpelling)) {
            wordList.add(prevSpelling);
          }
        }
        token=token.getPredecessor();
      }
      if (token == null && wordList.size() < depth) {
        wordList.add(SENTENCE_START);
      }
      Collections.reverse(wordList);
      logProbability=(float)languageModel.getProbability(wordList);
    }
  }
  return logProbability * getLanguageWeight();
}
Program: 20011
Project: 20011
Buggy source:
/** 
 * Initializes this BreadthFirstSearchManager with the given context, linguist, scorer and pruner.
 * @param context the context to use
 * @param linguist the Linguist to use
 * @param scorer the AcousticScorer to use
 * @param pruner the Pruner to use
 */
public void initialize(String context,Linguist linguist,AcousticScorer scorer,Pruner pruner){
  super.initialize(context,linguist,scorer,pruner);
  SphinxProperties props=getSphinxProperties();
  bushderbyEta=props.getDouble(PROP_BUSHDERBY_ETA,PROP_BUSHDERBY_ETA_DEFAULT);
  System.out.println("String_Node_Str" + enableBushderby);
  System.out.println("String_Node_Str" + bushderbyEta);
  filterSuccessors=props.getBoolean(PROP_FILTER_SUCCESSORS,PROP_FILTER_SUCCESSORS_DEFAULT);
  if (getLinguist() != null) {
    languageModel=getLinguist().getLanguageModel();
  }
}

Fixed version (ground truth):
/** 
 * Initializes this BreadthFirstSearchManager with the given context, linguist, scorer and pruner.
 * @param context the context to use
 * @param linguist the Linguist to use
 * @param scorer the AcousticScorer to use
 * @param pruner the Pruner to use
 */
public void initialize(String context,Linguist linguist,AcousticScorer scorer,Pruner pruner){
  super.initialize(context,linguist,scorer,pruner);
  SphinxProperties props=getSphinxProperties();
  bushderbyEta=props.getDouble(PROP_BUSHDERBY_ETA,PROP_BUSHDERBY_ETA_DEFAULT);
  System.out.println("String_Node_Str" + bushderbyEta);
  filterSuccessors=props.getBoolean(PROP_FILTER_SUCCESSORS,PROP_FILTER_SUCCESSORS_DEFAULT);
  if (getLinguist() != null) {
    languageModel=getLinguist().getLanguageModel();
  }
}
Program: 20012
Project: 20012
Buggy source:
/** 
 * Reads the cepstra of the entire Utterance into the cepstraList.
 * @return the number cepstra (with Data) read
 * @throws IOException if an error occurred reading the Cepstrum
 */
private int readUtterance() throws IOException {
  int count=0;
  Cepstrum input=null;
  do {
    input=predecessor.getCepstrum();
    if (input != null) {
      if (input.hasContent()) {
        count++;
        float[] cepstrumData=input.getCepstrumData();
        for (int j=0; j < cepstrumData.length; j++) {
          sums[j]+=cepstrumData[j];
        }
        cepstraList.add(input);
      }
 else       if (input.hasSignal(Signal.UTTERANCE_END)) {
        cepstraList.add(input);
        break;
      }
 else {
        cepstraList.add(input);
      }
    }
  }
 while (input != null);
  return count;
}

Fixed version (ground truth):
/** 
 * Reads the cepstra of the entire Utterance into the cepstraList.
 * @return the number cepstra (with Data) read
 * @throws IOException if an error occurred reading the Cepstrum
 */
private int readUtterance() throws IOException {
  Cepstrum input=null;
  do {
    input=predecessor.getCepstrum();
    if (input != null) {
      if (input.hasContent()) {
        numberDataCepstra++;
        float[] cepstrumData=input.getCepstrumData();
        for (int j=0; j < cepstrumData.length; j++) {
          sums[j]+=cepstrumData[j];
        }
        cepstraList.add(input);
      }
 else       if (input.hasSignal(Signal.UTTERANCE_END)) {
        cepstraList.add(input);
        break;
      }
 else {
        cepstraList.add(input);
      }
    }
  }
 while (input != null);
  return numberDataCepstra;
}
Program: 20013
Project: 20013
Buggy source:
/** 
 * Normalizes the list of Cepstrum.
 */
private void normalizeList(){
  int numberCepstrum=cepstraList.size();
  for (int i=0; i < sums.length; i++) {
    sums[i]/=numberCepstrum;
  }
  for (Iterator iterator=cepstraList.iterator(); iterator.hasNext(); ) {
    Cepstrum cepstrumObject=(Cepstrum)iterator.next();
    if (cepstrumObject.hasContent()) {
      float[] cepstrum=cepstrumObject.getCepstrumData();
      for (int j=0; j < cepstrum.length; j++) {
        cepstrum[j]-=sums[j];
      }
    }
    if (getDump()) {
      System.out.println("String_Node_Str" + cepstrumObject.toString());
    }
  }
}

Fixed version (ground truth):
/** 
 * Normalizes the list of Cepstrum.
 */
private void normalizeList(){
  int numberCepstrum=cepstraList.size();
  for (int i=0; i < sums.length; i++) {
    sums[i]/=numberDataCepstra;
  }
  for (Iterator iterator=cepstraList.iterator(); iterator.hasNext(); ) {
    Cepstrum cepstrumObject=(Cepstrum)iterator.next();
    if (cepstrumObject.hasContent()) {
      float[] cepstrum=cepstrumObject.getCepstrumData();
      for (int j=0; j < cepstrum.length; j++) {
        cepstrum[j]-=sums[j];
      }
    }
    if (getDump()) {
      System.out.println("String_Node_Str" + cepstrumObject.toString());
    }
  }
}
Program: 20014
Project: 20014
Buggy source:
/** 
 * Initializes the sums array and clears the cepstra list.
 */
private void reset(){
  Arrays.fill(sums,0.0f);
  cepstraList.clear();
}

Fixed version (ground truth):
/** 
 * Initializes the sums array and clears the cepstra list.
 */
private void reset(){
  Arrays.fill(sums,0.0f);
  cepstraList.clear();
  numberDataCepstra=0;
}
Program: 20015
Project: 20015
Buggy source:
/** 
 * Constructs a BatchDecoder.
 * @param context the context of this BatchDecoder
 * @param batchFile the file that contains a list of files to decode
 */
public BatchDecoder(String context,String batchFile) throws IOException {
  this.context=context;
  SphinxProperties props=SphinxProperties.getSphinxProperties(context);
  inputDataType=props.getString(PROP_INPUT_TYPE,"String_Node_Str");
  int skip=props.getInt(PROP_SKIP,0);
  whichBatch=props.getInt(PROP_WHICH_BATCH,1);
  totalBatches=props.getInt(PROP_TOTAL_BATCHES,1);
  if (inputDataType.equals("String_Node_Str")) {
    dataSource=new StreamAudioSource("String_Node_Str",context,null,null);
  }
 else   if (inputDataType.equals("String_Node_Str")) {
    dataSource=new StreamCepstrumSource("String_Node_Str",context);
  }
 else {
    throw new Error("String_Node_Str" + inputDataType + "String_Node_Str"+ "String_Node_Str");
  }
  decoder=new Decoder(context,dataSource);
  this.batchFile=batchFile;
}

Fixed version (ground truth):
/** 
 * Constructs a BatchDecoder.
 * @param context the context of this BatchDecoder
 * @param batchFile the file that contains a list of files to decode
 */
public BatchDecoder(String context,String batchFile) throws IOException {
  this.context=context;
  SphinxProperties props=SphinxProperties.getSphinxProperties(context);
  inputDataType=props.getString(PROP_INPUT_TYPE,"String_Node_Str");
  skip=props.getInt(PROP_SKIP,0);
  whichBatch=props.getInt(PROP_WHICH_BATCH,0);
  totalBatches=props.getInt(PROP_TOTAL_BATCHES,1);
  if (inputDataType.equals("String_Node_Str")) {
    dataSource=new StreamAudioSource("String_Node_Str",context,null,null);
  }
 else   if (inputDataType.equals("String_Node_Str")) {
    dataSource=new StreamCepstrumSource("String_Node_Str",context);
  }
 else {
    throw new Error("String_Node_Str" + inputDataType + "String_Node_Str"+ "String_Node_Str");
  }
  decoder=new Decoder(context,dataSource);
  this.batchFile=batchFile;
}
Program: 20016
Project: 20016
Buggy source:
/** 
 * Sets the current Decoder to the one with the given name.
 * @param decoderName name of the Decoder to use 
 */
public void setDecoder(String decoderName) throws IOException {
  String changeMessage="String_Node_Str" + decoderName + "String_Node_Str";
  info(changeMessage);
  liveFrame.setMessage(changeMessage);
  try {
    decoder=getDecoder(decoderName);
    if (!decoder.isInitialized()) {
      decoder.initialize(new Microphone("String_Node_Str",decoderName));
    }
  }
 catch (  LineUnavailableException lue) {
    String errorMessage="String_Node_Str" + decoderName;
    liveFrame.setMessage(errorMessage);
    lue.printStackTrace();
    return;
  }
catch (  Exception e) {
    e.printStackTrace();
    return;
  }
  liveFrame.setTestFile(getDecoder().getTestFile());
  liveFrame.setReferenceLabel(getDecoder().getNextReference());
  liveFrame.setMessage("String_Node_Str" + decoderName + "String_Node_Str");
  info("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Sets the current Decoder to the one with the given name.
 * @param decoderName name of the Decoder to use 
 */
public void setDecoder(String decoderName) throws IOException {
  String changeMessage="String_Node_Str" + decoderName + "String_Node_Str";
  info(changeMessage);
  liveFrame.setMessage(changeMessage);
  try {
    decoder=getDecoder(decoderName);
    if (!decoder.isInitialized()) {
      decoder.initialize(new Microphone("String_Node_Str",decoderName,decoder.getSphinxProperties()));
    }
  }
 catch (  LineUnavailableException lue) {
    String errorMessage="String_Node_Str" + decoderName;
    liveFrame.setMessage(errorMessage);
    lue.printStackTrace();
    return;
  }
catch (  Exception e) {
    e.printStackTrace();
    return;
  }
  liveFrame.setTestFile(getDecoder().getTestFile());
  liveFrame.setReferenceLabel(getDecoder().getNextReference());
  liveFrame.setMessage("String_Node_Str" + decoderName + "String_Node_Str");
  info("String_Node_Str");
}
Program: 20017
Project: 20017
Buggy source:
/** 
 * Returns the next Feature object produced by this DeltasFeatureExtractor.
 * @return the next available Feature object, returns null if noFeature object is available
 * @throws java.io.IOException if there is an error readingthe Feature objects
 * @see Feature
 * @see FeatureFrame
 */
public Feature getFeature() throws IOException {
  if (outputQueue.size() == 0) {
    if (segmentEnd) {
      segmentEnd=false;
      outputQueue.add(new Feature(Signal.UTTERANCE_END,IDGenerator.NON_ID));
    }
 else {
      Cepstrum input=predecessor.getCepstrum();
      if (input == null) {
        return null;
      }
 else {
        if (input.hasContent()) {
          int numberFeatures=readCepstra(featureBlockSize - 1,input);
          if (numberFeatures > 0) {
            computeFeatures(numberFeatures);
          }
        }
 else         if (input.getSignal().equals(Signal.UTTERANCE_START)) {
          segmentStart=true;
          outputQueue.add(new Feature(Signal.UTTERANCE_START,IDGenerator.NON_ID));
        }
      }
    }
  }
  if (outputQueue.size() > 0) {
    return (Feature)outputQueue.remove(0);
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Returns the next Feature object produced by this DeltasFeatureExtractor.
 * @return the next available Feature object, returns null if noFeature object is available
 * @throws java.io.IOException if there is an error readingthe Feature objects
 * @see Feature
 * @see FeatureFrame
 */
public Feature getFeature() throws IOException {
  if (outputQueue.size() == 0) {
    if (segmentEnd) {
      segmentEnd=false;
      outputQueue.add(new Feature(Signal.UTTERANCE_END,IDGenerator.NON_ID));
    }
 else {
      Cepstrum input=predecessor.getCepstrum();
      if (input == null) {
        return null;
      }
 else {
        if (input.hasContent()) {
          int numberFeatures=readCepstra(featureBlockSize - 1,input);
          if (numberFeatures > 0) {
            computeFeatures(numberFeatures);
          }
        }
 else         if (input.hasSignal(Signal.UTTERANCE_START)) {
          segmentStart=true;
          outputQueue.add(new Feature(Signal.UTTERANCE_START,IDGenerator.NON_ID));
        }
 else         if (input.hasSignal(Signal.UTTERANCE_END)) {
          segmentEnd=false;
          outputQueue.add(new Feature(Signal.UTTERANCE_END,IDGenerator.NON_ID));
        }
      }
    }
  }
  if (outputQueue.size() > 0) {
    Feature feature=(Feature)outputQueue.remove(0);
    return feature;
  }
 else {
    return null;
  }
}
Program: 20018
Project: 20018
Buggy source:
/** 
 * Dumps the Cepstra to the given binary output.
 * @param outputFile the binary output file
 */
public void dumpBinary(String outputFile) throws IOException {
  DataOutputStream outStream=new DataOutputStream(new FileOutputStream(outputFile));
  outStream.writeFloat((float)getNumberDataPoints());
  for (Iterator i=allFeatures.iterator(); i.hasNext(); ) {
    Feature feature=(Feature)i.next();
    float[] data=feature.getFeatureData();
    for (int d=0; d < data.length; d++) {
      outStream.writeFloat(data[d]);
    }
  }
  outStream.close();
}

Fixed version (ground truth):
/** 
 * Dumps the Cepstra to the given binary output.
 * @param outputFile the binary output file
 */
public void dumpBinary(String outputFile) throws IOException {
  DataOutputStream outStream=new DataOutputStream(new FileOutputStream(outputFile));
  outStream.writeInt(getNumberDataPoints());
  for (Iterator i=allFeatures.iterator(); i.hasNext(); ) {
    Feature feature=(Feature)i.next();
    float[] data=feature.getFeatureData();
    for (int d=0; d < data.length; d++) {
      outStream.writeFloat(data[d]);
    }
  }
  outStream.close();
}
Program: 20019
Project: 20019
Buggy source:
/** 
 * Initializes this DataProcessor.
 * @param name the name of this DataProcessor
 * @param context the context of this DataProcessor
 */
public void initialize(String name,String context){
  if (sphinxProperties == null) {
    this.name=name;
    this.context=context;
    this.timer=Timer.getTimer(context,name);
    this.sphinxProperties=SphinxProperties.getSphinxProperties(context);
  }
}

Fixed version (ground truth):
/** 
 * Initializes this DataProcessor.
 * @param name the name of this DataProcessor
 * @param context the context of this DataProcessor
 */
public void initialize(String name,String context){
  this.name=name;
  this.context=context;
  this.timer=Timer.getTimer(context,name);
  this.sphinxProperties=SphinxProperties.getSphinxProperties(context);
}
Program: 20020
Project: 20020
Buggy source:
/** 
 * Retrieve all Features from the frontend, and cache all those with actual feature data.
 */
private void getAllFeatures() throws IOException {
  Feature feature=null;
  FeatureFrame frame=frontend.getFeatureFrame(1);
  if (frame != null) {
    feature=frame.getFeatures()[0];
    if (feature.hasContent()) {
      allFeatures.add(feature);
    }
  }
}

Fixed version (ground truth):
/** 
 * Retrieve all Features from the frontend, and cache all those with actual feature data.
 */
private void getAllFeatures() throws IOException {
  Feature feature=null;
  FeatureFrame frame=null;
  while ((frame=frontend.getFeatureFrame(1)) != null) {
    feature=frame.getFeatures()[0];
    if (feature.hasContent()) {
      allFeatures.add(feature);
    }
  }
}