Program: 75256
Project: 75256
Buggy source:
/** 
 * Set the values of input variables in the mode controller. If the refinement of the current state of the mode controller is ready to fire, then fire the current refinement. Choose a transition if this FSM is embedded in SDF, otherwise request to choose a transition to the manager.
 * @exception IllegalActionException If there is no controller.
 */
public void fire() throws IllegalActionException {
  CompositeActor container=(CompositeActor)getContainer();
  FSMActor controller=getController();
  controller.setNewIteration(_sendRequest);
  _readInputs();
  Transition transition;
  State state=controller.currentState();
  Actor[] actors=controller.currentState().getRefinement();
  _fireRefinement=false;
  if (actors != null) {
    for (int i=0; i < actors.length; ++i) {
      if (_stopRequested)       break;
      if (actors[i].prefire()) {
        actors[i].fire();
        actors[i].postfire();
      }
    }
  }
  _readOutputsFromRefinement();
  if (_embeddedInSDF) {
    state=chooseStateTransition(state);
    actors=state.getRefinement();
    while (actors == null) {
      super.postfire();
      state=chooseStateTransition(state);
      transition=_getLastChosenTransition();
      if (transition == null)       throw new IllegalActionException(this,"String_Node_Str" + "String_Node_Str");
      actors=(transition.destinationState()).getRefinement();
    }
  }
  if (_sendRequest && !_embeddedInSDF) {
    ChangeRequest request=new ChangeRequest(this,"String_Node_Str"){
      protected void _execute() throws KernelException, IllegalActionException {
        FSMActor controller=getController();
        State state=controller.currentState();
        TypedActor[] actors;
        Transition transition;
        state=chooseStateTransition(state);
        actors=state.getRefinement();
        while (actors == null) {
          superPostfire();
          state=chooseStateTransition(state);
          transition=_getLastChosenTransition();
          if (transition == null) {
            throwTransientException();
          }
 else {
            actors=(transition.destinationState()).getRefinement();
          }
        }
      }
    }
;
    request.setPersistent(false);
    container.requestChange(request);
  }
  return;
}

Fixed version (ground truth):
/** 
 * Set the values of input variables in the mode controller. If the refinement of the current state of the mode controller is ready to fire, then fire the current refinement. Choose a transition if this FSM is embedded in SDF, otherwise request to choose a transition to the manager.
 * @exception IllegalActionException If there is no controller.
 */
public void fire() throws IllegalActionException {
  CompositeActor container=(CompositeActor)getContainer();
  FSMActor controller=getController();
  controller.setNewIteration(_sendRequest);
  _readInputs();
  Transition transition;
  State state=controller.currentState();
  _previousIntransientState=state;
  Actor[] actors=controller.currentState().getRefinement();
  _fireRefinement=false;
  if (actors != null) {
    for (int i=0; i < actors.length; ++i) {
      if (_stopRequested)       break;
      if (actors[i].prefire()) {
        actors[i].fire();
        actors[i].postfire();
      }
    }
  }
  _readOutputsFromRefinement();
  if (_embeddedInSDF) {
    state=chooseStateTransition(state);
    actors=state.getRefinement();
    while (actors == null) {
      super.postfire();
      state=chooseStateTransition(state);
      transition=_getLastChosenTransition();
      if (transition == null)       throw new IllegalActionException(this,"String_Node_Str" + "String_Node_Str");
      actors=(transition.destinationState()).getRefinement();
    }
  }
  if (_sendRequest && !_embeddedInSDF) {
    ChangeRequest request=new ChangeRequest(this,"String_Node_Str"){
      protected void _execute() throws KernelException, IllegalActionException {
        FSMActor controller=getController();
        State state=controller.currentState();
        TypedActor[] actors;
        Transition transition;
        state=chooseStateTransition(state);
        actors=state.getRefinement();
        while (actors == null) {
          superPostfire();
          state=chooseStateTransition(state);
          transition=_getLastChosenTransition();
          if (transition == null) {
            throwTransientException();
          }
 else {
            actors=(transition.destinationState()).getRefinement();
          }
        }
      }
    }
;
    request.setPersistent(false);
    container.requestChange(request);
  }
  return;
}