Program: 19669
Project: 19669
Buggy source:
/** 
 * Times the lingust
 * @param numRuns   the number of simulated runs
 * @param numFrames the number of simulated frames
 * @param maxBeam   the size of the beam
 */
public void timeLinguist(int numRuns,int numFrames,int maxBeam){
  Random random=new Random(1000);
  Timer frameTimer=Timer.getTimer("String_Node_Str");
  Timer totalTimer=Timer.getTimer("String_Node_Str");
  System.out.println("String_Node_Str" + numRuns + "String_Node_Str"+ numFrames+ "String_Node_Str"+ maxBeam);
  totalTimer.start();
  for (int runs=0; runs < numRuns; runs++) {
    int level=0;
    List activeList=new ArrayList();
    activeList.add(linguist.getSearchGraph().getInitialState());
    linguist.startRecognition();
    for (int i=0; i < numFrames; i++) {
      List oldList=activeList;
      activeList=new ArrayList(maxBeam * 10);
      frameTimer.start();
      for (int j=0; j < oldList.size(); j++) {
        SearchState nextStates=(SearchState)oldList.get(j);
        expandState(level,activeList,nextStates);
      }
      frameTimer.stop();
      Collections.shuffle(activeList,random);
      if (activeList.size() > maxBeam) {
        activeList=activeList.subList(0,maxBeam);
      }
    }
    linguist.stopRecognition();
    frameTimer.dump();
  }
  totalTimer.stop();
  System.out.println("String_Node_Str" + maxSuccessors);
  System.out.println("String_Node_Str" + totalStates);
  System.out.println("String_Node_Str" + totalEmittingStates);
  System.out.println("String_Node_Str" + totalNonEmittingStates);
  System.out.println("String_Node_Str" + totalFinalStates);
  Timer.dumpAll();
}

Fixed version (ground truth):
/** 
 * Times the lingust
 * @param numRuns   the number of simulated runs
 * @param numFrames the number of simulated frames
 * @param maxBeam   the size of the beam
 */
public void timeLinguist(int numRuns,int numFrames,int maxBeam){
  Random random=new Random(1000);
  Timer frameTimer=TimerPool.getTimer("String_Node_Str");
  Timer totalTimer=TimerPool.getTimer("String_Node_Str");
  System.out.println("String_Node_Str" + numRuns + "String_Node_Str"+ numFrames+ "String_Node_Str"+ maxBeam);
  totalTimer.start();
  for (int runs=0; runs < numRuns; runs++) {
    int level=0;
    List activeList=new ArrayList();
    activeList.add(linguist.getSearchGraph().getInitialState());
    linguist.startRecognition();
    for (int i=0; i < numFrames; i++) {
      List oldList=activeList;
      activeList=new ArrayList(maxBeam * 10);
      frameTimer.start();
      for (int j=0; j < oldList.size(); j++) {
        SearchState nextStates=(SearchState)oldList.get(j);
        expandState(level,activeList,nextStates);
      }
      frameTimer.stop();
      Collections.shuffle(activeList,random);
      if (activeList.size() > maxBeam) {
        activeList=activeList.subList(0,maxBeam);
      }
    }
    linguist.stopRecognition();
    frameTimer.dump();
  }
  totalTimer.stop();
  System.out.println("String_Node_Str" + maxSuccessors);
  System.out.println("String_Node_Str" + totalStates);
  System.out.println("String_Node_Str" + totalEmittingStates);
  System.out.println("String_Node_Str" + totalNonEmittingStates);
  System.out.println("String_Node_Str" + totalFinalStates);
  TimerPool.dumpAll();
}