nus-yam/ex-repair huggingface dataset:
Program: 19579
Project: 19579
Buggy source:
/** 
 * Returns a the next <code>DataProcessor</code> of type <code>predecClass</code> which preceeds <code>dp</code>
 * @param dp
 * @param predecClass
 */
public static <T extends DataProcessor>T getFrontEndProcessor(DataProcessor dp,Class<T> predecClass){
  while (!predecClass.isInstance(dp)) {
    if (dp instanceof FrontEnd)     dp=((FrontEnd)dp).getLastDataProcessor();
 else     dp=dp.getPredecessor();
    if (dp == null)     return null;
  }
  return (T)dp;
}

Fixed version (ground truth):
/** 
 * Returns a the next <code>DataProcessor</code> of type <code>predecClass</code> which preceeds <code>dp</code>
 * @param dp
 * @param predecClass
 */
public static <T extends DataProcessor>T getFrontEndProcessor(DataProcessor dp,Class<T> predecClass){
  while (!predecClass.isInstance(dp)) {
    if (dp instanceof FrontEnd)     dp=((FrontEnd)dp).getLastDataProcessor();
 else     dp=dp.getPredecessor();
    if (dp == null)     return null;
  }
  return predecClass.cast(dp);
}
Program: 19580
Project: 19580
Buggy source:
@Override public void allocate() throws IOException {
  if (!allocated) {
    dictionary=new HashMap<String,Object>();
    Timer loadTimer=TimerPool.getTimer(this,"String_Node_Str");
    fillerWords=new HashSet<String>();
    loadTimer.start();
    logger.info("String_Node_Str" + wordDictionaryFile);
    loadDictionary(wordDictionaryFile.openStream(),false);
    loadCustomDictionaries(addendaUrlList);
    logger.info("String_Node_Str" + fillerDictionaryFile);
    loadDictionary(fillerDictionaryFile.openStream(),true);
    loadTimer.stop();
  }
}

Fixed version (ground truth):
@Override public void allocate() throws IOException {
  if (!allocated) {
    dictionary=new HashMap<String,String>();
    Timer loadTimer=TimerPool.getTimer(this,"String_Node_Str");
    fillerWords=new HashSet<String>();
    loadTimer.start();
    logger.info("String_Node_Str" + wordDictionaryFile);
    loadDictionary(wordDictionaryFile.openStream(),false);
    loadCustomDictionaries(addendaUrlList);
    logger.info("String_Node_Str" + fillerDictionaryFile);
    loadDictionary(fillerDictionaryFile.openStream(),true);
    loadTimer.stop();
  }
}
Program: 19581
Project: 19581
Buggy source:
/** 
 * Returns a string representation of this FastDictionary in alphabetical order.
 * @return a string representation of this FastDictionary
 */
@Override public String toString(){
  SortedMap<String,Object> sorted=new TreeMap<String,Object>(dictionary);
  StringBuilder result=new StringBuilder();
  for (  Map.Entry<String,Object> entry : sorted.entrySet()) {
    result.append(entry.getKey()).append('\n');
    for (    Pronunciation pronunciation : (List<Pronunciation>)entry.getValue()) {
      result.append("String_Node_Str").append(pronunciation).append('\n');
    }
  }
  return result.toString();
}

Fixed version (ground truth):
/** 
 * Returns a string representation of this FastDictionary in alphabetical order.
 * @return a string representation of this FastDictionary
 */
@Override public String toString(){
  SortedMap<String,String> sorted=new TreeMap<String,String>(dictionary);
  StringBuilder result=new StringBuilder();
  for (  Map.Entry<String,String> entry : sorted.entrySet()) {
    result.append(entry.getKey());
    result.append("String_Node_Str").append(entry.getValue()).append('\n');
  }
  return result.toString();
}
Program: 19582
Project: 19582
Buggy source:
/** 
 * Create a Word object with the given spelling and pronunciations, and insert it into the dictionary.
 * @param text          the spelling of the word
 * @param pronunciation the pronunciation of the word
 * @param isFiller      if <code>true</code> this is a filler word
 * @return the word
 */
private Word createWord(String text,Pronunciation[] pronunciation,boolean isFiller){
  Word word=new Word(text,pronunciation,isFiller);
  dictionary.put(text,word);
  return word;
}

Fixed version (ground truth):
/** 
 * Create a Word object with the given spelling and pronunciations, and insert it into the dictionary.
 * @param text          the spelling of the word
 * @param pronunciation the pronunciation of the word
 * @param isFiller      if <code>true</code> this is a filler word
 * @return the word
 */
private Word createWord(String text,Pronunciation[] pronunciation,boolean isFiller){
  Word word=new Word(text,pronunciation,isFiller);
  dictionary.put(text,word.toString());
  return word;
}
Program: 19584
Project: 19584
Buggy source:
@Override public void newProperties(PropertySheet ps) throws PropertyException {
  super.newProperties(ps);
  showFullPath=ps.getBoolean(PROP_SHOW_FULL_PATH);
}

Fixed version (ground truth):
@Override public void newProperties(PropertySheet ps) throws PropertyException {
  super.newProperties(ps);
  showFullPath=ps.getBoolean(PROP_SHOW_FULL_PATH);
  alignSausage=ps.getBoolean(ALIGN_SAUSAGE);
}
Program: 19585
Project: 19585
Buggy source:
@Override public void newResult(Result result){
  String ref=result.getReferenceText();
  if (result.isFinal() && ref != null) {
    String hyp=result.getBestResultNoFiller();
    getAligner().align(ref,hyp);
    showFullPath(result);
    showDetails(result.toString());
  }
}

Fixed version (ground truth):
@Override public void newResult(Result result){
  String ref=result.getReferenceText();
  if (result.isFinal() && ref != null) {
    if (!alignSausage) {
      String hyp=result.getBestResultNoFiller();
      getAligner().align(ref,hyp);
      showFullPath(result);
      showDetails(result.toString());
    }
 else {
      Lattice lattice=new Lattice(result);
      LatticeOptimizer optimizer=new LatticeOptimizer(lattice);
      optimizer.optimize();
      SausageMaker sausageMaker=new SausageMaker(lattice);
      Sausage sausage=sausageMaker.makeSausage();
      sausage.removeFillers();
      getAligner().alignSausage(ref,sausage);
      showFullPath(result);
      showDetails(result.toString());
    }
  }
}
Program: 19586
Project: 19586
Buggy source:
/** 
 * Validates checksum in the stream
 * @param dis input stream
 * @param doCheckSum validates
 * @throws IOException on error
 */
private void validateChecksum(DataInputStream dis,boolean doCheckSum) throws IOException {
  int oldCheckSum=(int)calculatedCheckSum;
  int checkSum=readInt(dis);
  if (doCheckSum && checkSum != oldCheckSum) {
    throw new IOException("String_Node_Str" + Long.toHexString(calculatedCheckSum) + "String_Node_Str"+ Integer.toHexString(checkSum));
  }
}

Fixed version (ground truth):
/** 
 * Validates checksum in the stream
 * @param dis input stream
 * @param doCheckSum validates
 * @throws IOException on error
 */
private void validateChecksum(DataInputStream dis,boolean doCheckSum) throws IOException {
  if (!doCheckSum)   return;
  int oldCheckSum=(int)calculatedCheckSum;
  int checkSum=readInt(dis);
  if (checkSum != oldCheckSum) {
    throw new IOException("String_Node_Str" + Long.toHexString(calculatedCheckSum) + "String_Node_Str"+ Integer.toHexString(checkSum));
  }
}
Program: 19587
Project: 19587
Buggy source:
/** 
 * Collects all of the entry and exit points for the vocabulary. 
 */
private void collectEntryAndExitUnits(){
  Collection<Word> words=getAllWords();
  for (  Word word : words) {
    for (int j=0; j < word.getPronunciations().length; j++) {
      Pronunciation p=word.getPronunciations()[j];
      System.out.println("String_Node_Str" + word + "String_Node_Str"+ j+ "String_Node_Str"+ p);
      Unit first=p.getUnits()[0];
      Unit last=p.getUnits()[p.getUnits().length - 1];
      entryPoints.add(first);
      exitPoints.add(last);
    }
  }
  if (debug) {
    System.out.println("String_Node_Str" + entryPoints.size());
    System.out.println("String_Node_Str" + exitPoints.size());
  }
}

Fixed version (ground truth):
/** 
 * Collects all of the entry and exit points for the vocabulary. 
 */
private void collectEntryAndExitUnits(){
  Collection<Word> words=getAllWords();
  for (  Word word : words) {
    for (int j=0; j < word.getPronunciations().length; j++) {
      Pronunciation p=word.getPronunciations()[j];
      Unit first=p.getUnits()[0];
      Unit last=p.getUnits()[p.getUnits().length - 1];
      entryPoints.add(first);
      exitPoints.add(last);
    }
  }
  if (debug) {
    System.out.println("String_Node_Str" + entryPoints.size());
    System.out.println("String_Node_Str" + exitPoints.size());
  }
}
Program: 19588
Project: 19588
Buggy source:
@Override public String toString(){
  StringBuilder b=new StringBuilder();
  for (  Map.Entry<Double,Set<WordResult>> entry : entrySet()) {
    b.append(entry.getKey()).append(':');
    for (    WordResult wordResult : entry.getValue())     b.append(wordResult).append(',');
    if (!entry.getValue().isEmpty())     b.setLength(b.length() - 1);
  }
  return b.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  StringBuilder b=new StringBuilder();
  for (  Map.Entry<Double,Set<WordResult>> entry : entrySet()) {
    b.append(entry.getKey()).append(':');
    for (    WordResult wordResult : entry.getValue())     b.append(wordResult).append(',');
    if (!entry.getValue().isEmpty())     b.setLength(b.length() - 1);
    b.append(' ');
  }
  return b.toString();
}
Program: 19589
Project: 19589
Buggy source:
protected void initRecognizer(){
  this.scorer=new ThreadedAcousticScorer(frontend,null,10,true,0);
  this.pruner=new SimplePruner();
  this.activeListFactory=new PartitionActiveListFactory(absoluteBeamWidth,relativeBeamWidth,logMath);
  this.searchManager=new SimpleBreadthFirstSearchManager(logMath,linguist,pruner,scorer,activeListFactory,false,0.0,0,false);
  this.decoder=new Decoder(searchManager,false,false,new ArrayList<ResultListener>(),100000);
  this.recognizer=new Recognizer(decoder,monitors);
  this.monitors=new ArrayList<ResultListener>();
  this.monitors.add(new BestPathAccuracyTracker(recognizer,false,false,false,false,false,false));
  this.monitors.add(new MemoryTracker(recognizer,false,false));
  this.monitors.add(new SpeedTracker(recognizer,frontend,true,false,false,false));
}

Fixed version (ground truth):
protected void initRecognizer(){
  this.scorer=new ThreadedAcousticScorer(frontend,null,10,true,0);
  this.pruner=new SimplePruner();
  this.activeListFactory=new PartitionActiveListFactory(absoluteBeamWidth,relativeBeamWidth,logMath);
  this.searchManager=new SimpleBreadthFirstSearchManager(logMath,linguist,pruner,scorer,activeListFactory,false,0.0,0,false);
  this.decoder=new Decoder(searchManager,false,false,new ArrayList<ResultListener>(),100000);
  this.recognizer=new Recognizer(decoder,monitors);
  this.monitors=new ArrayList<Monitor>();
  this.monitors.add(new BestPathAccuracyTracker(recognizer,false,false,false,false,false,false));
  this.monitors.add(new MemoryTracker(recognizer,false,false));
  this.monitors.add(new SpeedTracker(recognizer,frontend,true,false,false,false));
}
Program: 19590
Project: 19590
Buggy source:
/** 
 * Resets the monitors monitoring this recognizer 
 */
public void resetMonitors(){
  for (  ResultListener listener : monitors) {
    if (listener instanceof Resetable)     ((Resetable)listener).reset();
  }
}

Fixed version (ground truth):
/** 
 * Resets the monitors monitoring this recognizer 
 */
public void resetMonitors(){
  for (  Monitor listener : monitors) {
    if (listener instanceof Resetable)     ((Resetable)listener).reset();
  }
}
Program: 19591
Project: 19591
Buggy source:
@Override public void newProperties(PropertySheet ps) throws PropertyException {
  decoder=(Decoder)ps.getComponent(PROP_DECODER);
  monitors=ps.getComponentList(PROP_MONITORS,ResultListener.class);
  name=ps.getInstanceName();
}

Fixed version (ground truth):
@Override public void newProperties(PropertySheet ps) throws PropertyException {
  decoder=(Decoder)ps.getComponent(PROP_DECODER);
  monitors=ps.getComponentList(PROP_MONITORS,Monitor.class);
  name=ps.getInstanceName();
}
Program: 19592
Project: 19592
Buggy source:
/** 
 * Creates a pool with a single identity matrix in it.
 * @name the name of the pool
 * @return the pool with the matrix
 */
private Pool<float[][]> createDummyMatrixPool(String name){
  Pool<float[][]> pool=new Pool<float[][]>(name);
  float[][] matrix=new float[vectorLength][vectorLength];
  logger.fine("String_Node_Str" + name);
  for (int i=0; i < vectorLength; i++) {
    for (int j=0; j < vectorLength; j++) {
      if (i == j) {
        matrix[i][j]=1.0F;
      }
 else {
        matrix[i][j]=0.0F;
      }
    }
  }
  pool.put(0,matrix);
  return pool;
}

Fixed version (ground truth):
/** 
 * Creates a pool with a single identity matrix in it.
 * @param name the name of the pool
 * @return the pool with the matrix
 */
private Pool<float[][]> createDummyMatrixPool(String name){
  Pool<float[][]> pool=new Pool<float[][]>(name);
  float[][] matrix=new float[vectorLength][vectorLength];
  logger.fine("String_Node_Str" + name);
  for (int i=0; i < vectorLength; i++) {
    for (int j=0; j < vectorLength; j++) {
      if (i == j) {
        matrix[i][j]=1.0F;
      }
 else {
        matrix[i][j]=0.0F;
      }
    }
  }
  pool.put(0,matrix);
  return pool;
}
Program: 19594
Project: 19594
Buggy source:
/** 
 * Read a float from the input stream, byte-swapping as necessary. the input stream
 * @return a floating pint value
 * @throws IOException on error
 */
protected float readFloat(DataInputStream dis) throws IOException {
  float val;
  if (swap) {
    val=Utilities.readLittleEndianFloat(dis);
  }
 else {
    val=dis.readFloat();
  }
  return val;
}

Fixed version (ground truth):
/** 
 * Read a float from the input stream, byte-swapping as necessary. the input stream
 * @param dis the input stream
 * @return a floating value
 * @throws IOException on error
 */
protected float readFloat(DataInputStream dis) throws IOException {
  float val;
  if (swap) {
    val=Utilities.readLittleEndianFloat(dis);
  }
 else {
    val=dis.readFloat();
  }
  return val;
}
Program: 19595
Project: 19595
Buggy source:
/** 
 * Read an integer from the input stream, byte-swapping as necessary. the inputstream
 * @return an integer value
 * @throws IOException on error
 */
protected int readInt(DataInputStream dis) throws IOException {
  if (swap) {
    return Utilities.readLittleEndianInt(dis);
  }
 else {
    return dis.readInt();
  }
}

Fixed version (ground truth):
/** 
 * Read an integer from the input stream, byte-swapping as necessary.
 * @param dis the input stream
 * @return an integer value
 * @throws IOException on error
 */
protected int readInt(DataInputStream dis) throws IOException {
  if (swap) {
    return Utilities.readLittleEndianInt(dis);
  }
 else {
    return dis.readInt();
  }
}
Program: 19596
Project: 19596
Buggy source:
/** 
 * Gets the senone sequence representing the given senones.
 * @stateid is the array of senone state ids
 * @return the senone sequence associated with the states
 */
protected SenoneSequence getSenoneSequence(int[] stateid){
  Senone[] senones=new Senone[stateid.length];
  for (int i=0; i < stateid.length; i++) {
    senones[i]=senonePool.get(stateid[i]);
  }
  return new SenoneSequence(senones);
}

Fixed version (ground truth):
/** 
 * Gets the senone sequence representing the given senones.
 * @param stateId is the array of senone state ids
 * @return the senone sequence associated with the states
 */
protected SenoneSequence getSenoneSequence(int[] stateId){
  Senone[] senones=new Senone[stateId.length];
  for (int i=0; i < stateId.length; i++) {
    senones[i]=senonePool.get(stateId[i]);
  }
  return new SenoneSequence(senones);
}
Program: 19597
Project: 19597
Buggy source:
/** 
 * Creates the senone pool from the rest of the pools. assumes the means and variances are in the same order
 * @distFloor the lowest allowed score
 * @varianceFloor the lowest allowed variance
 * @return the senone pool
 */
private Pool<Senone> createSenonePool(float distFloor,float varianceFloor){
}

Fixed version (ground truth):
/** 
 * Creates the senone pool from the rest of the pools. assumes the means and variances are in the same order
 * @param distFloor the lowest allowed score
 * @param varianceFloor the lowest allowed variance
 * @return the senone pool
 */
private Pool<Senone> createSenonePool(float distFloor,float varianceFloor){
}
Program: 19598
Project: 19598
Buggy source:
/** 
 * Reads the given number of floats from the stream and returns them in an array of floats. the stream to read data from the number of floats to read
 * @return an array of size float elements
 * @throws IOException if an exception occurs
 */
protected float[] readFloatArray(DataInputStream dis,int size) throws IOException {
  float[] data=new float[size];
  for (int i=0; i < size; i++) {
    data[i]=readFloat(dis);
  }
  return data;
}

Fixed version (ground truth):
/** 
 * Reads the given number of floats from the stream and returns them in an array of floats.
 * @param dis the stream to read data from the number of floats to read
 * @param size size of the array
 * @return an array of size float elements
 * @throws IOException if an exception occurs
 */
protected float[] readFloatArray(DataInputStream dis,int size) throws IOException {
  float[] data=new float[size];
  for (int i=0; i < size; i++) {
    data[i]=readFloat(dis);
  }
  return data;
}
Program: 19599
Project: 19599
Buggy source:
/** 
 * Creates a pool with a single zero vector in it. the name of the pool
 * @return the pool with the vector
 */
private Pool<float[]> createDummyVectorPool(String name){
  logger.fine("String_Node_Str" + name);
  Pool<float[]> pool=new Pool<float[]>(name);
  float[] vector=new float[vectorLength];
  for (int i=0; i < vectorLength; i++) {
    vector[i]=0.0f;
  }
  pool.put(0,vector);
  return pool;
}

Fixed version (ground truth):
/** 
 * Creates a pool with a single zero vector in it.
 * @param name the name of the pool
 * @return the pool with the vector
 */
private Pool<float[]> createDummyVectorPool(String name){
  logger.fine("String_Node_Str" + name);
  Pool<float[]> pool=new Pool<float[]>(name);
  float[] vector=new float[vectorLength];
  for (int i=0; i < vectorLength; i++) {
    vector[i]=0.0f;
  }
  pool.put(0,vector);
  return pool;
}
Program: 19600
Project: 19600
Buggy source:
/** 
 * Loads the AcousticModel from an HTK MMF the name of the acoustic model; if null we just load from the default location
 * @throws java.io.IOException
 */
private void loadModelFiles(String MMFname) throws IOException {
  logger.config("String_Node_Str" + MMFname);
  logger.config("String_Node_Str" + location);
  logger.config("String_Node_Str" + model);
  logger.config("String_Node_Str" + dataDir);
  HTKStruct htkmods=new HTKStruct();
  htkmods.load(MMFname);
  meansPool=htkmods.htkMeans(MMFname);
  variancePool=htkmods.htkVars(MMFname,varianceFloor);
  mixtureWeightsPool=htkmods.htkWeights(MMFname,mixtureWeightFloor);
  matrixPool=htkmods.htkTrans(MMFname);
  senonePool=createSenonePool(distFloor,varianceFloor);
  loadHMMPool(useCDUnits,htkmods,location + File.separator + model);
}

Fixed version (ground truth):
/** 
 * Loads the AcousticModel from an HTK MMF
 * @param MMFname the name of the acoustic model; if null we just load from the defaultlocation
 * @throws java.io.IOException
 */
private void loadModelFiles(String MMFname) throws IOException {
  logger.config("String_Node_Str" + MMFname);
  logger.config("String_Node_Str" + location);
  logger.config("String_Node_Str" + model);
  logger.config("String_Node_Str" + dataDir);
  HTKStruct htkmods=new HTKStruct();
  htkmods.load(MMFname);
  meansPool=htkmods.htkMeans(MMFname);
  variancePool=htkmods.htkVars(MMFname,varianceFloor);
  mixtureWeightsPool=htkmods.htkWeights(MMFname,mixtureWeightFloor);
  matrixPool=htkmods.htkTrans(MMFname);
  senonePool=createSenonePool(distFloor,varianceFloor);
  loadHMMPool(useCDUnits,htkmods,location + File.separator + model);
}
Program: 19601
Project: 19601
Buggy source:
/** 
 * Validates checksum in the stream
 * @dis input stream
 * @doChecksum validates
 * @throws IOException on error
 */
private void validateChecksum(DataInputStream dis,boolean doCheckSum) throws IOException {
  int oldCheckSum=(int)calculatedCheckSum;
  int checkSum=readInt(dis);
  if (doCheckSum && checkSum != oldCheckSum) {
    throw new IOException("String_Node_Str" + Long.toHexString(calculatedCheckSum) + "String_Node_Str"+ Integer.toHexString(checkSum));
  }
}

Fixed version (ground truth):
/** 
 * Validates checksum in the stream
 * @param dis input stream
 * @param doCheckSum validates
 * @throws IOException on error
 */
private void validateChecksum(DataInputStream dis,boolean doCheckSum) throws IOException {
  int oldCheckSum=(int)calculatedCheckSum;
  int checkSum=readInt(dis);
  if (doCheckSum && checkSum != oldCheckSum) {
    throw new IOException("String_Node_Str" + Long.toHexString(calculatedCheckSum) + "String_Node_Str"+ Integer.toHexString(checkSum));
  }
}
Program: 19602
Project: 19602
Buggy source:
/** 
 * Normalize the given data.
 * @data the data to normalize
 */
public static void normalize(float[] data){
  float sum=0;
  for (  float val : data) {
    sum+=val;
  }
  if (sum != 0.0f) {
    for (int i=0; i < data.length; i++) {
      data[i]=data[i] / sum;
    }
  }
}

Fixed version (ground truth):
/** 
 * Normalize the given data.
 * @param data the data to normalize
 */
public static void normalize(float[] data){
  float sum=0;
  for (  float val : data) {
    sum+=val;
  }
  if (sum != 0.0f) {
    for (int i=0; i < data.length; i++) {
      data[i]=data[i] / sum;
    }
  }
}
Program: 19603
Project: 19603
Buggy source:
/** 
 * Creates a branch state
 * @param nodeID the grammar node id
 */
public BranchState(String leftContext,String rightContext,int nodeID){
  super('B' + '[' + leftContext+ ','+ rightContext+ ']',null,nodeID);
}

Fixed version (ground truth):
/** 
 * Creates a branch state
 * @param nodeID the grammar node id
 */
public BranchState(String leftContext,String rightContext,int nodeID){
  super("String_Node_Str" + leftContext + "String_Node_Str"+ rightContext+ "String_Node_Str",null,nodeID);
}
Program: 19604
Project: 19604
Buggy source:
/** 
 * extract @xxxx keywords from documention comments
 */
static void extractKeywords(BaseRuleGrammar grammar,String rname,String comment){
  String sample;
  int i=comment.indexOf("String_Node_Str");
  while (i > 0) {
    int j=comment.indexOf('\u005cn',i);
    if (j < 0) {
      sample=comment.substring(i + 8);
      i=-1;
    }
 else {
      sample=comment.substring(i + 8,j);
      i=j;
    }
    i=comment.indexOf("String_Node_Str",i);
    grammar.addSampleSentence(rname,sample);
  }
}

Fixed version (ground truth):
/** 
 * extract @xxxx keywords from documention comments
 */
static void extractKeywords(BaseRuleGrammar grammar,String rname,String comment){
  int i=0;
  while ((i=comment.indexOf("String_Node_Str",i) + 9) > 9) {
    int j=Math.max(comment.indexOf('\u005cr',i),comment.indexOf('\u005cn',i));
    if (j < 0) {
      j=comment.length();
      if (comment.endsWith(("String_Node_Str")))       j-=2;
    }
    grammar.addSampleSentence(rname,comment.substring(i,j).trim());
    i=j + 1;
  }
}
Program: 19605
Project: 19605
Buggy source:
/** 
 * Returns the sample rate of the data.
 * @return the sample rate of the data
 */
public int getSampleRate(){
  return sampleRate;
}

Fixed version (ground truth):
/** 
 * @return the sample rate of the data.
 */
public int getSampleRate(){
  return sampleRate;
}
Program: 19606
Project: 19606
Buggy source:
/** 
 * Returns the position of the first sample in the original data. The very first sample number is zero.
 * @return the position of the first sample in the original data
 */
public long getFirstSampleNumber(){
  return firstSampleNumber;
}

Fixed version (ground truth):
/** 
 * @return the position of the first sample in the original data. The very first sample numberis zero.
 */
public long getFirstSampleNumber(){
  return firstSampleNumber;
}
Program: 19607
Project: 19607
Buggy source:
/** 
 * Returns a string that describes this DoubleData.
 * @return a string that describes this DoubleData
 */
public String toString(){
  return ("String_Node_Str" + sampleRate + "String_Node_Str"+ firstSampleNumber+ "String_Node_Str"+ collectTime);
}

Fixed version (ground truth):
/** 
 * @return a string that describes the data.
 */
public String toString(){
  return ("String_Node_Str" + sampleRate + "String_Node_Str"+ firstSampleNumber+ "String_Node_Str"+ collectTime);
}
Program: 19608
Project: 19608
Buggy source:
/** 
 * Returns the values of this DoubleData object.
 * @return the values
 */
public float[] getValues(){
  return values;
}

Fixed version (ground truth):
/** 
 * @return the values of this data.
 */
public float[] getValues(){
  return values;
}
Program: 19609
Project: 19609
Buggy source:
/** 
 * Returns the sample rate of this data.
 * @return the sample rate of this data
 */
public int getSampleRate(){
  return sampleRate;
}

Fixed version (ground truth):
/** 
 * @return the sample rate of this data.
 */
public int getSampleRate(){
  return sampleRate;
}
Program: 19610
Project: 19610
Buggy source:
/** 
 * Returns the position of the first sample in the original data. The very first sample number is zero.
 * @return the position of the first sample in the original data
 */
public long getFirstSampleNumber(){
  return firstSampleNumber;
}

Fixed version (ground truth):
/** 
 * @return the position of the first sample in the original data. The very first sample number is zero.
 */
public long getFirstSampleNumber(){
  return firstSampleNumber;
}
Program: 19611
Project: 19611
Buggy source:
/** 
 * Registers a new listener for <code>Result</code>. 
 */
void addResultListener(ResultListener resultListener);

Fixed version (ground truth):
/** 
 * Registers a new listener for <code>Result</code>.
 * @param resultListener
 */
void addResultListener(ResultListener resultListener);
Program: 19612
Project: 19612
Buggy source:
/** 
 * Removes a listener from this <code>ResultProducer</code>-instance. 
 */
void removeResultListener(ResultListener resultListener);

Fixed version (ground truth):
/** 
 * Removes a listener from this <code>ResultProducer</code>-instance.
 * @param resultListener
 */
void removeResultListener(ResultListener resultListener);
Program: 19613
Project: 19613
Buggy source:
/** 
 * Handles the first element in a feature-stream. 
 */
protected void handleDataStartSignal(DataStartSignal dataStartSignal){
  Map<String,Object> dataProps=dataStartSignal.getProps();
  if (dataProps.containsKey(DataStartSignal.SPEECH_TAGGED_FEATURE_STREAM))   useSpeechSignals=(Boolean)dataProps.get(DataStartSignal.SPEECH_TAGGED_FEATURE_STREAM);
 else   useSpeechSignals=false;
}

Fixed version (ground truth):
/** 
 * Handles the first element in a feature-stream.
 * @param dataStartSignal
 */
protected void handleDataStartSignal(DataStartSignal dataStartSignal){
  Map<String,Object> dataProps=dataStartSignal.getProps();
  if (dataProps.containsKey(DataStartSignal.SPEECH_TAGGED_FEATURE_STREAM))   useSpeechSignals=(Boolean)dataProps.get(DataStartSignal.SPEECH_TAGGED_FEATURE_STREAM);
 else   useSpeechSignals=false;
}
Program: 19614
Project: 19614
Buggy source:
/** 
 * Handles the last element in a feature-stream. 
 */
protected void handleDataEndSignal(DataEndSignal dataEndSignal){
}

Fixed version (ground truth):
/** 
 * Handles the last element in a feature-stream.
 * @param dataEndSignal
 */
protected void handleDataEndSignal(DataEndSignal dataEndSignal){
}
Program: 19615
Project: 19615
Buggy source:
/** 
 * Normalizes a previously calculated score
 * @return the normalized score
 */
public float normalizeScore(float maxScore);

Fixed version (ground truth):
/** 
 * Normalizes a previously calculated score
 * @param maxScore
 * @return the normalized score
 */
public float normalizeScore(float maxScore);
Program: 19616
Project: 19616
Buggy source:
/** 
 * Creates an empty active list 
 */
public PartitionActiveList(int absoluteBeamWidth,float logRelativeBeamWidth){
  this.absoluteBeamWidth=absoluteBeamWidth;
  this.logRelativeBeamWidth=logRelativeBeamWidth;
  int listSize=2000;
  if (absoluteBeamWidth > 0) {
    listSize=absoluteBeamWidth / 3;
  }
  this.tokenList=new Token[listSize];
}

Fixed version (ground truth):
/** 
 * Creates an empty active list
 * @param absoluteBeamWidth
 * @param logRelativeBeamWidth
 */
public PartitionActiveList(int absoluteBeamWidth,float logRelativeBeamWidth){
  this.absoluteBeamWidth=absoluteBeamWidth;
  this.logRelativeBeamWidth=logRelativeBeamWidth;
  int listSize=2000;
  if (absoluteBeamWidth > 0) {
    listSize=absoluteBeamWidth / 3;
  }
  this.tokenList=new Token[listSize];
}
Program: 19617
Project: 19617
Buggy source:
/** 
 * Because the growBranches() is called although no data is left after the last speech frame, the ordering of the active-list might depend on the transition-probs and (penalty-scores) only. Therefore we need to undo the last grow-step up to final states or the last emitting state in order to fix the list..
 */
private ActiveList undoLastGrowStep(){
  ActiveList fixedList=activeList.newInstance();
  for (  Token token : activeList.getTokens()) {
    Token curToken=token.getPredecessor();
    while (curToken.getPredecessor() != null && ((curToken.isFinal() && curToken.getPredecessor() != null && !curToken.getPredecessor().isFinal()) || (curToken.isEmitting() && curToken.getData() == null) || (!curToken.isFinal() && !curToken.isEmitting()))) {
      curToken=curToken.getPredecessor();
    }
    fixedList.add(curToken);
  }
  return fixedList;
}

Fixed version (ground truth):
/** 
 * Because the growBranches() is called although no data is left after the last speech frame, the ordering of the active-list might depend on the transition-probs and (penalty-scores) only. Therefore we need to undo the last grow-step up to final states or the last emitting state in order to fix the list..
 * @return
 */
private ActiveList undoLastGrowStep(){
  ActiveList fixedList=activeList.newInstance();
  for (  Token token : activeList.getTokens()) {
    Token curToken=token.getPredecessor();
    while (curToken.getPredecessor() != null && ((curToken.isFinal() && curToken.getPredecessor() != null && !curToken.getPredecessor().isFinal()) || (curToken.isEmitting() && curToken.getData() == null) || (!curToken.isFinal() && !curToken.isEmitting()))) {
      curToken=curToken.getPredecessor();
    }
    fixedList.add(curToken);
  }
  return fixedList;
}
Program: 19618
Project: 19618
Buggy source:
/** 
 * Creates an empty active list 
 */
public SortingActiveList(int absoluteBeamWidth,float logRelativeBeamWidth){
  this.absoluteBeamWidth=absoluteBeamWidth;
  this.logRelativeBeamWidth=logRelativeBeamWidth;
  int initListSize=absoluteBeamWidth > 0 ? absoluteBeamWidth : DEFAULT_SIZE;
  this.tokenList=new ArrayList<Token>(initListSize);
}

Fixed version (ground truth):
/** 
 * Creates an empty active list
 * @param absoluteBeamWidth
 * @param logRelativeBeamWidth
 */
public SortingActiveList(int absoluteBeamWidth,float logRelativeBeamWidth){
  this.absoluteBeamWidth=absoluteBeamWidth;
  this.logRelativeBeamWidth=logRelativeBeamWidth;
  int initListSize=absoluteBeamWidth > 0 ? absoluteBeamWidth : DEFAULT_SIZE;
  this.tokenList=new ArrayList<Token>(initListSize);
}
Program: 19619
Project: 19619
Buggy source:
/** 
 * Returns the acoustic score for this token (in logMath log base) 
 */
public float getAcousticScore(){
  return logAcousticScore;
}

Fixed version (ground truth):
/** 
 * Returns the acoustic score for this token (in logMath log base)
 * @return
 */
public float getAcousticScore(){
  return logAcousticScore;
}
Program: 19620
Project: 19620
Buggy source:
/** 
 * Sets the feature for this Token. 
 */
public void setData(Data data){
  myData=data;
}

Fixed version (ground truth):
/** 
 * Sets the feature for this Token.
 * @param data
 */
public void setData(Data data){
  myData=data;
}
Program: 19621
Project: 19621
Buggy source:
/** 
 * Constructs a new token that continues the search from the current token. If predessorClasses is null or if the class of the state is a member of predecessorClasses, the predecessor of the new token is set to the current token.  Otherwise it is set to the predecessor of the current token.  This behavior is used to save memory when building lattices.
 * @param state                   the SentenceHMMState associated with this token
 * @param logTotalScore           the total entry score for this token (in LogMath log base)
 * @param logLanguageScore        the language score associated with this token (in LogMath log base)
 * @param logInsertionProbability the insertion probabilty  associated with this token (in LogMath log base)
 * @param frameNumber             the frame number associated with this token
 */
public Token child(SearchState state,float logTotalScore,float logLanguageScore,float logInsertionProbability,int frameNumber){
  if ((predecessorClasses == null) || predecessorClasses.contains(state.getClass())) {
    return new Token(this,state,logTotalScore,logLanguageScore,logInsertionProbability,frameNumber);
  }
 else {
    return new Token(predecessor,state,logTotalScore,logLanguageScore,logInsertionProbability,frameNumber);
  }
}

Fixed version (ground truth):
/** 
 * Constructs a new token that continues the search from the current token. If predessorClasses is null or if the class of the state is a member of predecessorClasses, the predecessor of the new token is set to the current token.  Otherwise it is set to the predecessor of the current token.  This behavior is used to save memory when building lattices.
 * @param state                   the SentenceHMMState associated with this token
 * @param logTotalScore           the total entry score for this token (in LogMath log base)
 * @param logLanguageScore        the language score associated with this token (in LogMath log base)
 * @param logInsertionProbability the insertion probabilty  associated with this token (in LogMath log base)
 * @param frameNumber             the frame number associated with this token
 * @return
 */
public Token child(SearchState state,float logTotalScore,float logLanguageScore,float logInsertionProbability,int frameNumber){
  if ((predecessorClasses == null) || predecessorClasses.contains(state.getClass())) {
    return new Token(this,state,logTotalScore,logLanguageScore,logInsertionProbability,frameNumber);
  }
 else {
    return new Token(predecessor,state,logTotalScore,logLanguageScore,logInsertionProbability,frameNumber);
  }
}
Program: 19622
Project: 19622
Buggy source:
/** 
 * Adds the given Token to this TokenStack.
 * @return the replaced Token, or null if no Token was replaced
 */
public Token add(Token token);

Fixed version (ground truth):
/** 
 * Adds the given Token to this TokenStack.
 * @param token
 * @return the replaced Token, or null if no Token was replaced
 */
public Token add(Token token);
Program: 19623
Project: 19623
Buggy source:
/** 
 * Returns true if the given score is higher than the lowest scoring token in this TokenStack.
 * @param score the score the check
 * @return true if the given score is higher than the lowest scoring token, false otherwise
 */
public boolean isInsertable(float score,int frameNumber);

Fixed version (ground truth):
/** 
 * Returns true if the given score is higher than the lowest scoring token in this TokenStack.
 * @param score the score the check
 * @param frameNumber
 * @return true if the given score is higher than the lowest scoring token, false otherwise
 */
public boolean isInsertable(float score,int frameNumber);
Program: 19624
Project: 19624
Buggy source:
/** 
 * Checks that the given two states are in legitimate order. 
 */
private void checkStateOrder(SearchState fromState,SearchState toState){
  if (fromState.getOrder() == numStateOrder - 1) {
    return;
  }
  if (fromState.getOrder() > toState.getOrder()) {
    throw new Error("String_Node_Str" + fromState.getClass().getName() + ' '+ fromState.toPrettyString()+ "String_Node_Str"+ fromState.getOrder()+ "String_Node_Str"+ toState.getClass().getName()+ ' '+ toState.toPrettyString()+ "String_Node_Str"+ toState.getOrder());
  }
}

Fixed version (ground truth):
/** 
 * Checks that the given two states are in legitimate order.
 * @param fromState
 * @param toState
 */
private void checkStateOrder(SearchState fromState,SearchState toState){
  if (fromState.getOrder() == numStateOrder - 1) {
    return;
  }
  if (fromState.getOrder() > toState.getOrder()) {
    throw new Error("String_Node_Str" + fromState.getClass().getName() + ' '+ fromState.toPrettyString()+ "String_Node_Str"+ fromState.getOrder()+ "String_Node_Str"+ toState.getClass().getName()+ ' '+ toState.toPrettyString()+ "String_Node_Str"+ toState.getOrder());
  }
}
Program: 19625
Project: 19625
Buggy source:
/** 
 * Update this state with the given token 
 */
public void update(Token t){
  count++;
  if (t.getScore() > maxScore) {
    maxScore=t.getScore();
  }
  if (t.getScore() < minScore) {
    minScore=t.getScore();
  }
  isHMM=t.getSearchState() instanceof HMMSearchState;
}

Fixed version (ground truth):
/** 
 * Update this state with the given token
 * @param t
 */
public void update(Token t){
  count++;
  if (t.getScore() > maxScore) {
    maxScore=t.getScore();
  }
  if (t.getScore() < minScore) {
    minScore=t.getScore();
  }
  isHMM=t.getSearchState() instanceof HMMSearchState;
}
Program: 19626
Project: 19626
Buggy source:
/** 
 * Determines whether or not we've visited the state associated with this token since the previous frame.
 * @return true if we've visted the search state since the last frame
 */
private boolean isVisited(Token t){
  SearchState curState=t.getSearchState();
  t=t.getPredecessor();
  while (t != null && !t.isEmitting()) {
    if (curState.equals(t.getSearchState())) {
      System.out.println("String_Node_Str" + curState + "String_Node_Str"+ t.getSearchState());
      return true;
    }
    t=t.getPredecessor();
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Determines whether or not we've visited the state associated with this token since the previous frame.
 * @param t
 * @return true if we've visted the search state since the last frame
 */
private boolean isVisited(Token t){
  SearchState curState=t.getSearchState();
  t=t.getPredecessor();
  while (t != null && !t.isEmitting()) {
    if (curState.equals(t.getSearchState())) {
      System.out.println("String_Node_Str" + curState + "String_Node_Str"+ t.getSearchState());
      return true;
    }
    t=t.getPredecessor();
  }
  return false;
}
Program: 19627
Project: 19627
Buggy source:
/** 
 * Converts a given Data-object into a <code>FloatData</code> if possible. 
 */
public static FloatData toFloatData(Data data){
  FloatData convertData;
  if (data instanceof FloatData)   convertData=(FloatData)data;
 else   if (data instanceof DoubleData) {
    DoubleData dd=(DoubleData)data;
    convertData=new FloatData(MatrixUtils.double2float(dd.getValues()),dd.getSampleRate(),dd.getCollectTime(),dd.getFirstSampleNumber());
  }
 else   throw new IllegalArgumentException("String_Node_Str" + data.getClass() + "String_Node_Str");
  return convertData;
}

Fixed version (ground truth):
/** 
 * Converts a given Data-object into a <code>FloatData</code> if possible.
 * @param data
 * @return
 */
public static FloatData toFloatData(Data data){
  FloatData convertData;
  if (data instanceof FloatData)   convertData=(FloatData)data;
 else   if (data instanceof DoubleData) {
    DoubleData dd=(DoubleData)data;
    convertData=new FloatData(MatrixUtils.double2float(dd.getValues()),dd.getSampleRate(),dd.getCollectTime(),dd.getFirstSampleNumber());
  }
 else   throw new IllegalArgumentException("String_Node_Str" + data.getClass() + "String_Node_Str");
  return convertData;
}
Program: 19628
Project: 19628
Buggy source:
/** 
 * Returns the last data procssor within the <code>DataProcessor</code> chain of this <code>FrontEnd</code>. 
 */
public DataProcessor getLastDataProcessor(){
  return last;
}

Fixed version (ground truth):
/** 
 * Returns the last data procssor within the <code>DataProcessor</code> chain of this <code>FrontEnd</code>.
 * @return
 */
public DataProcessor getLastDataProcessor(){
  return last;
}
Program: 19629
Project: 19629
Buggy source:
/** 
 * Returns the collection of <code>DataProcessor</code>s which setup this <code>FrontEnd</code>. 
 */
public List<DataProcessor> getElements(){
  return frontEndList;
}

Fixed version (ground truth):
/** 
 * Returns the collection of <code>DataProcessor</code>s which setup this <code>FrontEnd</code>.
 * @return
 */
public List<DataProcessor> getElements(){
  return frontEndList;
}
Program: 19630
Project: 19630
Buggy source:
/** 
 * Returns the properties associated to this signal. 
 */
public synchronized Map<String,Object> getProps(){
  if (props == null)   props=new HashMap<String,Object>();
  return props;
}

Fixed version (ground truth):
/** 
 * Returns the properties associated to this signal.
 * @return
 */
public synchronized Map<String,Object> getProps(){
  if (props == null)   props=new HashMap<String,Object>();
  return props;
}
Program: 19631
Project: 19631
Buggy source:
/** 
 * Adds a new listener. 
 */
public void addDataListener(DataListener l){
  if (l == null)   return;
  dataListeners.add(l);
}

Fixed version (ground truth):
/** 
 * Adds a new listener.
 * @param l
 */
public void addDataListener(DataListener l){
  if (l == null)   return;
  dataListeners.add(l);
}
Program: 19632
Project: 19632
Buggy source:
/** 
 * Removes a listener. 
 */
public void removeDataListener(DataListener l){
  if (l == null)   return;
  dataListeners.remove(l);
}

Fixed version (ground truth):
/** 
 * Removes a listener.
 * @param l
 */
public void removeDataListener(DataListener l){
  if (l == null)   return;
  dataListeners.remove(l);
}
Program: 19633
Project: 19633
Buggy source:
/** 
 * This method is invoked when a new   {@link Data} object becomes available. 
 */
public void processDataFrame(Data data);

Fixed version (ground truth):
/** 
 * This method is invoked when a new   {@link Data} object becomes available.
 * @param data
 */
public void processDataFrame(Data data);
Program: 19634
Project: 19634
Buggy source:
/** 
 * Registers a new listener for <code>Data</code>s. 
 */
void addDataListener(DataListener l);

Fixed version (ground truth):
/** 
 * Registers a new listener for <code>Data</code>s.
 * @param l
 */
void addDataListener(DataListener l);
Program: 19635
Project: 19635
Buggy source:
/** 
 * Unregisters a listener fors <code>Data</code>s. 
 */
void removeDataListener(DataListener l);

Fixed version (ground truth):
/** 
 * Unregisters a listener fors <code>Data</code>s.
 * @param l
 */
void removeDataListener(DataListener l);
Program: 19636
Project: 19636
Buggy source:
/** 
 * Given a non-speech frame, try to read more non-speech frames until we think its the end of utterance.
 * @param audio a non-speech frame
 * @return true if speech has really ended, false if speech has not ended
 */
private boolean readEndFrames(SpeechClassifiedData audio) throws DataProcessingException {
}

Fixed version (ground truth):
/** 
 * Given a non-speech frame, try to read more non-speech frames until we think its the end of utterance.
 * @param audio a non-speech frame
 * @return true if speech has really ended, false if speech has not ended
 * @throws edu.cmu.sphinx.frontend.DataProcessingException
 */
private boolean readEndFrames(SpeechClassifiedData audio) throws DataProcessingException {
}
Program: 19637
Project: 19637
Buggy source:
/** 
 * Handles an SpeechClassifiedData object that can possibly be the first in an utterance.
 * @param audio the SpeechClassifiedData to handle
 * @return true if utterance/speech has started for real, false otherwise
 */
private boolean handleFirstSpeech(SpeechClassifiedData audio) throws DataProcessingException {
  int speechTime=getAudioTime(audio);
  while (speechTime < startSpeechTime) {
    Data next=readData();
    if (next == null) {
      return false;
    }
    sendToQueue(next);
    if (next instanceof SpeechClassifiedData) {
      if (!((SpeechClassifiedData)next).isSpeech()) {
        return false;
      }
 else {
        speechTime+=getAudioTime(audio);
      }
    }
  }
  return true;
}

Fixed version (ground truth):
/** 
 * Handles an SpeechClassifiedData object that can possibly be the first in an utterance.
 * @param audio the SpeechClassifiedData to handle
 * @return true if utterance/speech has started for real, false otherwise
 * @throws edu.cmu.sphinx.frontend.DataProcessingException
 */
private boolean handleFirstSpeech(SpeechClassifiedData audio) throws DataProcessingException {
  int speechTime=getAudioTime(audio);
  while (speechTime < startSpeechTime) {
    Data next=readData();
    if (next == null) {
      return false;
    }
    sendToQueue(next);
    if (next instanceof SpeechClassifiedData) {
      if (!((SpeechClassifiedData)next).isSpeech()) {
        return false;
      }
 else {
        speechTime+=getAudioTime(audio);
      }
    }
  }
  return true;
}
Program: 19638
Project: 19638
Buggy source:
/** 
 * Replicate the given cepstrum Data object into the first window+1 number of frames in the cepstraBuffer. This is the first cepstrum in the segment.
 * @param cepstrum the Data to replicate
 * @return the number of Features that can be computed
 */
private int processFirstCepstrum(Data cepstrum) throws DataProcessingException {
  if (cepstrum instanceof DataEndSignal) {
    outputQueue.add(cepstrum);
    return 0;
  }
 else   if (cepstrum instanceof DataStartSignal) {
    throw new Error("String_Node_Str");
  }
 else {
    Arrays.fill(cepstraBuffer,0,window + 1,cepstrum);
    bufferPosition=window + 1;
    bufferPosition%=cepstraBufferSize;
    currentPosition=window;
    currentPosition%=cepstraBufferSize;
    int numberFeatures=1;
    pendingSignal=null;
    for (int i=0; i < window; i++) {
      Data next=getNextData();
      if (next != null) {
        if (next instanceof DoubleData) {
          addCepstrum((DoubleData)next);
        }
 else         if (next instanceof DataEndSignal || next instanceof SpeechEndSignal) {
          pendingSignal=(Signal)next;
          replicateLastCepstrum();
          numberFeatures+=i;
          break;
        }
 else         if (next instanceof DataStartSignal) {
          throw new Error("String_Node_Str");
        }
      }
    }
    return numberFeatures;
  }
}

Fixed version (ground truth):
/** 
 * Replicate the given cepstrum Data object into the first window+1 number of frames in the cepstraBuffer. This is the first cepstrum in the segment.
 * @param cepstrum the Data to replicate
 * @return the number of Features that can be computed
 * @throws edu.cmu.sphinx.frontend.DataProcessingException
 */
private int processFirstCepstrum(Data cepstrum) throws DataProcessingException {
  if (cepstrum instanceof DataEndSignal) {
    outputQueue.add(cepstrum);
    return 0;
  }
 else   if (cepstrum instanceof DataStartSignal) {
    throw new Error("String_Node_Str");
  }
 else {
    Arrays.fill(cepstraBuffer,0,window + 1,cepstrum);
    bufferPosition=window + 1;
    bufferPosition%=cepstraBufferSize;
    currentPosition=window;
    currentPosition%=cepstraBufferSize;
    int numberFeatures=1;
    pendingSignal=null;
    for (int i=0; i < window; i++) {
      Data next=getNextData();
      if (next != null) {
        if (next instanceof DoubleData) {
          addCepstrum((DoubleData)next);
        }
 else         if (next instanceof DataEndSignal || next instanceof SpeechEndSignal) {
          pendingSignal=(Signal)next;
          replicateLastCepstrum();
          numberFeatures+=i;
          break;
        }
 else         if (next instanceof DataStartSignal) {
          throw new Error("String_Node_Str");
        }
      }
    }
    return numberFeatures;
  }
}
Program: 19639
Project: 19639
Buggy source:
/** 
 * Read a Data object from the predecessor DataProcessor, and increment the ID count appropriately.
 * @return the read Data object
 */
private Data readData() throws DataProcessingException {
  Data frame=getPredecessor().getData();
  if (frame != null) {
    id++;
  }
  return frame;
}

Fixed version (ground truth):
/** 
 * Read a Data object from the predecessor DataProcessor, and increment the ID count appropriately.
 * @return the read Data object
 * @throws edu.cmu.sphinx.frontend.DataProcessingException
 */
private Data readData() throws DataProcessingException {
  Data frame=getPredecessor().getData();
  if (frame != null) {
    id++;
  }
  return frame;
}