Program: 73243
Project: 73243
Buggy source:
/** 
 * Set the values of input variables. Choose the enabled transition among the outgoing transitions of the current state. Throw an exception if there is more than one transition enabled. Otherwise, execute the output actions contained by the chosen transition.
 * @exception IllegalActionException If there is more than onetransition enabled.
 */
public void fire() throws IllegalActionException {
  Time environmentTime=_getEnvironmentTime();
  Director director=getDirector();
  boolean inModalModel=false;
  if (director instanceof FSMDirector) {
    inModalModel=true;
    director.setModelTime(environmentTime);
  }
  readInputs();
  _lastChosenTransitions.clear();
  _transitionRefinementsToPostfire.clear();
  _stateRefinementsToPostfire.clear();
  List<Transition> transitionList=_currentState.preemptiveTransitionList();
  _chooseTransitions(transitionList,false);
  if (_lastChosenTransitions.size() > 0) {
    if (inModalModel) {
      director.setModelTime(environmentTime);
    }
    TypedActor[] refinements=_currentState.getRefinement();
    if (refinements != null) {
      for (      Actor refinementActor : refinements) {
        if (refinementActor instanceof CompositeActor) {
          CompositeActor refinement=(CompositeActor)refinementActor;
          for (          IOPort refinementPort : ((List<IOPort>)refinement.outputPortList())) {
            if (!refinementPort.isKnown()) {
              refinementPort.sendClear(0);
            }
          }
        }
      }
    }
    readOutputsFromRefinement();
  }
 else {
    if (!foundUnknown()) {
      Actor[] stateRefinements=_currentState.getRefinement();
      if (stateRefinements != null) {
        for (int i=0; i < stateRefinements.length; ++i) {
          if (_stopRequested || _disabledRefinements.contains(stateRefinements[i])) {
            break;
          }
          _setTimeForRefinement(stateRefinements[i]);
          if (stateRefinements[i].prefire()) {
            if (_debugging) {
              _debug("String_Node_Str",stateRefinements[i].getName());
            }
            stateRefinements[i].fire();
            _stateRefinementsToPostfire.add(stateRefinements[i]);
          }
        }
      }
      if (inModalModel) {
        director.setModelTime(environmentTime);
      }
      readOutputsFromRefinement();
      transitionList=_currentState.nonpreemptiveTransitionList();
      _chooseTransitions(transitionList,false);
    }
  }
  _assertAbsentOutputs(this);
}

Fixed version (ground truth):
/** 
 * Set the values of input variables. Choose the enabled transition among the outgoing transitions of the current state. Throw an exception if there is more than one transition enabled. Otherwise, execute the output actions contained by the chosen transition.
 * @exception IllegalActionException If there is more than onetransition enabled.
 */
public void fire() throws IllegalActionException {
  if (_debugging) {
    _debug("String_Node_Str");
  }
  Time environmentTime=_getEnvironmentTime();
  Director director=getDirector();
  boolean inModalModel=false;
  if (director instanceof FSMDirector) {
    inModalModel=true;
    director.setModelTime(environmentTime);
  }
  readInputs();
  _lastChosenTransitions.clear();
  _transitionRefinementsToPostfire.clear();
  _stateRefinementsToPostfire.clear();
  if (_debugging) {
    _debug("String_Node_Str");
  }
  List<Transition> transitionList=_currentState.preemptiveTransitionList();
  _chooseTransitions(transitionList,false);
  if (_lastChosenTransitions.size() > 0) {
    if (inModalModel) {
      director.setModelTime(environmentTime);
    }
    TypedActor[] refinements=_currentState.getRefinement();
    if (refinements != null) {
      for (      Actor refinementActor : refinements) {
        if (refinementActor instanceof CompositeActor) {
          CompositeActor refinement=(CompositeActor)refinementActor;
          for (          IOPort refinementPort : ((List<IOPort>)refinement.outputPortList())) {
            for (int i=0; i < refinementPort.getWidth(); i++) {
              if (!refinementPort.isKnown(i)) {
                if (_debugging) {
                  _debug("String_Node_Str" + refinementPort.getName() + "String_Node_Str"+ i);
                }
                refinementPort.sendClear(i);
              }
            }
          }
        }
      }
    }
    readOutputsFromRefinement();
  }
 else {
    if (!foundUnknown()) {
      Actor[] stateRefinements=_currentState.getRefinement();
      if (stateRefinements != null) {
        for (int i=0; i < stateRefinements.length; ++i) {
          if (_stopRequested || _disabledRefinements.contains(stateRefinements[i])) {
            break;
          }
          _setTimeForRefinement(stateRefinements[i]);
          if (stateRefinements[i].prefire()) {
            if (_debugging) {
              _debug("String_Node_Str",stateRefinements[i].getName());
            }
            stateRefinements[i].fire();
            _stateRefinementsToPostfire.add(stateRefinements[i]);
          }
        }
      }
      if (inModalModel) {
        director.setModelTime(environmentTime);
      }
      readOutputsFromRefinement();
      transitionList=_currentState.nonpreemptiveTransitionList();
      if (_debugging) {
        _debug("String_Node_Str");
      }
      _chooseTransitions(transitionList,false);
    }
  }
  _assertAbsentOutputs(this);
}