nus-yam/ex-repair huggingface dataset:
Program: 19853
Project: 19853
Buggy source:
/** 
 * Initializes a BaseFrontEnd with the given name, context, acoustic  model name, and DataSource.
 * @param name the name of this BaseFrontEnd
 * @param context the context of interest
 * @param props the SphinxProperties to use
 * @param amName the name of the acoustic model
 * @param dataSource the source of data; can be null, in whichcase the setDataSource() method must be called later
 */
public void initialize(String name,String context,SphinxProperties props,String amName,DataSource dataSource) throws IOException {
  super.initialize(name,context,props,amName,dataSource);
  CepstrumSource lastCepstrumSource=this;
  CepstrumSource cmn=getCMN(lastCepstrumSource);
  if (cmn != null) {
    addProcessor((DataProcessor)cmn);
    lastCepstrumSource=cmn;
  }
  FeatureExtractor extractor=getFeatureExtractor(lastCepstrumSource);
  addProcessor((DataProcessor)extractor);
  FrameDropper frameDropper=getFrameDropper(extractor);
  if (frameDropper == null) {
    this.featureSource=extractor;
  }
 else {
    this.featureSource=frameDropper;
    addProcessor((DataProcessor)frameDropper);
  }
}

Fixed version (ground truth):
/** 
 * Initializes a BaseFrontEnd with the given name, context, acoustic  model name, and DataSource.
 * @param name the name of this BaseFrontEnd
 * @param context the context of interest
 * @param props the SphinxProperties to use
 * @param amName the name of the acoustic model
 * @param dataSource the source of data; can be null, in whichcase the setDataSource() method must be called later
 * @throws IOException if an I/O error occurs
 */
public void initialize(String name,String context,SphinxProperties props,String amName,DataSource dataSource) throws IOException {
  super.initialize(name,context,props,amName,dataSource);
  CepstrumSource lastCepstrumSource=this;
  CepstrumSource cmn=getCMN(lastCepstrumSource);
  if (cmn != null) {
    addProcessor((DataProcessor)cmn);
    lastCepstrumSource=cmn;
  }
  FeatureExtractor extractor=getFeatureExtractor(lastCepstrumSource);
  addProcessor((DataProcessor)extractor);
  FrameDropper frameDropper=getFrameDropper(extractor);
  if (frameDropper == null) {
    this.featureSource=extractor;
  }
 else {
    this.featureSource=frameDropper;
    addProcessor((DataProcessor)frameDropper);
  }
}
Program: 19854
Project: 19854
Buggy source:
/** 
 * Returns the BaseFrontEnd with the given context, or null  if there is no BaseFrontEnd with that context.
 * @return the BaseFrontEnd with the given context, or null if thereis no BaseFrontEnd with that context
 */
public static FrontEnd getFrontEnd(String context){
  Object frontend=frontends.get(context);
  if (frontend != null) {
    return (FrontEnd)frontend;
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Returns the BaseFrontEnd with the given context, or null  if there is no BaseFrontEnd with that context.
 * @param context the context of the FrontEnd to get
 * @return the BaseFrontEnd with the given context, or null if thereis no BaseFrontEnd with that context
 * @throws IOException if an I/O error occurs
 */
public static FrontEnd getFrontEnd(String context){
  Object frontend=frontends.get(context);
  if (frontend != null) {
    return (FrontEnd)frontend;
  }
 else {
    return null;
  }
}
Program: 19855
Project: 19855
Buggy source:
/** 
 * Returns the DataProcessor in the CepstrumExtractor with the given name.
 * @return the DataProcessor with the given name, or null if nosuch DataProcessor
 */
public DataProcessor getProcessor(String processorName){
  Object object=processors.get(processorName);
  if (object == null) {
    System.out.println("String_Node_Str" + processorName);
    return null;
  }
 else {
    return (DataProcessor)object;
  }
}

Fixed version (ground truth):
/** 
 * Returns the DataProcessor in the CepstrumExtractor with the given name.
 * @param processorName the name of the processor to return
 * @return the DataProcessor with the given name, or null if nosuch DataProcessor
 */
public DataProcessor getProcessor(String processorName){
  Object object=processors.get(processorName);
  if (object == null) {
    System.out.println("String_Node_Str" + processorName);
    return null;
  }
 else {
    return (DataProcessor)object;
  }
}
Program: 19856
Project: 19856
Buggy source:
/** 
 * Initializes this CepstrumProducer.
 * @param name the name of this CepstrumProducer
 * @param context the relevant context to use
 * @param props the SphinxProperties to read properties from
 * @param predecessor where to get the Spectrum objects
 */
public void initialize(String name,String context,SphinxProperties props,SpectrumSource predecessor) throws IOException ;

Fixed version (ground truth):
/** 
 * Initializes this CepstrumProducer.
 * @param name the name of this CepstrumProducer
 * @param context the relevant context to use
 * @param props the SphinxProperties to read properties from
 * @param predecessor where to get the Spectrum objects
 * @throws IOException if an I/O error occurs
 */
public void initialize(String name,String context,SphinxProperties props,SpectrumSource predecessor) throws IOException ;
Program: 19857
Project: 19857
Buggy source:
/** 
 * Returns true if this Data has the given Signal
 * @return true if this Data object has the given Signal,false otherwise
 */
public boolean hasSignal(Signal signal){
  if (getSignal() != null) {
    return (getSignal().equals(signal));
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Returns true if this Data has the given Signal.
 * @param signal  the Signal type to check
 * @return true if this Data object has the given Signal,false otherwise
 */
public boolean hasSignal(Signal signal){
  if (getSignal() != null) {
    return (getSignal().equals(signal));
  }
 else {
    return false;
  }
}
Program: 19858
Project: 19858
Buggy source:
/** 
 * Sets the SphinxProperties to use.
 * @param sphinxProperties the SphinxProperties to use
 */
public void setSphinxProperties(SphinxProperties sphinxProperties){
  this.sphinxProperties=sphinxProperties;
}

Fixed version (ground truth):
/** 
 * Sets the SphinxProperties to use.
 * @param sphinxProperties the SphinxProperties to use
 * @see #getSphinxProperties
 */
public void setSphinxProperties(SphinxProperties sphinxProperties){
  this.sphinxProperties=sphinxProperties;
}
Program: 19859
Project: 19859
Buggy source:
/** 
 * Determine whether to dump the output for debug purposes.
 * @return true to dump, false to not dump
 */
public final boolean getDump(){
  return this.dump;
}

Fixed version (ground truth):
/** 
 * Determine whether to dump the output for debug purposes.
 * @return true to dump, false to not dump
 * @see #setDump
 */
public final boolean getDump(){
  return this.dump;
}
Program: 19860
Project: 19860
Buggy source:
/** 
 * Returns the SphinxProperties used by this DataProcessor.
 * @return the SphinxProperties
 */
public final SphinxProperties getSphinxProperties(){
  if (sphinxProperties != null) {
    return sphinxProperties;
  }
 else {
    return SphinxProperties.getSphinxProperties(getContext());
  }
}

Fixed version (ground truth):
/** 
 * Returns the SphinxProperties used by this DataProcessor.
 * @return the SphinxProperties
 * @see #setSphinxProperties
 */
public final SphinxProperties getSphinxProperties(){
  if (sphinxProperties != null) {
    return sphinxProperties;
  }
 else {
    return SphinxProperties.getSphinxProperties(getContext());
  }
}
Program: 19861
Project: 19861
Buggy source:
/** 
 * Set whether we should dump the output for debug purposes.
 * @param dump true to dump the output; false otherwise
 */
public void setDump(boolean dump){
  this.dump=dump;
}

Fixed version (ground truth):
/** 
 * Set whether we should dump the output for debug purposes.
 * @param dump true to dump the output; false otherwise
 * @see #getDump
 */
public void setDump(boolean dump){
  this.dump=dump;
}
Program: 19862
Project: 19862
Buggy source:
/** 
 * Returns the type of this Feature. It should normally be the name of the acoustic model used, because it is used to identify which acoustic model this Feature should be aligned with in the decoder. It can also return null, meaning that it has no type name. This would mean that there is only one acoustic model in the decoder.
 * @return the type name of this Feature, or null if it does nothave a type name.
 */
public String getType(){
  return type;
}

Fixed version (ground truth):
/** 
 * Returns the type of this Feature. It should normally be the name of the acoustic model used, because it is used to identify which acoustic model this Feature should be aligned with in the decoder. It can also return null, meaning that it has no type name. This would mean that there is only one acoustic model in the decoder.
 * @return the type name of this Feature, or null if it does nothave a type name.
 * @see #setType
 */
public String getType(){
  return type;
}
Program: 19863
Project: 19863
Buggy source:
/** 
 * Generate a hashcode for an object
 * @return the hashcode
 */
public int hashCode(){
  int result=17;
  for (int i=0; i < featureData.length; i++) {
    result=37 * result + Float.floatToIntBits(featureData[i]);
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Generate a hashcode for an object. Overrides Object.hashCode.
 * @return the hashcode
 */
public int hashCode(){
  int result=17;
  for (int i=0; i < featureData.length; i++) {
    result=37 * result + Float.floatToIntBits(featureData[i]);
  }
  return result;
}
Program: 19864
Project: 19864
Buggy source:
/** 
 * Determines if the given object is equal to this object
 * @param o the object to test
 * @return <code>true</code> if the object is equal to this
 */
public boolean equals(Object o){
  if (o == this) {
    return true;
  }
 else   if (o instanceof Feature) {
    Feature other=(Feature)o;
    return (featureData == other.featureData);
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Determines if the given object is equal to this object. Overrides Object.equals.
 * @param o the object to test
 * @return <code>true</code> if the object is equal to this
 */
public boolean equals(Object o){
  if (o == this) {
    return true;
  }
 else   if (o instanceof Feature) {
    Feature other=(Feature)o;
    return (featureData == other.featureData);
  }
 else {
    return false;
  }
}
Program: 19865
Project: 19865
Buggy source:
/** 
 * Sets the ID of this Feature.
 * @param id the ID
 */
public void setID(int id){
  this.ID=id;
}

Fixed version (ground truth):
/** 
 * Sets the ID of this Feature.
 * @param id the ID
 * @see #getID
 */
public void setID(int id){
  this.ID=id;
}
Program: 19866
Project: 19866
Buggy source:
/** 
 * Returns the ID of this Feature, telling you which Feature it is with respect to the utterance. Feature IDs start at 0.
 * @return the ID
 */
public int getID(){
  return ID;
}

Fixed version (ground truth):
/** 
 * Returns the ID of this Feature, telling you which Feature it is with respect to the utterance. Feature IDs start at 0.
 * @return the ID
 * @see #setID
 */
public int getID(){
  return ID;
}
Program: 19867
Project: 19867
Buggy source:
/** 
 * Sets the type name of this Feature. It should be the name of the acoustic model used. This is the only mutable field in this class. It can only be set once, subsequent calls to this method have no effect.
 * @param type the type name of this Feature
 */
public void setType(String type){
  if (this.type == null) {
    this.type=type;
  }
}

Fixed version (ground truth):
/** 
 * Sets the type name of this Feature. It should be the name of the acoustic model used. This is the only mutable field in this class. It can only be set once, subsequent calls to this method have no effect.
 * @param type the type name of this Feature
 * @see #getType
 */
public void setType(String type){
  if (this.type == null) {
    this.type=type;
  }
}
Program: 19868
Project: 19868
Buggy source:
/** 
 * Returns the array of Features
 * @return the array of Features
 */
public Feature[] getFeatures(){
  return features;
}

Fixed version (ground truth):
/** 
 * Returns the array of Features.
 * @return the array of Features
 */
public Feature[] getFeatures(){
  return features;
}
Program: 19869
Project: 19869
Buggy source:
/** 
 * Constructs a FeatureFrame with the given array of Features
 * @param features the Feature array
 */
public FeatureFrame(Feature[] features){
  this.features=features;
}

Fixed version (ground truth):
/** 
 * Constructs a FeatureFrame with the given array of Features.
 * @param features the Feature array
 */
public FeatureFrame(Feature[] features){
  this.features=features;
}
Program: 19870
Project: 19870
Buggy source:
/** 
 * Returns the next N FeatureFrames produced by this FeatureFrameSource.
 * @return the next N FeatureFrames, returns null if noFeatureFrame object is available
 * @throws java.io.IOException
 */
public FeatureFrame getFeatureFrame(int numberFrames) throws IOException ;

Fixed version (ground truth):
/** 
 * Returns the next N FeatureFrames produced by this FeatureFrameSource.
 * @param numberFrames  the number of features to return
 * @return the next N FeatureFrames, returns null if noFeatureFrame object is available
 * @throws java.io.IOException
 */
public FeatureFrame getFeatureFrame(int numberFrames) throws IOException ;
Program: 19871
Project: 19871
Buggy source:
/** 
 * Initializes this Filterbank.
 * @param name the name of this Filterbank
 * @param context the context
 * @param props the SphinxProperties to read properties from
 * @param predecessor the SpectrumSource from which Spectra to filterare obtained
 */
public void initialize(String name,String context,SphinxProperties props,SpectrumSource predecessor) throws IOException ;

Fixed version (ground truth):
/** 
 * Initializes this Filterbank.
 * @param name the name of this Filterbank
 * @param context the context
 * @param props the SphinxProperties to read properties from
 * @param predecessor the SpectrumSource from which Spectra to filterare obtained
 * @throws IOException if an I/O error occurs
 */
public void initialize(String name,String context,SphinxProperties props,SpectrumSource predecessor) throws IOException ;
Program: 19872
Project: 19872
Buggy source:
/** 
 * Returns the next N feature (of the given acoustic model)  produced by this FrontEnd, in a FeatureFrame object. The number of Features return maybe less than N, in which case the last Feature will contain a Signal.UTTERANCE_END signal.
 * @param numberFeatures the number of FeatureFrames to return
 * @return N number of FeatureFrames, or nullif no more FeatureFrames available
 * @see FeatureFrame
 * @throws java.io.IOException if an I/O error occurred
 */
public FeatureFrame getFeatureFrame(int numberFeatures,String acousticModelName) throws IOException ;

Fixed version (ground truth):
/** 
 * Returns the next N feature (of the given acoustic model)  produced by this FrontEnd, in a FeatureFrame object. The number of Features return maybe less than N, in which case the last Feature will contain a Signal.UTTERANCE_END signal.
 * @param numberFeatures the number of FeatureFrames to return
 * @param acousticModelName the name of the acoustic model for whichfeatures are returned
 * @return N number of FeatureFrames, or nullif no more FeatureFrames available
 * @see FeatureFrame
 * @throws java.io.IOException if an I/O error occurred
 */
public FeatureFrame getFeatureFrame(int numberFeatures,String acousticModelName) throws IOException ;
Program: 19873
Project: 19873
Buggy source:
/** 
 * Initializes this FrontEnd.
 * @param name the name of this FrontEnd
 * @param context the context of this FrontEnd
 * @param dataSource the place to pull data from, or null if noDataSource yet, in which case it should be set later on by the <code>setDataSource()</code> method
 */
public void initialize(String name,String context,DataSource dataSource) throws IOException ;

Fixed version (ground truth):
/** 
 * Initializes this FrontEnd.
 * @param name the name of this FrontEnd
 * @param context the context of this FrontEnd
 * @param dataSource the place to pull data from, or null if noDataSource yet, in which case it should be set later on by the <code>setDataSource()</code> method
 * @throws IOException if an I/O error occurs
 */
public void initialize(String name,String context,DataSource dataSource) throws IOException ;
Program: 19874
Project: 19874
Buggy source:
/** 
 * Returns the properties of the relevant acoustic model.
 * @return the properties of the relevant acoustic model
 * @throws java.io.IOException if an I/O error occurred
 */
public SphinxProperties getAcousticProperties(String context,String amName) throws IOException {
  AcousticModel am;
  if (amName != null) {
    am=AcousticModel.getAcousticModel(amName,context);
  }
 else {
    am=AcousticModel.getAcousticModel(context);
  }
  if (am != null) {
    return am.getProperties();
  }
 else {
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Returns the properties of the relevant acoustic model.
 * @param context the context of the acoustic properties
 * @param amName  the acoustic model name of the returned acoustic properties
 * @return the properties of the relevant acoustic model
 * @throws java.io.IOException if an I/O error occurred
 */
public SphinxProperties getAcousticProperties(String context,String amName) throws IOException {
  AcousticModel am;
  if (amName != null) {
    am=AcousticModel.getAcousticModel(amName,context);
  }
 else {
    am=AcousticModel.getAcousticModel(context);
  }
  if (am != null) {
    return am.getProperties();
  }
 else {
    return null;
  }
}
Program: 19875
Project: 19875
Buggy source:
/** 
 * Constructs a SimpleFrontEnd with the given name, context, acoustic  model name, and DataSource.
 * @param name the name of this SimpleFrontEnd
 * @param context the context of interest
 * @param amName the name of the acoustic model
 * @param dataSource the source of data
 */
public void initialize(String name,String context,String amName,DataSource dataSource) throws IOException {
  SphinxProperties props=SphinxProperties.getSphinxProperties(context);
  boolean useAcousticModelProperties=props.getBoolean(FrontEnd.PROP_USE_ACOUSTIC_MODEL_PROPERTIES,FrontEnd.PROP_USE_ACOUSTIC_MODEL_PROPERTIES_DEFAULT);
  if (useAcousticModelProperties) {
    props=(PropertiesResolver.resolve(props,getAcousticProperties(context,amName),context + "String_Node_Str" + name));
  }
  super.initialize(name,context,props,amName,dataSource);
}

Fixed version (ground truth):
/** 
 * Constructs a SimpleFrontEnd with the given name, context, acoustic  model name, and DataSource.
 * @param name the name of this SimpleFrontEnd
 * @param context the context of interest
 * @param amName the name of the acoustic model
 * @param dataSource the source of data
 * @throws IOException if an I/O error occurs
 */
public void initialize(String name,String context,String amName,DataSource dataSource) throws IOException {
  SphinxProperties props=SphinxProperties.getSphinxProperties(context);
  boolean useAcousticModelProperties=props.getBoolean(FrontEnd.PROP_USE_ACOUSTIC_MODEL_PROPERTIES,FrontEnd.PROP_USE_ACOUSTIC_MODEL_PROPERTIES_DEFAULT);
  if (useAcousticModelProperties) {
    props=(PropertiesResolver.resolve(props,getAcousticProperties(context,amName),context + "String_Node_Str" + name));
  }
  super.initialize(name,context,props,amName,dataSource);
}
Program: 19876
Project: 19876
Buggy source:
/** 
 * Reads the next Spectrum object, which is an audio frame from which we'll compute the power spectrum. However, it can also be other Spectrum objects that contain a EndPointSignal.
 * @return the next available Spectrum object, returns null if noSpectrum object is available
 */
public Spectrum getSpectrum() throws IOException {
  Audio input=predecessor.getAudio();
  Spectrum output=null;
  getTimer().start();
  if (input != null) {
    if (input.hasContent()) {
      output=process(input);
    }
 else {
      output=new Spectrum(input.getSignal(),input.getCollectTime(),input.getFirstSampleNumber());
    }
  }
  getTimer().stop();
  return output;
}

Fixed version (ground truth):
/** 
 * Reads the next Spectrum object, which is an audio frame from which we'll compute the power spectrum. However, it can also be other Spectrum objects that contain a EndPointSignal.
 * @return the next available Spectrum object, returns null if noSpectrum object is available
 * @throws IOException if an I/O error occurs
 */
public Spectrum getSpectrum() throws IOException {
  Audio input=predecessor.getAudio();
  Spectrum output=null;
  getTimer().start();
  if (input != null) {
    if (input.hasContent()) {
      output=process(input);
    }
 else {
      output=new Spectrum(input.getSignal(),input.getCollectTime(),input.getFirstSampleNumber());
    }
  }
  getTimer().stop();
  return output;
}
Program: 19877
Project: 19877
Buggy source:
/** 
 * Returns the amount of time (in seconds) this Utterance lasts
 * @return how long is this utterance
 */
public float getAudioTime(){
  byte[] audio=getAudio();
  return ((float)audio.length) / ((float)sampleRate * (bitsPerSample / 8));
}

Fixed version (ground truth):
/** 
 * Returns the amount of time (in seconds) this Utterance lasts.
 * @return how long is this utterance
 */
public float getAudioTime(){
  byte[] audio=getAudio();
  return ((float)audio.length) / ((float)sampleRate * (bitsPerSample / 8));
}
Program: 19878
Project: 19878
Buggy source:
/** 
 * Returns the audio samples of the given series of features. The firstFeatureID must be less than or equal to the lastFeatureID, otherwise an <code>IllegalArgumentException</code> will be thrown.
 * @param firstFeatureID the ID of the first feature
 * @param lastFeatureID the ID of the last feature
 * @throws IllegalArgumentException if the firstFeatureID is greaterthan the lastFeatureID
 */
public byte[] getAudio(int firstFeatureID,int lastFeatureID) throws IllegalArgumentException {
  if (lastFeatureID < firstFeatureID) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (firstFeatureID < 0) {
    throw new IllegalArgumentException("String_Node_Str" + firstFeatureID);
  }
  if (lastFeatureID < 0) {
    throw new IllegalArgumentException("String_Node_Str" + lastFeatureID);
  }
  int numberBytes=windowSizeInBytes;
  int numberWindows=lastFeatureID - firstFeatureID;
  if (numberWindows > 0) {
    numberBytes+=(numberWindows * windowShiftInBytes);
  }
  byte[] audio=new byte[numberBytes];
  flatten();
  int startByte=firstFeatureID * windowShiftInBytes;
  System.arraycopy(flattenedAudio,startByte,audio,0,audio.length);
  return audio;
}

Fixed version (ground truth):
/** 
 * Returns the audio samples of the given series of features. The firstFeatureID must be less than or equal to the lastFeatureID, otherwise an <code>IllegalArgumentException</code> will be thrown.
 * @param firstFeatureID the ID of the first feature
 * @param lastFeatureID the ID of the last feature
 * @return the audio samples of the feature with the given ID
 * @throws IllegalArgumentException if the firstFeatureID is greaterthan the lastFeatureID
 */
public byte[] getAudio(int firstFeatureID,int lastFeatureID) throws IllegalArgumentException {
  if (lastFeatureID < firstFeatureID) {
    throw new IllegalArgumentException("String_Node_Str");
  }
  if (firstFeatureID < 0) {
    throw new IllegalArgumentException("String_Node_Str" + firstFeatureID);
  }
  if (lastFeatureID < 0) {
    throw new IllegalArgumentException("String_Node_Str" + lastFeatureID);
  }
  int numberBytes=windowSizeInBytes;
  int numberWindows=lastFeatureID - firstFeatureID;
  if (numberWindows > 0) {
    numberBytes+=(numberWindows * windowShiftInBytes);
  }
  byte[] audio=new byte[numberBytes];
  flatten();
  int startByte=firstFeatureID * windowShiftInBytes;
  System.arraycopy(flattenedAudio,startByte,audio,0,audio.length);
  return audio;
}
Program: 19879
Project: 19879
Buggy source:
/** 
 * Constructs a default Windower with the specified context.
 * @param context the context of the SphinxProperties this Windower uses
 * @throws IOException if an I/O error occurs
 */
public Windower(String name,String context,SphinxProperties props,AudioSource predecessor) throws IOException {
  super(name,context,props);
  setProperties();
  this.predecessor=predecessor;
  createWindow();
  outputQueue=new LinkedList();
  overflowBuffer=new DoubleBuffer(windowSize);
}

Fixed version (ground truth):
/** 
 * Constructs a default Windower with the specified context.
 * @param name         the name of this Windower
 * @param context      the context of this Windower
 * @param props        the properties of this Windower
 * @param predecessor  the predecessor AudioSource
 * @param context the context of the SphinxProperties this Windower uses
 * @throws IOException if an I/O error occurs
 */
public Windower(String name,String context,SphinxProperties props,AudioSource predecessor) throws IOException {
  super(name,context,props);
  setProperties();
  this.predecessor=predecessor;
  createWindow();
  outputQueue=new LinkedList();
  overflowBuffer=new DoubleBuffer(windowSize);
}
Program: 19880
Project: 19880
Buggy source:
/** 
 * Constructs an AudioFilter with the given name, context, and AudioSource predecessor.
 * @param name the name of this AudioFilter
 * @param context the context of the SphinxProperties thisAudioFilter uses
 * @param props the SphinxProperties to read properties from
 * @param predecessor the AudioSource where this AudioFiltergets Audio from
 */
public AudioFilter(String name,String context,SphinxProperties props,AudioSource predecessor) throws IOException {
  super(name,context,props);
  this.mergeSpeechSegments=getSphinxProperties().getBoolean(PROP_MERGE_SPEECH_SEGMENTS,PROP_MERGE_SPEECH_SEGMENTS_DEFAULT);
  this.discardMode=true;
  this.inSpeech=false;
  this.predecessor=predecessor;
  this.inputBuffer=new LinkedList();
  this.outputQueue=new LinkedList();
}

Fixed version (ground truth):
/** 
 * Constructs an AudioFilter with the given name, context, and AudioSource predecessor.
 * @param name the name of this AudioFilter
 * @param context the context of the SphinxProperties thisAudioFilter uses
 * @param props the SphinxProperties to read properties from
 * @param predecessor the AudioSource where this AudioFiltergets Audio from
 * @throws IOException if an I/O error occurs
 */
public AudioFilter(String name,String context,SphinxProperties props,AudioSource predecessor) throws IOException {
  super(name,context,props);
  this.mergeSpeechSegments=getSphinxProperties().getBoolean(PROP_MERGE_SPEECH_SEGMENTS,PROP_MERGE_SPEECH_SEGMENTS_DEFAULT);
  this.discardMode=true;
  this.inSpeech=false;
  this.predecessor=predecessor;
  this.inputBuffer=new LinkedList();
  this.outputQueue=new LinkedList();
}
Program: 19881
Project: 19881
Buggy source:
/** 
 * Constructs an NonSpeechFilter with the given name, context, and CepstrumSource predecessor.
 * @param name the name of this NonSpeechFilter
 * @param context the context of the SphinxProperties thisNonSpeechFilter uses
 * @param props the SphinxProperties to read properties from
 * @param predecessor the CepstrumSource where this NonSpeechFiltergets Cepstrum from
 */
public NonSpeechFilter(String name,String context,SphinxProperties props,CepstrumSource predecessor) throws IOException {
  super(name,context,props);
  this.mergeSpeechSegments=getSphinxProperties().getBoolean(PROP_MERGE_SPEECH_SEGMENTS,PROP_MERGE_SPEECH_SEGMENTS_DEFAULT);
  this.discardMode=true;
  this.inSpeech=false;
  this.predecessor=predecessor;
  this.inputBuffer=new LinkedList();
}

Fixed version (ground truth):
/** 
 * Constructs an NonSpeechFilter with the given name, context, and CepstrumSource predecessor.
 * @param name the name of this NonSpeechFilter
 * @param context the context of the SphinxProperties thisNonSpeechFilter uses
 * @param props the SphinxProperties to read properties from
 * @param predecessor the CepstrumSource where this NonSpeechFiltergets Cepstrum from
 * @throws IOException if an I/O error occurs
 */
public NonSpeechFilter(String name,String context,SphinxProperties props,CepstrumSource predecessor) throws IOException {
  super(name,context,props);
  this.mergeSpeechSegments=getSphinxProperties().getBoolean(PROP_MERGE_SPEECH_SEGMENTS,PROP_MERGE_SPEECH_SEGMENTS_DEFAULT);
  this.discardMode=true;
  this.inSpeech=false;
  this.predecessor=predecessor;
  this.inputBuffer=new LinkedList();
}
Program: 19882
Project: 19882
Buggy source:
/** 
 * Common intialization code
 * @param props the sphinx properties
 * @param batchFile the batch file
 */
private void init(SphinxProperties props) throws IOException {
  referenceFile=props.getString(PROP_REFERENCE_TRANSCRIPT,PROP_REFERENCE_TRANSCRIPT_DEFAULT);
  hypothesisFile=props.getString(PROP_HYPOTHESIS_TRANSCRIPT,PROP_HYPOTHESIS_TRANSCRIPT_DEFAULT);
  hypothesisTranscript=new FileWriter(hypothesisFile);
  sampleRate=props.getInt(FrontEnd.PROP_SAMPLE_RATE,FrontEnd.PROP_SAMPLE_RATE_DEFAULT);
  alignInterval=props.getInt(PROP_ALIGN_INTERVAL,PROP_ALIGN_INTERVAL_DEFAULT);
  decoder=new Decoder(context,getDataSource());
  maxResponseTime=Long.MIN_VALUE;
  minResponseTime=Long.MAX_VALUE;
  Recognizer recognizer=decoder.getRecognizer();
  recognizer.addSignalFeatureListener(new FeatureListener(){
    public void featureOccurred(    Feature feature){
      if (feature.getSignal() == Signal.UTTERANCE_START) {
        long responseTime=(System.currentTimeMillis() - feature.getCollectTime());
        totalResponseTime+=responseTime;
        if (responseTime > maxResponseTime) {
          maxResponseTime=responseTime;
        }
        if (responseTime < minResponseTime) {
          minResponseTime=responseTime;
        }
        numUtteranceStart++;
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Common intialization code
 * @param props the sphinx properties
 */
private void init(SphinxProperties props) throws IOException {
  referenceFile=props.getString(PROP_REFERENCE_TRANSCRIPT,PROP_REFERENCE_TRANSCRIPT_DEFAULT);
  hypothesisFile=props.getString(PROP_HYPOTHESIS_TRANSCRIPT,PROP_HYPOTHESIS_TRANSCRIPT_DEFAULT);
  hypothesisTranscript=new FileWriter(hypothesisFile);
  sampleRate=props.getInt(FrontEnd.PROP_SAMPLE_RATE,FrontEnd.PROP_SAMPLE_RATE_DEFAULT);
  alignInterval=props.getInt(PROP_ALIGN_INTERVAL,PROP_ALIGN_INTERVAL_DEFAULT);
  decoder=new Decoder(context,getDataSource());
  maxResponseTime=Long.MIN_VALUE;
  minResponseTime=Long.MAX_VALUE;
  Recognizer recognizer=decoder.getRecognizer();
  recognizer.addSignalFeatureListener(new FeatureListener(){
    public void featureOccurred(    Feature feature){
      if (feature.getSignal() == Signal.UTTERANCE_START) {
        long responseTime=(System.currentTimeMillis() - feature.getCollectTime());
        totalResponseTime+=responseTime;
        if (responseTime > maxResponseTime) {
          maxResponseTime=responseTime;
        }
        if (responseTime < minResponseTime) {
          minResponseTime=responseTime;
        }
        numUtteranceStart++;
      }
    }
  }
);
}
Program: 19883
Project: 19883
Buggy source:
/** 
 * Align the list of results with reference text. This method figures out how many words and sentences match, and the different types of errors.
 * @param hypothesisList the list of hypotheses
 * @param referenceLis the list of references
 */
private void alignResults(List hypothesisList,List referenceList){
  System.out.println();
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str" + hypothesisList.size() + "String_Node_Str"+ referenceList.size());
  String hypothesis=listToString(hypothesisList);
  String reference=listToString(referenceList);
  saveAlignedText(hypothesis,reference);
  getAlignTimer().start();
  NISTAlign aligner=decoder.getNISTAlign();
  aligner.align(reference,hypothesis);
  getAlignTimer().stop();
  System.out.println("String_Node_Str");
  System.out.println();
}

Fixed version (ground truth):
/** 
 * Align the list of results with reference text. This method figures out how many words and sentences match, and the different types of errors.
 * @param hypothesisList the list of hypotheses
 * @param referenceList the list of references
 */
private void alignResults(List hypothesisList,List referenceList){
  System.out.println();
  System.out.println("String_Node_Str");
  System.out.println("String_Node_Str" + hypothesisList.size() + "String_Node_Str"+ referenceList.size());
  String hypothesis=listToString(hypothesisList);
  String reference=listToString(referenceList);
  saveAlignedText(hypothesis,reference);
  getAlignTimer().start();
  NISTAlign aligner=decoder.getNISTAlign();
  aligner.align(reference,hypothesis);
  getAlignTimer().stop();
  System.out.println("String_Node_Str");
  System.out.println();
}
Program: 19884
Project: 19884
Buggy source:
/** 
 * Creates the HMMTree
 * @param pool the pool of HMMs and units
 * @param dictionary the dictionary containing the pronunciations
 * @param words the set of words to add to the lex tree
 * @param addFillerWords if <code>false</code> add filler words
 */
HMMTree(HMMPool pool,Dictionary dictionary,LanguageModel lm,boolean addFillerWords,float languageWeight){
  this.hmmPool=pool;
  this.dictionary=dictionary;
  this.lm=lm;
  this.endNodeMap=new HashMap();
  this.addFillerWords=addFillerWords;
  this.languageWeight=languageWeight;
  Timer.start("String_Node_Str");
  compile();
  Timer.stop("String_Node_Str");
  Node.dumpNodeInfo();
  dumpTree();
}

Fixed version (ground truth):
/** 
 * Creates the HMMTree
 * @param pool the pool of HMMs and units
 * @param dictionary the dictionary containing the pronunciations
 * @param lm the source of the set of words to add to the lex tree
 * @param addFillerWords if <code>false</code> add filler words
 * @param languageWeight the languageWeight
 */
HMMTree(HMMPool pool,Dictionary dictionary,LanguageModel lm,boolean addFillerWords,float languageWeight){
  this.hmmPool=pool;
  this.dictionary=dictionary;
  this.lm=lm;
  this.endNodeMap=new HashMap();
  this.addFillerWords=addFillerWords;
  this.languageWeight=languageWeight;
  Timer.start("String_Node_Str");
  compile();
  Timer.stop("String_Node_Str");
  Node.dumpNodeInfo();
  dumpTree();
}
Program: 19885
Project: 19885
Buggy source:
/** 
 * Dumps the tree
 * @param level the level of the dump
 * @param node the root of the tree to dump
 * @param map map of visited nodes
 */
private void dumpTree(int level,Node node,Map dupNode){
  if (dupNode.get(node) == null) {
    dupNode.put(node,node);
    System.out.println(Utilities.pad(level * 1) + node);
    if (!(node instanceof WordNode)) {
      Collection next=node.getSuccessors();
      for (Iterator i=next.iterator(); i.hasNext(); ) {
        Node nextNode=(Node)i.next();
        dumpTree(level + 1,nextNode,dupNode);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Dumps the tree
 * @param level the level of the dump
 * @param node the root of the tree to dump
 * @param dupNode map of visited nodes
 */
private void dumpTree(int level,Node node,Map dupNode){
  if (dupNode.get(node) == null) {
    dupNode.put(node,node);
    System.out.println(Utilities.pad(level * 1) + node);
    if (!(node instanceof WordNode)) {
      Collection next=node.getSuccessors();
      for (Iterator i=next.iterator(); i.hasNext(); ) {
        Node nextNode=(Node)i.next();
        dumpTree(level + 1,nextNode,dupNode);
      }
    }
  }
}
Program: 19886
Project: 19886
Buggy source:
/** 
 * Creates the node, wrapping the given hmm
 * @param hmm the hmm to hold
 */
EndNode(Unit baseUnit,Unit lc,float probablilty){
  super(probablilty);
  this.baseUnit=baseUnit;
  this.leftContext=lc;
  key=new Integer(baseUnit.getBaseID() * 121 + leftContext.getBaseID());
}

Fixed version (ground truth):
/** 
 * Creates the node, wrapping the given hmm
 * @param baseUnit  the base unit for this node
 * @param lc the left context
 * @param probablilty  the probability for the transition to thisnode
 */
EndNode(Unit baseUnit,Unit lc,float probablilty){
  super(probablilty);
  this.baseUnit=baseUnit;
  this.leftContext=lc;
  key=new Integer(baseUnit.getBaseID() * 121 + leftContext.getBaseID());
}
Program: 19887
Project: 19887
Buggy source:
/** 
 * Creates a LexTreeState.
 * @param leftID the id of the unit forming the left context(or 0 if  there is no left context) of a triphone context
 * @param central the unit forming the central portion of atriphone context
 * @param right the unit forming the right portion of atriphone context
 * @param wordSequence the history of words up until this point
 * @param logProbability the probability (in log math domain)of entering this state.  This is a combination of insertion and language probability.
 */
LexTreeState(Node node,WordSequence wordSequence){
  this.node=node;
  this.wordSequence=wordSequence;
}

Fixed version (ground truth):
/** 
 * Creates a LexTreeState.
 * @param node the node associated with this state
 * @param wordSequence the history of words up until this point
 */
LexTreeState(Node node,WordSequence wordSequence){
  this.node=node;
  this.wordSequence=wordSequence;
}
Program: 19888
Project: 19888
Buggy source:
/** 
 * Constructs a LexTreeWordState
 * @param wordNode the word node
 * @param wordSequence the sequence of wordstriphone context
 * @param logProbability the probability of this word occuring
 */
LexTreeWordState(WordNode wordNode,HMMNode lastNode,WordSequence wordSequence,float logProability){
  super(wordNode,wordSequence);
  this.lastNode=lastNode;
  this.logLanguageProbability=logProability;
}

Fixed version (ground truth):
/** 
 * Constructs a LexTreeWordState
 * @param wordNode the word node
 * @param wordSequence the sequence of wordstriphone context
 * @param logProbability the probability of this word occuring
 */
LexTreeWordState(WordNode wordNode,HMMNode lastNode,WordSequence wordSequence,float logProbability){
  super(wordNode,wordSequence);
  this.lastNode=lastNode;
  this.logLanguageProbability=logProbability;
}
Program: 19889
Project: 19889
Buggy source:
/** 
 * Constructs a LexTreeWordState
 * @param wordNode the word node
 * @param wordSequence the sequence of wordstriphone context
 * @param logProbability the probability of this word occuring
 */
LexTreeEndWordState(WordNode wordNode,HMMNode lastNode,WordSequence wordSequence,float logProability){
  super(wordNode,lastNode,wordSequence,logProability);
}

Fixed version (ground truth):
/** 
 * Constructs a LexTreeWordState
 * @param wordNode the word node
 * @param lastNode the previous word node
 * @param wordSequence the sequence of wordstriphone context
 * @param logProbability the probability of this word occuring
 */
LexTreeEndWordState(WordNode wordNode,HMMNode lastNode,WordSequence wordSequence,float logProbability){
  super(wordNode,lastNode,wordSequence,logProbability);
}
Program: 19890
Project: 19890
Buggy source:
/** 
 * Creates a unit search state for the given unit node
 * @param hmmNode the unit node
 * @return the search state
 */
SearchStateArc createEndUnitArc(EndNode endNode,float lastProb){
  float languageProbability=getUnigramSmear(endNode) - lastProb;
  float insertionProbability=calculateInsertionProbability(endNode);
  return new LexTreeEndUnitState(endNode,getWordHistory(),languageProbability,insertionProbability);
}

Fixed version (ground truth):
/** 
 * Creates a unit search state for the given unit node
 * @param endNode the unit node
 * @param lastProb the probability of the previus node
 * @return the search state
 */
SearchStateArc createEndUnitArc(EndNode endNode,float lastProb){
  float languageProbability=getUnigramSmear(endNode) - lastProb;
  float insertionProbability=calculateInsertionProbability(endNode);
  return new LexTreeEndUnitState(endNode,getWordHistory(),languageProbability,insertionProbability);
}
Program: 19891
Project: 19891
Buggy source:
/** 
 * Determines the insertion probability for the given unit lex node
 * @param hmmNode the unit lex node
 * @return the insertion probability
 */
private float calculateInsertionProbability(UnitNode unitNode){
  float logInsertionProbability=logUnitInsertionProbability;
  if (unitNode.getBaseUnit().isSilence()) {
    logInsertionProbability=logSilenceInsertionProbability;
  }
 else   if (unitNode.getBaseUnit().isFiller()) {
    logInsertionProbability=logFillerInsertionProbability;
  }
 else   if (unitNode.getPosition().isWordBeginning()) {
    logInsertionProbability+=logWordInsertionProbability;
  }
  return logInsertionProbability;
}

Fixed version (ground truth):
/** 
 * Determines the insertion probability for the given unit lex node
 * @param unitNode the unit lex node
 * @return the insertion probability
 */
private float calculateInsertionProbability(UnitNode unitNode){
  float logInsertionProbability=logUnitInsertionProbability;
  if (unitNode.getBaseUnit().isSilence()) {
    logInsertionProbability=logSilenceInsertionProbability;
  }
 else   if (unitNode.getBaseUnit().isFiller()) {
    logInsertionProbability=logFillerInsertionProbability;
  }
 else   if (unitNode.getPosition().isWordBeginning()) {
    logInsertionProbability+=logWordInsertionProbability;
  }
  return logInsertionProbability;
}
Program: 19892
Project: 19892
Buggy source:
/** 
 * Creates the HMMTree
 * @param pool the pool of HMMs and units
 * @param dictionary the dictionary containing the pronunciations
 * @param words the set of words to add to the lex tree
 * @param addFillerWords if <code>false</code> add filler words
 */
HMMTree(HMMPool pool,Dictionary dictionary,LanguageModel lm,boolean addFillerWords,float languageWeight){
  this.hmmPool=pool;
  this.dictionary=dictionary;
  this.lm=lm;
  this.addFillerWords=addFillerWords;
  this.languageWeight=languageWeight;
  Timer.start("String_Node_Str");
  compile();
  Timer.stop("String_Node_Str");
  Node.dumpNodeInfo();
  dumpTree();
}

Fixed version (ground truth):
/** 
 * Creates the HMMTree
 * @param pool the pool of HMMs and units
 * @param dictionary the dictionary containing the pronunciations
 * @param lm the source for the set of words
 * @param addFillerWords if <code>false</code> add filler words
 * @param languageWeight the language weight
 */
HMMTree(HMMPool pool,Dictionary dictionary,LanguageModel lm,boolean addFillerWords,float languageWeight){
  this.hmmPool=pool;
  this.dictionary=dictionary;
  this.lm=lm;
  this.addFillerWords=addFillerWords;
  this.languageWeight=languageWeight;
  Timer.start("String_Node_Str");
  compile();
  Timer.stop("String_Node_Str");
  Node.dumpNodeInfo();
  dumpTree();
}
Program: 19893
Project: 19893
Buggy source:
/** 
 * Dumps the tree
 * @param level the level of the dump
 * @param node the root of the tree to dump
 * @param map map of visited nodes
 */
private void dumpTree(int level,Node node,Map dupNode){
  if (dupNode.get(node) == null) {
    dupNode.put(node,node);
    System.out.println(Utilities.pad(level * 1) + node);
    if (!(node instanceof WordNode)) {
      Collection next=node.getSuccessors();
      for (Iterator i=next.iterator(); i.hasNext(); ) {
        Node nextNode=(Node)i.next();
        dumpTree(level + 1,nextNode,dupNode);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Dumps the tree
 * @param level the level of the dump
 * @param node the root of the tree to dump
 * @param dupNode map of visited nodes
 */
private void dumpTree(int level,Node node,Map dupNode){
  if (dupNode.get(node) == null) {
    dupNode.put(node,node);
    System.out.println(Utilities.pad(level * 1) + node);
    if (!(node instanceof WordNode)) {
      Collection next=node.getSuccessors();
      for (Iterator i=next.iterator(); i.hasNext(); ) {
        Node nextNode=(Node)i.next();
        dumpTree(level + 1,nextNode,dupNode);
      }
    }
  }
}
Program: 19894
Project: 19894
Buggy source:
/** 
 * Creates a LexTreeState.
 * @param leftID the id of the unit forming the left context(or 0 if  there is no left context) of a triphone context
 * @param central the unit forming the central portion of atriphone context
 * @param right the unit forming the right portion of atriphone context
 * @param wordSequence the history of words up until this point
 * @param logProbability the probability (in log math domain)of entering this state.  This is a combination of insertion and language probability.
 */
LexTreeState(Node node,WordSequence wordSequence){
  this.node=node;
  this.wordSequence=wordSequence;
}

Fixed version (ground truth):
/** 
 * Creates a LexTreeState.
 * @param node the associated node
 * @param wordSequence the history of words up until this point
 */
LexTreeState(Node node,WordSequence wordSequence){
  this.node=node;
  this.wordSequence=wordSequence;
}
Program: 19895
Project: 19895
Buggy source:
/** 
 * Constructs a LexTreeWordState
 * @param wordNode the word node
 * @param wordSequence the sequence of wordstriphone context
 * @param logProbability the probability of this word occuring
 */
LexTreeWordState(WordNode wordNode,HMMNode lastNode,WordSequence wordSequence,float logProability){
  super(wordNode,wordSequence);
  this.lastNode=lastNode;
  this.logLanguageProbability=logProability;
}

Fixed version (ground truth):
/** 
 * Constructs a LexTreeWordState
 * @param wordNode the word node
 * @param lastNode the previous node
 * @param wordSequence the sequence of wordstriphone context
 * @param logProbability the probability of this word occuring
 */
LexTreeWordState(WordNode wordNode,HMMNode lastNode,WordSequence wordSequence,float logProbability){
  super(wordNode,wordSequence);
  this.lastNode=lastNode;
  this.logLanguageProbability=logProbability;
}
Program: 19896
Project: 19896
Buggy source:
/** 
 * Creates a LexTreeState.
 * @param leftID the id of the unit forming the left context(or 0 if  there is no left context) of a triphone context
 * @param central the unit forming the central portion of atriphone context
 * @param right the unit forming the right portion of atriphone context
 * @param wordSequence the history of words up until this point
 * @param logProbability the probability (in log math domain)of entering this state.  This is a combination of insertion and language probability.
 */
LexTreeState(int leftID,LexTree.UnitLexNode central,LexTree.UnitLexNode right,WordSequence wordSequence){
  if (leftID == 0) {
    leftID=silenceID;
  }
  if (central != null && central.getID() == silenceID) {
    leftID=silenceID;
    right=null;
  }
  this.leftID=leftID;
  this.central=central;
  this.right=right;
  this.wordSequence=wordSequence;
}

Fixed version (ground truth):
/** 
 * Creates a LexTreeState.
 * @param leftID the id of the unit forming the left context(or 0 if  there is no left context) of a triphone context
 * @param central the unit forming the central portion of atriphone context
 * @param right the unit forming the right portion of atriphone context
 * @param wordSequence the history of words up until this point
 */
LexTreeState(int leftID,LexTree.UnitLexNode central,LexTree.UnitLexNode right,WordSequence wordSequence){
  if (leftID == 0) {
    leftID=silenceID;
  }
  if (central != null && central.getID() == silenceID) {
    leftID=silenceID;
    right=null;
  }
  this.leftID=leftID;
  this.central=central;
  this.right=right;
  this.wordSequence=wordSequence;
}
Program: 19897
Project: 19897
Buggy source:
private SearchStateArc getEndWord(){
  if (endWord == null) {
    endWord=new LexTreeEndWordState();
  }
  return endWord;
}

Fixed version (ground truth):
/** 
 * returns the sole end word. The probability of transitioning to this  word is fixed (which may be a bug).
 * @return the end word.
 */
private SearchStateArc getEndWord(){
  if (endWord == null) {
    endWord=new LexTreeEndWordState();
  }
  return endWord;
}