Program: 19780
Project: 19780
Buggy source:
/** 
 * Collects the next set of emitting tokens from a token and accumulates them in the active or result lists
 * @param token the token to collect successors from
 */
protected void collectSuccessorTokens(Token token){
  SearchState state=token.getSearchState();
  if (token.isFinal()) {
    resultList.add(token);
  }
  if (token.getScore() < threshold) {
    return;
  }
  if (state instanceof WordSearchState && token.getScore() < wordThreshold) {
    return;
  }
  SearchStateArc[] arcs=state.getSuccessors();
  for (int i=0; i < arcs.length; i++) {
    SearchStateArc arc=arcs[i];
    SearchState nextState=arc.getState();
    float logEntryScore=token.getScore() + arc.getProbability();
    if (wantEntryPruning) {
      if (logEntryScore < threshold) {
        continue;
      }
      if (nextState instanceof WordSearchState && logEntryScore < wordThreshold) {
        continue;
      }
    }
    Token bestToken=getBestToken(nextState);
    boolean firstToken=bestToken == null;
    if (firstToken || bestToken.getScore() <= logEntryScore) {
      Token newToken=token.child(nextState,logEntryScore,arc.getLanguageProbability(),arc.getInsertionProbability(),currentFrameNumber);
      tokensCreated.value++;
      setBestToken(newToken,nextState);
      if (!newToken.isEmitting()) {
        collectSuccessorTokens(newToken);
      }
 else {
        if (firstToken) {
          activeList.add(newToken);
        }
 else {
          activeList.replace(bestToken,newToken);
          viterbiPruned.value++;
        }
      }
    }
 else {
      viterbiPruned.value++;
    }
  }
}

Fixed version (ground truth):
/** 
 * Collects the next set of emitting tokens from a token and accumulates them in the active or result lists
 * @param token the token to collect successors from
 */
protected void collectSuccessorTokens(Token token){
  SearchState state=token.getSearchState();
  if (token.isFinal()) {
    resultList.add(token);
  }
  if (token.getScore() < threshold) {
    return;
  }
  if (state instanceof WordSearchState && token.getScore() < wordThreshold) {
    return;
  }
  SearchStateArc[] arcs=state.getSuccessors();
  for (int i=0; i < arcs.length; i++) {
    SearchStateArc arc=arcs[i];
    SearchState nextState=arc.getState();
    float logEntryScore=token.getScore() + arc.getProbability();
    if (wantEntryPruning) {
      if (logEntryScore < threshold) {
        continue;
      }
      if (nextState instanceof WordSearchState && logEntryScore < wordThreshold) {
        continue;
      }
    }
    Token bestToken=getBestToken(nextState);
    boolean firstToken=bestToken == null;
    if (firstToken || bestToken.getScore() <= logEntryScore) {
      Token newToken=token.child(nextState,logEntryScore,arc.getLanguageProbability(),arc.getInsertionProbability(),currentFrameNumber);
      tokensCreated.value++;
      setBestToken(newToken,nextState);
      if (!newToken.isEmitting()) {
        if (!isVisited(newToken)) {
          collectSuccessorTokens(newToken);
        }
      }
 else {
        if (firstToken) {
          activeList.add(newToken);
        }
 else {
          activeList.replace(bestToken,newToken);
          viterbiPruned.value++;
        }
      }
    }
 else {
      viterbiPruned.value++;
    }
  }
}