Program: 19964
Project: 19964
Buggy source:
/** 
 * Loads the language model from the given location. 
 * @param location the location of the language model
 */
private void loadBinary(String location) throws IOException {
  FileInputStream fis=new FileInputStream(location);
  DataInputStream stream=new DataInputStream(new BufferedInputStream(fis));
  readHeader(stream);
  unigrams=readUnigrams(stream,numberUnigrams + 1,bigEndian);
  skipBigramsTrigrams(stream);
  if (numberBigrams > 0) {
    this.bigramProbTable=readFloatTable(stream,bigEndian);
  }
  if (numberTrigrams > 0) {
    trigramBackoffTable=readFloatTable(stream,bigEndian);
    trigramProbTable=readFloatTable(stream,bigEndian);
    int bigramSegmentSize=1 << logBigramSegmentSize;
    int trigramSegTableSize=((numberBigrams + 1) / bigramSegmentSize) + 1;
    trigramSegmentTable=readIntTable(stream,bigEndian,trigramSegTableSize);
  }
  int wordsStringLength=readInt(stream,bigEndian);
  if (wordsStringLength <= 0) {
    throw new Error("String_Node_Str" + wordsStringLength);
  }
  this.words=readWords(stream,wordsStringLength,numberUnigrams);
  if (startWordID > -1) {
    UnigramProbability unigram=unigrams[startWordID];
    unigram.setLogProbability(MIN_PROBABILITY);
  }
  if (endWordID > -1) {
    UnigramProbability unigram=unigrams[endWordID];
    unigram.setLogBackoff(MIN_PROBABILITY);
  }
  applyUnigramWeight();
  fis.close();
  stream.close();
  file=new RandomAccessFile(location,"String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Loads the language model from the given location. 
 * @param location the location of the language model
 */
private void loadBinary(String location) throws IOException {
  FileInputStream fis=new FileInputStream(location);
  DataInputStream stream=new DataInputStream(new BufferedInputStream(fis));
  readHeader(stream);
  unigrams=readUnigrams(stream,numberUnigrams + 1,bigEndian);
  skipBigramsTrigrams(stream);
  if (numberBigrams > 0) {
    this.bigramProbTable=readFloatTable(stream,bigEndian);
    applyLanguageWeight(bigramProbTable,languageWeight);
    applyWip(bigramProbTable,wip);
  }
  if (numberTrigrams > 0) {
    trigramBackoffTable=readFloatTable(stream,bigEndian);
    trigramProbTable=readFloatTable(stream,bigEndian);
    if (applyLanguageWeightAndWip) {
      applyLanguageWeight(trigramProbTable,languageWeight);
      applyWip(trigramProbTable,wip);
      applyLanguageWeight(trigramBackoffTable,languageWeight);
    }
    int bigramSegmentSize=1 << logBigramSegmentSize;
    int trigramSegTableSize=((numberBigrams + 1) / bigramSegmentSize) + 1;
    trigramSegmentTable=readIntTable(stream,bigEndian,trigramSegTableSize);
  }
  int wordsStringLength=readInt(stream,bigEndian);
  if (wordsStringLength <= 0) {
    throw new Error("String_Node_Str" + wordsStringLength);
  }
  this.words=readWords(stream,wordsStringLength,numberUnigrams);
  if (startWordID > -1) {
    UnigramProbability unigram=unigrams[startWordID];
    unigram.setLogProbability(MIN_PROBABILITY);
  }
  if (endWordID > -1) {
    UnigramProbability unigram=unigrams[endWordID];
    unigram.setLogBackoff(MIN_PROBABILITY);
  }
  applyUnigramWeight();
  fis.close();
  stream.close();
  file=new RandomAccessFile(location,"String_Node_Str");
}