Program: 154436
Project: 154436
Buggy source:
public synchronized void check(Event event){
  if (!checkerEnabled) {
    return;
  }
  checkerEnabled=false;
  if (logState) {
    boolean first=true;
    System.out.printf("String_Node_Str");
    for (    State s : states) {
      System.out.printf("String_Node_Str",first ? "String_Node_Str" : "String_Node_Str",automaton.vertexNames[s.vertex],s.events.size(),s.store.size());
      first=false;
    }
    System.out.printf("String_Node_Str");
    System.out.printf("String_Node_Str",event.id,automaton.eventNames[event.id]);
  }
  HashSet<State> newActiveStates=new HashSet<State>(2 * states.size());
  for (  State state : states) {
    if (automaton.transitions[state.vertex].length == 0) {
      continue;
    }
    if (!automaton.isObservable(event.id,state.vertex)) {
      newActiveStates.add(state);
      continue;
    }
    state=state.pushEvent(event);
    if (state.events.size() < automaton.maximumTransitionDepths[state.vertex]) {
      newActiveStates.add(state);
      continue;
    }
    boolean anyEnabled=false;
    for (    Transition transition : automaton.transitions[state.vertex]) {
      Treap<Binding> store=state.store;
      Queue<Event> events=state.events;
      Queue<Event> consumed=Queue.empty();
      int i;
      for (i=0; i < transition.steps.length; ++i) {
        TransitionStep step=transition.steps[i];
        Event stepEvent=events.top();
        events=events.pop();
        consumed=consumed.push(stepEvent);
        if (!step.evaluateGuard(stepEvent,store)) {
          break;
        }
        store=step.action.apply(stepEvent,store);
      }
      if (i == transition.steps.length) {
        anyEnabled=true;
        State newState=State.make(transition.target,store,events,consumed,state);
        newActiveStates.add(newState);
        String msg=automaton.errorMessages[transition.target];
        if (msg != null) {
          reportError(msg,newState);
        }
      }
    }
    if (!anyEnabled) {
      newActiveStates.add(state.popEvent());
    }
  }
  boolean doGc=true;
  for (  State s : newActiveStates) {
    if (s.time < 2 * historyLength) {
      doGc=false;
      break;
    }
  }
  if (doGc) {
    ArrayDeque<State> p;
    ArrayDeque<State> q=new ArrayDeque<State>();
    for (    State s : newActiveStates) {
      q.addLast(s);
      s.time=-1;
    }
    for (int i=1; i < historyLength; ++i) {
      p=q;
      q=new ArrayDeque<State>();
      for (      State s : p) {
        if (s.parent != null && s.parent.state.time != -1) {
          q.addLast(s.parent.state);
          s.parent.state.time=-1;
        }
      }
    }
    for (    State s : newActiveStates) {
      fixTimeOfState(s);
    }
  }
  states=newActiveStates;
  checkerEnabled=true;
}

Fixed version (ground truth):
public synchronized void check(Event event){
  if (!checkerEnabled) {
    return;
  }
  checkerEnabled=false;
  if (logState) {
    boolean first=true;
    System.out.printf("String_Node_Str");
    for (    State s : states) {
      System.out.printf("String_Node_Str",first ? "String_Node_Str" : "String_Node_Str",automaton.vertexNames[s.vertex],s.vertex,s.events.size(),s.store.size());
      first=false;
    }
    System.out.printf("String_Node_Str");
    System.out.printf("String_Node_Str",event.id,automaton.eventNames[event.id]);
  }
  HashSet<State> newActiveStates=new HashSet<State>(2 * states.size());
  for (  State state : states) {
    if (automaton.transitions[state.vertex].length == 0) {
      continue;
    }
    if (!automaton.isObservable(event.id,state.vertex)) {
      newActiveStates.add(state);
      continue;
    }
    state=state.pushEvent(event);
    if (state.events.size() < automaton.maximumTransitionDepths[state.vertex]) {
      newActiveStates.add(state);
      continue;
    }
    boolean anyEnabled=false;
    for (    Transition transition : automaton.transitions[state.vertex]) {
      Treap<Binding> store=state.store;
      Queue<Event> events=state.events;
      Queue<Event> consumed=Queue.empty();
      int i;
      for (i=0; i < transition.steps.length; ++i) {
        TransitionStep step=transition.steps[i];
        Event stepEvent=events.top();
        events=events.pop();
        consumed=consumed.push(stepEvent);
        if (!step.evaluateGuard(stepEvent,store)) {
          break;
        }
        store=step.action.apply(stepEvent,store);
      }
      if (i == transition.steps.length) {
        anyEnabled=true;
        State newState=State.make(transition.target,store,events,consumed,state);
        newActiveStates.add(newState);
        String msg=automaton.errorMessages[transition.target];
        if (msg != null) {
          reportError(msg,newState);
        }
      }
    }
    if (!anyEnabled) {
      newActiveStates.add(state.popEvent());
    }
  }
  boolean doGc=true;
  for (  State s : newActiveStates) {
    if (s.time < 2 * historyLength) {
      doGc=false;
      break;
    }
  }
  if (doGc) {
    ArrayDeque<State> p;
    ArrayDeque<State> q=new ArrayDeque<State>();
    for (    State s : newActiveStates) {
      q.addLast(s);
      s.time=-1;
    }
    for (int i=1; i < historyLength; ++i) {
      p=q;
      q=new ArrayDeque<State>();
      for (      State s : p) {
        if (s.parent != null && s.parent.state.time != -1) {
          q.addLast(s.parent.state);
          s.parent.state.time=-1;
        }
      }
    }
    for (    State s : newActiveStates) {
      fixTimeOfState(s);
    }
  }
  states=newActiveStates;
  checkerEnabled=true;
}