nus-yam/ex-repair huggingface dataset:
Program: 19733
Project: 19733
Buggy source:
public Object getRawNoReplacement(String name){
  throw new NotImplementedException();
}

Fixed version (ground truth):
public Object getRawNoReplacement(String name){
  throw new RuntimeException("String_Node_Str");
}
Program: 19734
Project: 19734
Buggy source:
public ConfigurationManager getPropertyManager() throws PropertyException {
  throw new NotImplementedException();
}

Fixed version (ground truth):
public ConfigurationManager getPropertyManager() throws PropertyException {
  throw new RuntimeException("String_Node_Str");
}
Program: 19735
Project: 19735
Buggy source:
public Object getRaw(String name) throws PropertyException {
  throw new NotImplementedException();
}

Fixed version (ground truth):
public Object getRaw(String name) throws PropertyException {
  throw new RuntimeException("String_Node_Str");
}
Program: 19736
Project: 19736
Buggy source:
public void newProperties(PropertySheet ps) throws PropertyException {
  super.newProperties(ps);
  outPattern=ps.getString(WavWriter.PROP_OUT_FILE_NAME_PATTERN,null);
  bitsPerSample=ps.getInt(PROP_BITS_PER_SAMPLE,bitsPerSample);
  if (bitsPerSample % 8 != 0) {
    throw new Error("String_Node_Str");
  }
  isBigEndian=ps.getBoolean(PROP_BIG_ENDIAN_DATA,isBigEndian);
  isSigned=ps.getBoolean(PROP_SIGNED_DATA,isSigned);
  captureUtts=ps.getBoolean(PROP_SIGNED_DATA,captureUtts);
  initialize();
}

Fixed version (ground truth):
public void newProperties(PropertySheet ps) throws PropertyException {
  super.newProperties(ps);
  outPattern=ps.getString(WavWriter.PROP_OUT_FILE_NAME_PATTERN,null);
  bitsPerSample=ps.getInt(PROP_BITS_PER_SAMPLE,bitsPerSample);
  if (bitsPerSample % 8 != 0) {
    throw new Error("String_Node_Str");
  }
  isBigEndian=ps.getBoolean(PROP_BIG_ENDIAN_DATA,isBigEndian);
  isSigned=ps.getBoolean(PROP_SIGNED_DATA,isSigned);
  captureUtts=ps.getBoolean(PROP_CAPTURE_UTTERANCES,captureUtts);
  initialize();
}
Program: 19739
Project: 19739
Buggy source:
public float getScore(float[] data){
  float logDval=0.0f;
  for (int i=0; i < data.length; i++) {
    float logDiff=data[i] - meanTransformed[i];
    logDval+=logDiff * logDiff * precisionTransformed[i];
  }
  logDval=logMath.lnToLog(logDval);
  logDval-=logPreComputedGaussianFactor;
  if (Float.isNaN(logDval)) {
    System.out.println("String_Node_Str");
    logDval=LogMath.getLogZero();
  }
  if (logDval < distFloor) {
    logDval=distFloor;
  }
  return logDval;
}

Fixed version (ground truth):
/** 
 * Calculate the score for this mixture against the given feature. We model the output distributions using a mixture of Gaussians, therefore the current implementation is simply the computation of a multi-dimensional Gaussian. <p/> <p><b>Normal(x) = exp{-0.5 * (x-m)' * inv(Var) * (x-m)} / {sqrt((2 * PI) ^ N) * det(Var))}</b></p> <p/> where <b>x</b> and <b>m</b> are the incoming cepstra and mean vector respectivally, <b>Var</b> is the Covariance matrix, <b>det()</b> is the determinant of a matrix, <b>inv()</b> is its inverse, <b>exp</b> is the exponential operator, <b>x'</b> is the transposed vector of <b>x</b> and <b>N</b> is the dimension of the vectors <b>x</b> and <b>m</b>.
 * @param feature the feature to score
 * @return the score, in log, for the given feature
 */
public float getScore(float[] feature){
  float logDval=0.0f;
  for (int i=0; i < feature.length; i++) {
    float logDiff=feature[i] - meanTransformed[i];
    logDval+=logDiff * logDiff * precisionTransformed[i];
  }
  logDval=logMath.lnToLog(logDval);
  logDval-=logPreComputedGaussianFactor;
  if (Float.isNaN(logDval)) {
    System.out.println("String_Node_Str");
    logDval=LogMath.getLogZero();
  }
  if (logDval < distFloor) {
    logDval=distFloor;
  }
  return logDval;
}
Program: 19740
Project: 19740
Buggy source:
/** 
 * Adds the given word into the given string buffer with the start and end times from the given features.
 * @param sb the StringBuffer into which the word is added
 * @param word the word to add
 * @param startFeature the starting feature
 * @param endFeature tne ending feature
 */
private void addWord(StringBuffer sb,Word word,FloatData startFeature,FloatData endFeature){
  float startTime=((float)startFeature.getFirstSampleNumber() / startFeature.getSampleRate());
  float endTime=((float)endFeature.getFirstSampleNumber() / endFeature.getSampleRate());
  if (sb.length() > 0) {
    sb.insert(0,"String_Node_Str");
  }
  sb.insert(0,(word.getSpelling() + "String_Node_Str" + startTime+ "String_Node_Str"+ endTime+ "String_Node_Str"));
}

Fixed version (ground truth):
/** 
 * Adds the given word into the given string buffer with the start and end times from the given features.
 * @param sb the StringBuffer into which the word is added
 * @param word the word to add
 * @param startFeature the starting feature
 * @param endFeature tne ending feature
 */
private void addWord(StringBuffer sb,Word word,FloatData startFeature,FloatData endFeature){
  float startTime=startFeature == null ? -1 : ((float)startFeature.getFirstSampleNumber() / startFeature.getSampleRate());
  float endTime=endFeature == null ? -1 : ((float)endFeature.getFirstSampleNumber() / endFeature.getSampleRate());
  if (sb.length() > 0) {
    sb.insert(0,"String_Node_Str");
  }
  sb.insert(0,(word.getSpelling() + "String_Node_Str" + startTime+ "String_Node_Str"+ endTime+ "String_Node_Str"));
}
Program: 19741
Project: 19741
Buggy source:
/** 
 * Replicate the last frame into the last window number of frames in the cepstraBuffer.
 * @return the number of replicated Cepstrum
 */
private int replicateLastCepstrum(){
  DoubleData last=null;
  if (bufferPosition > 0) {
    last=this.cepstraBuffer[bufferPosition - 1];
  }
 else   if (bufferPosition == 0) {
    last=cepstraBuffer[cepstraBuffer.length - 1];
  }
 else {
    throw new Error("String_Node_Str");
  }
  for (int i=0; i < window; i++) {
    addCepstrum(last);
  }
  return window;
}

Fixed version (ground truth):
/** 
 * Replicate the last frame into the last window number of frames in the cepstraBuffer.
 * @return the number of replicated Cepstrum
 */
private int replicateLastCepstrum(){
  DoubleData last;
  if (bufferPosition > 0) {
    last=this.cepstraBuffer[bufferPosition - 1];
  }
 else   if (bufferPosition == 0) {
    last=cepstraBuffer[cepstraBuffer.length - 1];
  }
 else {
    throw new Error("String_Node_Str");
  }
  for (int i=0; i < window; i++) {
    addCepstrum(last);
  }
  return window;
}
Program: 19742
Project: 19742
Buggy source:
private Data getNextData() throws DataProcessingException {
  Data d=getPredecessor().getData();
  while (!(d instanceof DoubleData || d instanceof DataEndSignal || d instanceof DataStartSignal)) {
    outputQueue.add(d);
    d=getPredecessor().getData();
  }
  return d;
}

Fixed version (ground truth):
private Data getNextData() throws DataProcessingException {
  Data d=getPredecessor().getData();
  while (d != null && !(d instanceof DoubleData || d instanceof DataEndSignal || d instanceof DataStartSignal)) {
    outputQueue.add(d);
    d=getPredecessor().getData();
  }
  return d;
}
Program: 19743
Project: 19743
Buggy source:
/** 
 * Returns the next Data object produced by this SocketDataSource. The Cepstra objects of an Utterance should be preceded by a Data object with Signal.DATA_START and ended by a Data object with Signal.DATA_END.
 * @return the next available Data object, returns null if noData object is available
 * @throws DataProcessingException if a data processing error occurs
 */
public Data getData() throws DataProcessingException {
  try {
    double firstValue=dataReader.readDouble();
    if (!inUtterance) {
      if (firstValue == DATA_START) {
        inUtterance=true;
        return (new DataStartSignal());
      }
 else {
        throw new IllegalStateException("String_Node_Str" + firstValue + "String_Node_Str"+ DATA_START);
      }
    }
 else {
      if (firstValue == DATA_END) {
        inUtterance=false;
        return (new DataEndSignal(-1));
      }
 else       if (firstValue == DATA_START) {
        throw new IllegalStateException("String_Node_Str");
      }
 else {
        double[] data=new double[cepstrumLength];
        data[0]=firstValue;
        long timeStamp=System.currentTimeMillis();
        for (int i=1; i < cepstrumLength; i++) {
          data[i]=dataReader.readDouble();
        }
        return (new DoubleData(data,sampleRate,timeStamp,firstSampleNumber));
      }
    }
  }
 catch (  IOException ioe) {
    throw new DataProcessingException("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Returns the next Data object produced by this SocketDataSource. The Cepstra objects of an Utterance should be preceded by a Data object with Signal.DATA_START and ended by a Data object with Signal.DATA_END.
 * @return the next available Data object, returns null if noData object is available
 * @throws DataProcessingException if a data processing error occurs
 */
public Data getData() throws DataProcessingException {
  try {
    double firstValue=dataReader.readDouble();
    if (!inUtterance) {
      if (firstValue == DATA_START) {
        inUtterance=true;
        return (new DataStartSignal(sampleRate));
      }
 else {
        throw new IllegalStateException("String_Node_Str" + firstValue + "String_Node_Str"+ DATA_START);
      }
    }
 else {
      if (firstValue == DATA_END) {
        inUtterance=false;
        return (new DataEndSignal(-1));
      }
 else       if (firstValue == DATA_START) {
        throw new IllegalStateException("String_Node_Str");
      }
 else {
        double[] data=new double[cepstrumLength];
        data[0]=firstValue;
        long timeStamp=System.currentTimeMillis();
        for (int i=1; i < cepstrumLength; i++) {
          data[i]=dataReader.readDouble();
        }
        return (new DoubleData(data,sampleRate,timeStamp,firstSampleNumber));
      }
    }
  }
 catch (  IOException ioe) {
    throw new DataProcessingException("String_Node_Str");
  }
}
Program: 19744
Project: 19744
Buggy source:
/** 
 * Constructs a DataStartSignal at the given time.
 * @param time the time this DataStartSignal is created
 */
public DataStartSignal(long time){
  super(time);
}

Fixed version (ground truth):
/** 
 * Constructs a DataStartSignal at the given time.
 * @param sampleRate the sampling rate of the started data stream.
 * @param time       the time this DataStartSignal is created
 */
public DataStartSignal(int sampleRate,long time){
  super(time);
  this.sampleRate=sampleRate;
}
Program: 19746
Project: 19746
Buggy source:
/** 
 * Implements the run() method of the Thread class. Records audio, and cache them in the audio buffer.
 */
public void run(){
  totalSamplesRead=0;
  logger.info("String_Node_Str");
  if (keepDataReference) {
    currentUtterance=new Utterance("String_Node_Str",audioStream.getFormat());
  }
  audioList.add(new DataStartSignal());
  logger.info("String_Node_Str");
  try {
    audioLine.start();
    while (!done) {
      Data data=readData(currentUtterance);
      if (data == null) {
        done=true;
        break;
      }
      audioList.add(data);
    }
    audioLine.flush();
    if (closeBetweenUtterances) {
      audioStream.close();
      audioLine.close();
      audioLine=null;
    }
  }
 catch (  IOException ioe) {
    logger.warning("String_Node_Str" + ioe.getMessage());
    ioe.printStackTrace();
  }
  long duration=(long)(((double)totalSamplesRead / (double)audioStream.getFormat().getSampleRate()) * 1000.0);
  audioList.add(new DataEndSignal(duration));
  logger.info("String_Node_Str");
  logger.info("String_Node_Str");
synchronized (lock) {
    lock.notify();
  }
}

Fixed version (ground truth):
/** 
 * Implements the run() method of the Thread class. Records audio, and cache them in the audio buffer.
 */
public void run(){
  totalSamplesRead=0;
  logger.info("String_Node_Str");
  if (keepDataReference) {
    currentUtterance=new Utterance("String_Node_Str",audioStream.getFormat());
  }
  audioList.add(new DataStartSignal(sampleRate));
  logger.info("String_Node_Str");
  try {
    audioLine.start();
    while (!done) {
      Data data=readData(currentUtterance);
      if (data == null) {
        done=true;
        break;
      }
      audioList.add(data);
    }
    audioLine.flush();
    if (closeBetweenUtterances) {
      audioStream.close();
      audioLine.close();
      audioLine=null;
    }
  }
 catch (  IOException ioe) {
    logger.warning("String_Node_Str" + ioe.getMessage());
    ioe.printStackTrace();
  }
  long duration=(long)(((double)totalSamplesRead / (double)audioStream.getFormat().getSampleRate()) * 1000.0);
  audioList.add(new DataEndSignal(duration));
  logger.info("String_Node_Str");
  logger.info("String_Node_Str");
synchronized (lock) {
    lock.notify();
  }
}
Program: 19747
Project: 19747
Buggy source:
public void newProperties(PropertySheet ps) throws PropertyException {
  super.newProperties(ps);
  logger=ps.getLogger();
  int sampleRate=ps.getInt(PROP_SAMPLE_RATE,PROP_SAMPLE_RATE_DEFAULT);
  int sampleSizeInBits=ps.getInt(PROP_BITS_PER_SAMPLE,PROP_BITS_PER_SAMPLE_DEFAULT);
  int channels=ps.getInt(PROP_CHANNELS,PROP_CHANNELS_DEFAULT);
  boolean bigEndian=ps.getBoolean(PROP_BIG_ENDIAN,PROP_BIG_ENDIAN_DEFAULT);
  signed=ps.getBoolean(PROP_SIGNED,PROP_SIGNED_DEFAULT);
  desiredFormat=new AudioFormat((float)sampleRate,sampleSizeInBits,channels,signed,bigEndian);
  closeBetweenUtterances=ps.getBoolean(PROP_CLOSE_BETWEEN_UTTERANCES,PROP_CLOSE_BETWEEN_UTTERANCES_DEFAULT);
  msecPerRead=ps.getInt(PROP_MSEC_PER_READ,PROP_MSEC_PER_READ_DEFAULT);
  keepDataReference=ps.getBoolean(PROP_KEEP_LAST_AUDIO,PROP_KEEP_LAST_AUDIO_DEFAULT);
  stereoToMono=ps.getString(PROP_STEREO_TO_MONO,PROP_STEREO_TO_MONO_DEFAULT);
  selectedChannel=ps.getInt(PROP_SELECT_CHANNEL,PROP_SELECT_CHANNEL_DEFAULT);
  selectedMixerIndex=ps.getString(PROP_SELECT_MIXER,PROP_SELECT_MIXER_DEFAULT);
}

Fixed version (ground truth):
public void newProperties(PropertySheet ps) throws PropertyException {
  super.newProperties(ps);
  logger=ps.getLogger();
  sampleRate=ps.getInt(PROP_SAMPLE_RATE,PROP_SAMPLE_RATE_DEFAULT);
  int sampleSizeInBits=ps.getInt(PROP_BITS_PER_SAMPLE,PROP_BITS_PER_SAMPLE_DEFAULT);
  int channels=ps.getInt(PROP_CHANNELS,PROP_CHANNELS_DEFAULT);
  boolean bigEndian=ps.getBoolean(PROP_BIG_ENDIAN,PROP_BIG_ENDIAN_DEFAULT);
  signed=ps.getBoolean(PROP_SIGNED,PROP_SIGNED_DEFAULT);
  desiredFormat=new AudioFormat((float)sampleRate,sampleSizeInBits,channels,signed,bigEndian);
  closeBetweenUtterances=ps.getBoolean(PROP_CLOSE_BETWEEN_UTTERANCES,PROP_CLOSE_BETWEEN_UTTERANCES_DEFAULT);
  msecPerRead=ps.getInt(PROP_MSEC_PER_READ,PROP_MSEC_PER_READ_DEFAULT);
  keepDataReference=ps.getBoolean(PROP_KEEP_LAST_AUDIO,PROP_KEEP_LAST_AUDIO_DEFAULT);
  stereoToMono=ps.getString(PROP_STEREO_TO_MONO,PROP_STEREO_TO_MONO_DEFAULT);
  selectedChannel=ps.getInt(PROP_SELECT_CHANNEL,PROP_SELECT_CHANNEL_DEFAULT);
  selectedMixerIndex=ps.getString(PROP_SELECT_MIXER,PROP_SELECT_MIXER_DEFAULT);
}
Program: 19748
Project: 19748
Buggy source:
/** 
 * Constructs a Microphone with the given InputStream.
 * @throws IOException if an I/O error occurs
 */
public void initialize(){
  super.initialize();
  audioList=new DataList();
  DataLine.Info info=new DataLine.Info(TargetDataLine.class,desiredFormat);
  if (!AudioSystem.isLineSupported(info)) {
    logger.info(desiredFormat + "String_Node_Str");
    AudioFormat nativeFormat=DataUtil.getNativeAudioFormat(desiredFormat,getSelectedMixer());
    if (nativeFormat == null) {
      logger.severe("String_Node_Str");
      return;
    }
 else {
      finalFormat=nativeFormat;
      doConversion=AudioSystem.isConversionSupported(desiredFormat,nativeFormat);
      if (doConversion) {
        logger.info("String_Node_Str" + finalFormat.getSampleRate() + "String_Node_Str"+ desiredFormat.getSampleRate()+ "String_Node_Str");
      }
 else {
        logger.info("String_Node_Str" + finalFormat.getSampleRate() + "String_Node_Str"+ desiredFormat.getSampleRate()+ "String_Node_Str");
      }
    }
  }
 else {
    logger.info("String_Node_Str" + desiredFormat + "String_Node_Str");
    finalFormat=desiredFormat;
  }
}

Fixed version (ground truth):
/** 
 * Constructs a Microphone with the given InputStream.
 * @throws IOException if an I/O error occurs
 */
public void initialize(){
  super.initialize();
  audioList=new DataList();
  DataLine.Info info=new DataLine.Info(TargetDataLine.class,desiredFormat);
  if (!AudioSystem.isLineSupported(info)) {
    logger.info(desiredFormat + "String_Node_Str");
    AudioFormat nativeFormat=DataUtil.getNativeAudioFormat(desiredFormat,getSelectedMixer());
    if (nativeFormat == null) {
      logger.severe("String_Node_Str");
    }
 else {
      finalFormat=nativeFormat;
      doConversion=AudioSystem.isConversionSupported(desiredFormat,nativeFormat);
      if (doConversion) {
        logger.info("String_Node_Str" + finalFormat.getSampleRate() + "String_Node_Str"+ desiredFormat.getSampleRate()+ "String_Node_Str");
      }
 else {
        logger.info("String_Node_Str" + finalFormat.getSampleRate() + "String_Node_Str"+ desiredFormat.getSampleRate()+ "String_Node_Str");
      }
    }
  }
 else {
    logger.info("String_Node_Str" + desiredFormat + "String_Node_Str");
    finalFormat=desiredFormat;
  }
}
Program: 19750
Project: 19750
Buggy source:
/** 
 * Returns the next Data from the input stream, or null if there is none available
 * @return a Data or null
 * @throws java.io.IOException
 */
private Data readNextFrame() throws DataProcessingException {
  int read=0;
  int totalRead=0;
  final int bytesToRead=bytesPerRead;
  byte[] samplesBuffer=new byte[bytesPerRead];
  long collectTime=System.currentTimeMillis();
  long firstSample=totalValuesRead;
  try {
    do {
      read=dataStream.read(samplesBuffer,totalRead,bytesToRead - totalRead);
      if (read > 0) {
        totalRead+=read;
      }
    }
 while (read != -1 && totalRead < bytesToRead);
    if (totalRead <= 0) {
      closeDataStream();
      return null;
    }
    totalValuesRead+=(totalRead / bytesPerValue);
    if (totalRead < bytesToRead) {
      totalRead=(totalRead % 2 == 0) ? totalRead + 2 : totalRead + 3;
      byte[] shrinkedBuffer=new byte[totalRead];
      System.arraycopy(samplesBuffer,0,shrinkedBuffer,0,totalRead);
      samplesBuffer=shrinkedBuffer;
      closeDataStream();
    }
  }
 catch (  IOException ioe) {
    ioe.printStackTrace();
    throw new DataProcessingException("String_Node_Str");
  }
  double[] doubleData;
  if (bigEndian) {
    doubleData=DataUtil.bytesToValues(samplesBuffer,0,totalRead,bytesPerValue,signedData);
  }
 else {
    doubleData=DataUtil.littleEndianBytesToValues(samplesBuffer,0,totalRead,bytesPerValue,signedData);
  }
  Data audio=new DoubleData(doubleData,sampleRate,collectTime,firstSample);
  return audio;
}

Fixed version (ground truth):
/** 
 * Returns the next Data from the input stream, or null if there is none available
 * @return a Data or null
 * @throws java.io.IOException
 */
private Data readNextFrame() throws DataProcessingException {
  int read;
  int totalRead=0;
  final int bytesToRead=bytesPerRead;
  byte[] samplesBuffer=new byte[bytesPerRead];
  long collectTime=System.currentTimeMillis();
  long firstSample=totalValuesRead;
  try {
    do {
      read=dataStream.read(samplesBuffer,totalRead,bytesToRead - totalRead);
      if (read > 0) {
        totalRead+=read;
      }
    }
 while (read != -1 && totalRead < bytesToRead);
    if (totalRead <= 0) {
      closeDataStream();
      return null;
    }
    totalValuesRead+=(totalRead / bytesPerValue);
    if (totalRead < bytesToRead) {
      totalRead=(totalRead % 2 == 0) ? totalRead + 2 : totalRead + 3;
      byte[] shrinkedBuffer=new byte[totalRead];
      System.arraycopy(samplesBuffer,0,shrinkedBuffer,0,totalRead);
      samplesBuffer=shrinkedBuffer;
      closeDataStream();
    }
  }
 catch (  IOException ioe) {
    ioe.printStackTrace();
    throw new DataProcessingException("String_Node_Str");
  }
  double[] doubleData;
  if (bigEndian) {
    doubleData=DataUtil.bytesToValues(samplesBuffer,0,totalRead,bytesPerValue,signedData);
  }
 else {
    doubleData=DataUtil.littleEndianBytesToValues(samplesBuffer,0,totalRead,bytesPerValue,signedData);
  }
  return new DoubleData(doubleData,sampleRate,collectTime,firstSample);
}
Program: 19751
Project: 19751
Buggy source:
/** 
 * Reads and returns the next Data from the InputStream of StreamDataSource, return null if no data is read and end of file is reached.
 * @return the next Data or <code>null</code> if none is available
 * @throws DataProcessingException if there is a data processing error
 */
public Data getData() throws DataProcessingException {
  getTimer().start();
  Data output=null;
  if (streamEndReached) {
    if (!utteranceEndSent) {
      output=new DataEndSignal(getDuration());
      utteranceEndSent=true;
    }
  }
 else {
    if (!utteranceStarted) {
      utteranceStarted=true;
      output=new DataStartSignal();
    }
 else {
      if (dataStream != null) {
        output=readNextFrame();
        if (output == null) {
          if (!utteranceEndSent) {
            output=new DataEndSignal(getDuration());
            utteranceEndSent=true;
          }
        }
      }
    }
  }
  getTimer().stop();
  return output;
}

Fixed version (ground truth):
/** 
 * Reads and returns the next Data from the InputStream of StreamDataSource, return null if no data is read and end of file is reached.
 * @return the next Data or <code>null</code> if none is available
 * @throws DataProcessingException if there is a data processing error
 */
public Data getData() throws DataProcessingException {
  getTimer().start();
  Data output=null;
  if (streamEndReached) {
    if (!utteranceEndSent) {
      output=new DataEndSignal(getDuration());
      utteranceEndSent=true;
    }
  }
 else {
    if (!utteranceStarted) {
      utteranceStarted=true;
      output=new DataStartSignal(sampleRate);
    }
 else {
      if (dataStream != null) {
        output=readNextFrame();
        if (output == null) {
          if (!utteranceEndSent) {
            output=new DataEndSignal(getDuration());
            utteranceEndSent=true;
          }
        }
      }
    }
  }
  getTimer().stop();
  return output;
}
Program: 19752
Project: 19752
Buggy source:
/** 
 * Returns true if this SphinxProperties contains the given property.
 * @return true if it has the given property, false otherwise
 */
public boolean contains(String propertyName){
  String value=System.getProperty(propertyName);
  if (value == null) {
    return props.contains(propertyName);
  }
 else {
    return true;
  }
}

Fixed version (ground truth):
/** 
 * Returns true if this SphinxProperties contains the given property.
 * @return true if it has the given property, false otherwise
 */
public boolean contains(String propertyName){
  String value=System.getProperty(propertyName);
  if (value == null) {
    return props.containsKey(propertyName);
  }
 else {
    return true;
  }
}
Program: 19753
Project: 19753
Buggy source:
/** 
 * Called whenever the value of the selection changes.
 * @param e the event that characterizes the change.
 */
public void valueChanged(TreeSelectionEvent e){
  DefaultMutableTreeNode n=(DefaultMutableTreeNode)e.getPath().getLastPathComponent();
  if (n.getUserObject() instanceof Word) {
    Word word=(Word)n.getUserObject();
    System.out.println(word);
    final WordBrowser w=new WordBrowser();
    JFrame f=new JFrame("String_Node_Str");
    w.spectrogram.setWord(cm,word);
    f.setContentPane(w.mainPane);
    f.setTitle(word.toString());
    f.pack();
    f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    f.setVisible(true);
  }
}

Fixed version (ground truth):
/** 
 * Called whenever the value of the selection changes.
 * @param e the event that characterizes the change.
 */
public void valueChanged(TreeSelectionEvent e){
  DefaultMutableTreeNode n=(DefaultMutableTreeNode)e.getPath().getLastPathComponent();
  if (n.getUserObject() instanceof Word) {
    Word word=(Word)n.getUserObject();
    System.out.println(word);
    final WordBrowser w=new WordBrowser(cm,word);
    JFrame f=new JFrame("String_Node_Str");
    w.spectrogram.setWord(cm,word);
    f.setContentPane(w.mainPane);
    f.setTitle(word.toString());
    f.pack();
    f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    f.setVisible(true);
  }
}
Program: 19754
Project: 19754
Buggy source:
/** 
 * Returns the next Data object.
 * @return the next Data object, or null if none available
 * @throws DataProcessingException if a data processing error occurs
 */
public Data getData() throws DataProcessingException {
  if (outputQueue.size() == 0) {
    Data audio=getPredecessor().getData();
    if (audio != null) {
      if (audio instanceof DoubleData) {
        DoubleData data=(DoubleData)audio;
        if (data.getValues().length > ((int)(frameLengthSec * data.getSampleRate()))) {
          throw new Error("String_Node_Str" + data.getValues().length + "String_Node_Str"+ (frameLengthSec * data.getSampleRate()));
        }
        classify(data);
      }
 else {
        outputQueue.add(audio);
      }
    }
  }
  if (outputQueue.size() > 0) {
    Data audio=(Data)outputQueue.remove(0);
    return audio;
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Returns the next Data object.
 * @return the next Data object, or null if none available
 * @throws DataProcessingException if a data processing error occurs
 */
public Data getData() throws DataProcessingException {
  if (outputQueue.size() == 0) {
    Data audio=getPredecessor().getData();
    if (audio != null) {
      if (audio instanceof DoubleData) {
        DoubleData data=(DoubleData)audio;
        if (data.getValues().length > ((int)(frameLengthSec * data.getSampleRate()))) {
          throw new Error("String_Node_Str" + data.getValues().length + "String_Node_Str"+ (frameLengthSec * data.getSampleRate()));
        }
        classify(data);
      }
 else {
        outputQueue.add(audio);
      }
    }
  }
  if (outputQueue.size() > 0) {
    return (Data)outputQueue.remove(0);
  }
 else {
    return null;
  }
}
Program: 19755
Project: 19755
Buggy source:
public void register(String name,Registry registry) throws PropertyException {
  super.register(name,registry);
  registry.register(PROP_FRAME_LENGTH_MS,PropertyType.INT);
  registry.register(PROP_ADJUSTMENT,PropertyType.DOUBLE);
  registry.register(PROP_THRESHOLD,PropertyType.DOUBLE);
  registry.register(PROP_MIN_SIGNAL,PropertyType.DOUBLE);
  registry.register(PROP_DEBUG,PropertyType.BOOLEAN);
}

Fixed version (ground truth):
public void register(String name,Registry registry) throws PropertyException {
  super.register(name,registry);
  registry.register(PROP_FRAME_LENGTH_MS,PropertyType.INT);
  registry.register(PROP_ADJUSTMENT,PropertyType.DOUBLE);
  registry.register(PROP_THRESHOLD,PropertyType.DOUBLE);
  registry.register(PROP_MIN_SIGNAL,PropertyType.DOUBLE);
  registry.register(PROP_DEBUG,PropertyType.BOOLEAN);
  initialize();
}
Program: 19756
Project: 19756
Buggy source:
/** 
 * Converts the Cepstrum data in the cepstraBuffer into a FeatureFrame.
 * @param totalFeatures the number of Features that will be produced
 * @return a FeatureFrame
 */
private void computeFeatures(int totalFeatures){
  getTimer().start();
  if (totalFeatures == 1) {
    computeFeature();
  }
 else {
    for (int i=0; i < totalFeatures; i++) {
      computeFeature();
    }
  }
  getTimer().stop();
}

Fixed version (ground truth):
/** 
 * Converts the Cepstrum data in the cepstraBuffer into a FeatureFrame.
 * @param totalFeatures the number of Features that will be produced
 */
private void computeFeatures(int totalFeatures){
  getTimer().start();
  if (totalFeatures == 1) {
    computeFeature();
  }
 else {
    for (int i=0; i < totalFeatures; i++) {
      computeFeature();
    }
  }
  getTimer().stop();
}
Program: 19757
Project: 19757
Buggy source:
/** 
 * Converts the Cepstrum data in the cepstraBuffer into a FeatureFrame.
 * @param totalFeatures the number of Features that will be produced
 * @return a FeatureFrame
 */
private void computeFeatures(int totalFeatures){
  getTimer().start();
  if (totalFeatures == 1) {
    computeFeature();
  }
 else {
    for (int i=0; i < totalFeatures; i++) {
      computeFeature();
    }
  }
  getTimer().stop();
}

Fixed version (ground truth):
/** 
 * Converts the Cepstrum data in the cepstraBuffer into a FeatureFrame.
 * @param totalFeatures the number of Features that will be produced
 */
private void computeFeatures(int totalFeatures){
  getTimer().start();
  if (totalFeatures == 1) {
    computeFeature();
  }
 else {
    for (int i=0; i < totalFeatures; i++) {
      computeFeature();
    }
  }
  getTimer().stop();
}
Program: 19758
Project: 19758
Buggy source:
/** 
 * Attaches one SentenceHMMState as a child to another, the transition has the given probability
 * @param prevState the parent state
 * @param nextState the child state
 * @param logAcousticProbability the acoustic probability of transition in the LogMath log domain
 * @param logLanguageProbablity the language probability of transition in the LogMath log domain
 * @param logInsertionProbablity insertion probability of transition in the LogMath log domain
 * @return the state that was attached
 */
protected void attachState(SentenceHMMState prevState,SentenceHMMState nextState,float logAcousticProbability,float logLanguageProbablity,float logInsertionProbablity){
  prevState.connect(getArc(nextState,logAcousticProbability,logLanguageProbablity,logInsertionProbablity));
  if (showCompilationProgress && totalStateCounter++ % 1000 == 0) {
    System.out.print("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Attaches one SentenceHMMState as a child to another, the transition has the given probability
 * @param prevState the parent state
 * @param nextState the child state
 * @param logAcousticProbability the acoustic probability of transition in the LogMath log domain
 * @param logLanguageProbablity the language probability of transition in the LogMath log domain
 * @param logInsertionProbablity insertion probability of transition in the LogMath log domain
 */
protected void attachState(SentenceHMMState prevState,SentenceHMMState nextState,float logAcousticProbability,float logLanguageProbablity,float logInsertionProbablity){
  prevState.connect(getArc(nextState,logAcousticProbability,logLanguageProbablity,logInsertionProbablity));
  if (showCompilationProgress && totalStateCounter++ % 1000 == 0) {
    System.out.print("String_Node_Str");
  }
}
Program: 19759
Project: 19759
Buggy source:
/** 
 * Decodes the batch of audio files
 * @throws IOException if there is an I/O error processing the batch file
 */
public void decode(String batchFile){
  BatchItem batchItem;
  int count=0;
  try {
    recognizer.allocate();
    setBatchFile(batchFile);
    batchManager.start();
    logger.info("String_Node_Str" + batchManager.getFilename());
    while (count < totalCount && (batchItem=batchManager.getNextItem()) != null) {
      setInputStream(batchItem.getFilename());
      Result result=recognizer.recognize(batchItem.getTranscript());
      logger.info("String_Node_Str" + batchItem.getFilename());
      logger.info("String_Node_Str" + result);
      count++;
    }
    batchManager.stop();
    recognizer.deallocate();
  }
 catch (  IOException io) {
    logger.severe("String_Node_Str" + io.getMessage());
  }
  logger.info("String_Node_Str" + count + "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Decodes the batch of audio files
 */
public void decode(String batchFile){
  BatchItem batchItem;
  int count=0;
  try {
    recognizer.allocate();
    setBatchFile(batchFile);
    batchManager.start();
    logger.info("String_Node_Str" + batchManager.getFilename());
    while (count < totalCount && (batchItem=batchManager.getNextItem()) != null) {
      setInputStream(batchItem.getFilename());
      Result result=recognizer.recognize(batchItem.getTranscript());
      logger.info("String_Node_Str" + batchItem.getFilename());
      logger.info("String_Node_Str" + result);
      count++;
    }
    batchManager.stop();
    recognizer.deallocate();
  }
 catch (  IOException io) {
    logger.severe("String_Node_Str" + io.getMessage());
  }
  logger.info("String_Node_Str" + count + "String_Node_Str");
}
Program: 19760
Project: 19760
Buggy source:
/** 
 * Sets the input stream to the given filename
 * @param filename the filename to set the input stream to
 * @return the InputStream representing the filename
 * @throws IOException if an error occurs
 */
void setInputStream(String filename) throws IOException {
  for (Iterator i=inputDataProcessors.iterator(); i.hasNext(); ) {
    DataProcessor dataSource=(DataProcessor)i.next();
    InputStream is=null;
    try {
      File file=new File(filename);
      logger.info(AudioSystem.getAudioFileFormat(file).toString());
      is=AudioSystem.getAudioInputStream(file);
    }
 catch (    UnsupportedAudioFileException uafe) {
      logger.info("String_Node_Str" + filename + "String_Node_Str");
      is=new FileInputStream(filename);
    }
    if (dataSource instanceof StreamDataSource) {
      ((StreamDataSource)dataSource).setInputStream(is,filename);
    }
 else     if (dataSource instanceof StreamCepstrumSource) {
      boolean isBigEndian=Utilities.isCepstraFileBigEndian(filename);
      StreamCepstrumSource cepstrumSource=(StreamCepstrumSource)dataSource;
      cepstrumSource.setInputStream(is,isBigEndian);
    }
  }
}

Fixed version (ground truth):
/** 
 * Sets the input stream to the given filename
 * @param filename the filename to set the input stream to
 * @throws IOException if an error occurs
 */
void setInputStream(String filename) throws IOException {
  for (Iterator i=inputDataProcessors.iterator(); i.hasNext(); ) {
    DataProcessor dataSource=(DataProcessor)i.next();
    InputStream is=null;
    try {
      File file=new File(filename);
      logger.info(AudioSystem.getAudioFileFormat(file).toString());
      is=AudioSystem.getAudioInputStream(file);
    }
 catch (    UnsupportedAudioFileException uafe) {
      logger.info("String_Node_Str" + filename + "String_Node_Str");
      is=new FileInputStream(filename);
    }
    if (dataSource instanceof StreamDataSource) {
      ((StreamDataSource)dataSource).setInputStream(is,filename);
    }
 else     if (dataSource instanceof StreamCepstrumSource) {
      boolean isBigEndian=Utilities.isCepstraFileBigEndian(filename);
      StreamCepstrumSource cepstrumSource=(StreamCepstrumSource)dataSource;
      cepstrumSource.setInputStream(is,isBigEndian);
    }
  }
}
Program: 19761
Project: 19761
Buggy source:
/** 
 * Converts the Cepstrum data in the cepstraBuffer into a FeatureFrame.
 * @param totalFeatures the number of Features that will be produced
 */
private void computeFeatures(int totalFeatures){
  getTimer().start();
  if (totalFeatures == 1) {
    computeFeature();
  }
 else {
    for (int i=0; i < totalFeatures; i++) {
      computeFeature();
    }
  }
  getTimer().stop();
}

Fixed version (ground truth):
/** 
 * Converts the Cepstrum data in the cepstraBuffer into a FeatureFrame.
 * @param totalFeatures the number of Features that will be produced
 * @return a FeatureFrame
 */
private void computeFeatures(int totalFeatures){
  getTimer().start();
  if (totalFeatures == 1) {
    computeFeature();
  }
 else {
    for (int i=0; i < totalFeatures; i++) {
      computeFeature();
    }
  }
  getTimer().stop();
}
Program: 19762
Project: 19762
Buggy source:
/** 
 * Converts the Cepstrum data in the cepstraBuffer into a FeatureFrame.
 * @param totalFeatures the number of Features that will be produced
 */
private void computeFeatures(int totalFeatures){
  getTimer().start();
  if (totalFeatures == 1) {
    computeFeature();
  }
 else {
    for (int i=0; i < totalFeatures; i++) {
      computeFeature();
    }
  }
  getTimer().stop();
}

Fixed version (ground truth):
/** 
 * Converts the Cepstrum data in the cepstraBuffer into a FeatureFrame.
 * @param totalFeatures the number of Features that will be produced
 * @return a FeatureFrame
 */
private void computeFeatures(int totalFeatures){
  getTimer().start();
  if (totalFeatures == 1) {
    computeFeature();
  }
 else {
    for (int i=0; i < totalFeatures; i++) {
      computeFeature();
    }
  }
  getTimer().stop();
}
Program: 19763
Project: 19763
Buggy source:
/** 
 * Dumps the feature to the given ascii output file.
 * @param outputFile the ascii output file
 */
public void dumpAscii(String outputFile) throws IOException {
  PrintStream ps=new PrintStream(new FileOutputStream(outputFile),true);
  ps.print(getNumberDataPoints());
  ps.print(' ');
  for (Iterator i=allFeatures.iterator(); i.hasNext(); ) {
    double[] feature=(double[])i.next();
    for (int d=0; d < feature.length; d++) {
      ps.print(feature[d]);
      ps.print(' ');
    }
  }
  ps.close();
}

Fixed version (ground truth):
/** 
 * Dumps the feature to the given ascii output file.
 * @param outputFile the ascii output file
 */
public void dumpAscii(String outputFile) throws IOException {
  PrintStream ps=new PrintStream(new FileOutputStream(outputFile),true);
  ps.print(getNumberDataPoints());
  ps.print(' ');
  for (Iterator i=allFeatures.iterator(); i.hasNext(); ) {
    Object data=i.next();
    if (data instanceof double[]) {
      double[] feature=(double[])data;
      for (int d=0; d < feature.length; d++) {
        ps.print(feature[d]);
        ps.print(' ');
      }
    }
 else     if (data instanceof float[]) {
      float[] feature=(float[])data;
      for (int d=0; d < feature.length; d++) {
        ps.print(feature[d]);
        ps.print(' ');
      }
    }
  }
  ps.close();
}
Program: 19764
Project: 19764
Buggy source:
/** 
 * Returns the string of words (with timestamp) for this token. This method assumes that the word tokens come before other types of token.
 * @param wantFiller true if we want filler words, false otherwise
 * @return the string of words
 */
private String getTimedWordPath(Token token,boolean wantFiller){
  StringBuffer sb=new StringBuffer();
  while (token != null & !token.isEmitting()) {
    token=token.getPredecessor();
  }
  if (token != null) {
    Data lastWordFirstFeature=token.getData();
    Data lastFeature=lastWordFirstFeature;
    token=token.getPredecessor();
    while (token != null) {
      if (token.isWord()) {
        Word word=token.getWord();
        if (wantFiller || !word.isFiller()) {
          addWord(sb,word,(FloatData)lastFeature,(FloatData)lastWordFirstFeature);
        }
        lastWordFirstFeature=lastFeature;
      }
      Data feature=token.getData();
      if (feature != null) {
        lastFeature=feature;
      }
      token=token.getPredecessor();
    }
  }
  return sb.toString();
}

Fixed version (ground truth):
/** 
 * Returns the string of words (with timestamp) for this token. This method assumes that the word tokens come before other types of token.
 * @param wantFiller true if we want filler words, false otherwise
 * @return the string of words
 */
private String getTimedWordPath(Token token,boolean wantFiller){
  StringBuffer sb=new StringBuffer();
  while (token != null && !token.isEmitting()) {
    token=token.getPredecessor();
  }
  if (token != null) {
    Data lastWordFirstFeature=token.getData();
    Data lastFeature=lastWordFirstFeature;
    token=token.getPredecessor();
    while (token != null) {
      if (token.isWord()) {
        Word word=token.getWord();
        if (wantFiller || !word.isFiller()) {
          addWord(sb,word,(FloatData)lastFeature,(FloatData)lastWordFirstFeature);
        }
        lastWordFirstFeature=lastFeature;
      }
      Data feature=token.getData();
      if (feature != null) {
        lastFeature=feature;
      }
      token=token.getPredecessor();
    }
  }
  return sb.toString();
}
Program: 19765
Project: 19765
Buggy source:
/** 
 * Replaces an old token with a new token
 * @param oldToken the token to replace (or null in which case, replace works like add).
 * @param newToken the new token to be placed in the list.
 */
public void replace(Token oldToken,Token newToken){
  if (oldToken != null) {
    int location=oldToken.getLocation();
    if (tokenList[location] != oldToken) {
      System.out.println("String_Node_Str" + oldToken + "String_Node_Str"+ newToken+ "String_Node_Str"+ location+ "String_Node_Str"+ tokenList[location]);
    }
    tokenList[location]=newToken;
    newToken.setLocation(location);
    if (bestToken == null || newToken.getScore() > bestToken.getScore()) {
      bestToken=newToken;
    }
  }
 else {
    add(newToken);
  }
}

Fixed version (ground truth):
/** 
 * Replaces an old token with a new token
 * @param oldToken the token to replace (or null in which case, replace works like add).
 * @param newToken the new token to be placed in the list.
 */
public void replace(Token oldToken,Token newToken){
  if (oldToken != null) {
    int location=oldToken.getLocation();
    if (location != -1 && tokenList[location] == oldToken) {
      tokenList[location]=newToken;
      newToken.setLocation(location);
      oldToken.setLocation(-1);
    }
 else {
      add(newToken);
    }
  }
 else {
    add(newToken);
  }
  if (bestToken == null || newToken.getScore() > bestToken.getScore()) {
    bestToken=newToken;
  }
}
Program: 19766
Project: 19766
Buggy source:
/** 
 * Perform one inter word clustering step of the algorithm
 * @param clusters the current cluster set
 */
protected boolean interWordClusterStep(List clusters){
  List toBeMerged1=null;
  List toBeMerged2=null;
  double maxSim=Double.NEGATIVE_INFINITY;
  ListIterator i=clusters.listIterator();
  while (i.hasNext()) {
    List c1=(List)i.next();
    if (!i.hasNext()) {
      break;
    }
    ListIterator j=clusters.listIterator(i.nextIndex());
    while (j.hasNext()) {
      List c2=(List)j.next();
      double sim=interClusterDistance(c1,c2);
      if (sim > maxSim && hasOverlap(c1,c2)) {
        maxSim=sim;
        toBeMerged1=c1;
        toBeMerged2=c2;
      }
    }
  }
  if (toBeMerged1 != null) {
    clusters.remove(toBeMerged2);
    toBeMerged1.addAll(toBeMerged2);
    System.out.println("String_Node_Str");
    printClusters(clusters);
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Perform one inter word clustering step of the algorithm
 * @param clusters the current cluster set
 */
protected boolean interWordClusterStep(List clusters){
  List toBeMerged1=null;
  List toBeMerged2=null;
  double maxSim=Double.NEGATIVE_INFINITY;
  ListIterator i=clusters.listIterator();
  while (i.hasNext()) {
    List c1=(List)i.next();
    if (!i.hasNext()) {
      break;
    }
    ListIterator j=clusters.listIterator(i.nextIndex());
    while (j.hasNext()) {
      List c2=(List)j.next();
      double sim=interClusterDistance(c1,c2);
      if (sim > maxSim && hasOverlap(c1,c2)) {
        maxSim=sim;
        toBeMerged1=c1;
        toBeMerged2=c2;
      }
    }
  }
  if (toBeMerged1 != null) {
    clusters.remove(toBeMerged2);
    toBeMerged1.addAll(toBeMerged2);
    return true;
  }
  return false;
}
Program: 19767
Project: 19767
Buggy source:
/** 
 * Perform a step of the intra word clustering stage
 * @param clusters the current list of clusters
 * @return did two clusters get merged?
 */
protected boolean intraWordClusterStep(List clusters){
  List toBeMerged1=null;
  List toBeMerged2=null;
  double maxSim=Double.NEGATIVE_INFINITY;
  ListIterator i=clusters.listIterator();
  while (i.hasNext()) {
    List c1=(List)i.next();
    if (!i.hasNext()) {
      break;
    }
    ListIterator j=clusters.listIterator(i.nextIndex());
    while (j.hasNext()) {
      List c2=(List)j.next();
      double sim=intraClusterDistance(c1,c2);
      if (sim > maxSim) {
        maxSim=sim;
        toBeMerged1=c1;
        toBeMerged2=c2;
      }
    }
  }
  if (toBeMerged1 != null) {
    clusters.remove(toBeMerged2);
    toBeMerged1.addAll(toBeMerged2);
    System.out.println("String_Node_Str");
    printClusters(clusters);
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Perform a step of the intra word clustering stage
 * @param clusters the current list of clusters
 * @return did two clusters get merged?
 */
protected boolean intraWordClusterStep(List clusters){
  List toBeMerged1=null;
  List toBeMerged2=null;
  double maxSim=Double.NEGATIVE_INFINITY;
  ListIterator i=clusters.listIterator();
  while (i.hasNext()) {
    List c1=(List)i.next();
    if (!i.hasNext()) {
      break;
    }
    ListIterator j=clusters.listIterator(i.nextIndex());
    while (j.hasNext()) {
      List c2=(List)j.next();
      double sim=intraClusterDistance(c1,c2);
      if (sim > maxSim) {
        maxSim=sim;
        toBeMerged1=c1;
        toBeMerged2=c2;
      }
    }
  }
  if (toBeMerged1 != null) {
    clusters.remove(toBeMerged2);
    toBeMerged1.addAll(toBeMerged2);
    return true;
  }
  return false;
}
Program: 19768
Project: 19768
Buggy source:
/** 
 * Turn the lattice contained in this sausage maker into a sausage object.
 * @return the sausage producing by collapsing the lattice.
 */
public Sausage makeSausage(){
  Vector clusters=new Vector(lattice.getNodes().size());
  Collection nodes=lattice.nodes.values();
  Iterator i=nodes.iterator();
  while (i.hasNext()) {
    Vector bucket=new Vector(1);
    bucket.add(i.next());
    clusters.add(bucket);
  }
  intraWordCluster(clusters);
  interWordCluster(clusters);
  Collections.sort(clusters,new ClusterComparator());
  printClusters(clusters);
  Sausage sausage=new Sausage(clusters.size());
  ListIterator c1=clusters.listIterator();
  while (c1.hasNext()) {
    HashSet seenWords=new HashSet();
    int index=c1.nextIndex();
    List cluster=((List)c1.next());
    Iterator c2=cluster.iterator();
    while (c2.hasNext()) {
      Node node=(Node)c2.next();
      Word word=node.getWord();
      if (seenWords.contains(word.getSpelling())) {
        continue;
      }
      seenWords.add(word.getSpelling());
      SimpleWordResult swr=new SimpleWordResult(node,wordSubClusterProbability(cluster,word.getSpelling()),lattice.getLogMath());
      sausage.addWordHypothesis(index,swr);
    }
  }
  sausage.fillInBlanks(lattice.getLogMath());
  return sausage;
}

Fixed version (ground truth):
/** 
 * Turn the lattice contained in this sausage maker into a sausage object.
 * @return the sausage producing by collapsing the lattice.
 */
public Sausage makeSausage(){
  Vector clusters=new Vector(lattice.getNodes().size());
  Collection nodes=lattice.nodes.values();
  Iterator i=nodes.iterator();
  while (i.hasNext()) {
    Vector bucket=new Vector(1);
    bucket.add(i.next());
    clusters.add(bucket);
  }
  intraWordCluster(clusters);
  interWordCluster(clusters);
  clusters=topologicalSort(clusters);
  Sausage sausage=new Sausage(clusters.size());
  ListIterator c1=clusters.listIterator();
  while (c1.hasNext()) {
    HashSet seenWords=new HashSet();
    int index=c1.nextIndex();
    List cluster=((List)c1.next());
    Iterator c2=cluster.iterator();
    while (c2.hasNext()) {
      Node node=(Node)c2.next();
      Word word=node.getWord();
      if (seenWords.contains(word.getSpelling())) {
        continue;
      }
      seenWords.add(word.getSpelling());
      SimpleWordResult swr=new SimpleWordResult(node,wordSubClusterProbability(cluster,word.getSpelling()),lattice.getLogMath());
      sausage.addWordHypothesis(index,swr);
    }
  }
  sausage.fillInBlanks(lattice.getLogMath());
  return sausage;
}
Program: 19770
Project: 19770
Buggy source:
public void newProperties(PropertySheet ps) throws PropertyException {
  languageWeight=ps.getFloat(PROP_LANGUAGE_WEIGHT,PROP_LANGUAGE_WEIGHT_DEFAULT);
}

Fixed version (ground truth):
public void newProperties(PropertySheet ps) throws PropertyException {
  languageWeight=ps.getFloat(PROP_LANGUAGE_WEIGHT,PROP_LANGUAGE_WEIGHT_DEFAULT);
  dumpLattice=ps.getBoolean(PROP_DUMP_LATTICE,PROP_DUMP_LATTICE_DEFAULT);
  dumpSausage=ps.getBoolean(PROP_DUMP_SAUSAGE,PROP_DUMP_SAUSAGE_DEFAULT);
}
Program: 19771
Project: 19771
Buggy source:
public void register(String name,Registry registry) throws PropertyException {
  this.name=name;
  registry.register(PROP_LANGUAGE_WEIGHT,PropertyType.FLOAT);
}

Fixed version (ground truth):
public void register(String name,Registry registry) throws PropertyException {
  this.name=name;
  registry.register(PROP_LANGUAGE_WEIGHT,PropertyType.FLOAT);
  registry.register(PROP_DUMP_LATTICE,PropertyType.BOOLEAN);
  registry.register(PROP_DUMP_SAUSAGE,PropertyType.BOOLEAN);
}