Program: 73117
Project: 73117
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 {
  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();
  _lastChosenTransition=null;
  _outputsThatMustBeUnknown.clear();
  _transitionRefinementsToPostfire.clear();
  _stateRefinementsToPostfire.clear();
  if (_debugging) {
    _debug("String_Node_Str");
  }
  List<Transition> transitionList=_currentState.nonErrorNonTerminationTransitionList();
  _chooseTransitions(transitionList,true,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);
              }
            }
          }
        }
      }
    }
  }
 else {
    if (!foundUnknown()) {
      Actor[] stateRefinements=_currentState.getRefinement();
      if (stateRefinements != null) {
        try {
          for (int i=0; i < stateRefinements.length; ++i) {
            if (_stopRequested || _disabledRefinements.contains(stateRefinements[i])) {
              continue;
            }
            _setTimeForRefinement(stateRefinements[i]);
            if (stateRefinements[i].prefire()) {
              if (_debugging) {
                _debug("String_Node_Str",stateRefinements[i].getName());
              }
              stateRefinements[i].fire();
              _stateRefinementsToPostfire.add(stateRefinements[i]);
            }
          }
        }
 catch (        Throwable ex) {
          if (_lastChosenTransitions.size() == 0) {
            _chooseErrorTransition(ex);
          }
          if (_lastChosenTransitions.size() > 0) {
            if (inModalModel) {
              director.setModelTime(environmentTime);
            }
            return;
          }
          throw new IllegalActionException(this,ex,"String_Node_Str");
        }
      }
      if (inModalModel) {
        director.setModelTime(environmentTime);
      }
      readOutputsFromRefinement();
      if (_debugging) {
        _debug("String_Node_Str");
      }
      List<Transition> terminationTransitions=_currentState.terminationTransitionList();
      boolean checkTerminationTransitions=false;
      if (terminationTransitions.size() > 0) {
        TypedActor[] refinements=_currentState.getRefinement();
        if (refinements != null && refinements.length > 0) {
          checkTerminationTransitions=true;
          for (          Actor refinementActor : refinements) {
            if (refinementActor instanceof ModalRefinement) {
              ModalRefinement refinement=(ModalRefinement)refinementActor;
              FSMActor refinementController=refinement.getController();
              State destinationState=refinementController._destinationState();
              if (!(((BooleanToken)refinementController.currentState().isFinalState.getToken()).booleanValue()) && (destinationState == null || !((BooleanToken)destinationState.isFinalState.getToken()).booleanValue())) {
                checkTerminationTransitions=false;
                break;
              }
            }
 else {
              checkTerminationTransitions=false;
              break;
            }
          }
        }
      }
      if (checkTerminationTransitions) {
        _chooseTransitions(_currentState.nonpreemptiveTransitionList(),false,false);
      }
 else {
        _chooseTransitions(transitionList,false,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();
  _lastChosenTransition=null;
  _outputsThatMustBeUnknown.clear();
  _transitionRefinementsToPostfire.clear();
  _stateRefinementsToPostfire.clear();
  if (_debugging) {
    _debug("String_Node_Str");
  }
  List<Transition> transitionList=_currentState.nonErrorNonTerminationTransitionList();
  _chooseTransitions(transitionList,true,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);
              }
            }
          }
        }
      }
    }
  }
 else {
    if (!foundUnknown()) {
      Actor[] stateRefinements=_currentState.getRefinement();
      if (stateRefinements != null) {
        try {
          for (int i=0; i < stateRefinements.length; ++i) {
            if (_stopRequested || _disabledRefinements.contains(stateRefinements[i])) {
              continue;
            }
            _setTimeForRefinement(stateRefinements[i]);
            if (stateRefinements[i].prefire()) {
              if (_debugging) {
                _debug("String_Node_Str",stateRefinements[i].getName());
              }
              if (_modelErrorHandled == null) {
                stateRefinements[i].fire();
                if (_modelErrorHandled == null) {
                  _stateRefinementsToPostfire.add(stateRefinements[i]);
                }
              }
            }
          }
        }
 catch (        Throwable ex) {
          _chooseErrorTransition(ex);
          if (_lastChosenTransitions.size() > 0) {
            if (inModalModel) {
              director.setModelTime(environmentTime);
            }
            return;
          }
          throw new IllegalActionException(this,ex,"String_Node_Str");
        }
        if (_modelErrorHandled != null) {
          _chooseErrorTransition(_modelErrorHandled);
          if (inModalModel) {
            director.setModelTime(environmentTime);
          }
          return;
        }
      }
      if (inModalModel) {
        director.setModelTime(environmentTime);
      }
      readOutputsFromRefinement();
      if (_debugging) {
        _debug("String_Node_Str");
      }
      List<Transition> terminationTransitions=_currentState.terminationTransitionList();
      boolean checkTerminationTransitions=false;
      if (terminationTransitions.size() > 0) {
        TypedActor[] refinements=_currentState.getRefinement();
        if (refinements != null && refinements.length > 0) {
          checkTerminationTransitions=true;
          for (          Actor refinementActor : refinements) {
            if (refinementActor instanceof ModalRefinement) {
              ModalRefinement refinement=(ModalRefinement)refinementActor;
              FSMActor refinementController=refinement.getController();
              State destinationState=refinementController._destinationState();
              if (!(((BooleanToken)refinementController.currentState().isFinalState.getToken()).booleanValue()) && (destinationState == null || !((BooleanToken)destinationState.isFinalState.getToken()).booleanValue())) {
                checkTerminationTransitions=false;
                break;
              }
            }
 else {
              checkTerminationTransitions=false;
              break;
            }
          }
        }
      }
      if (checkTerminationTransitions) {
        _chooseTransitions(_currentState.nonpreemptiveTransitionList(),false,false);
      }
 else {
        _chooseTransitions(transitionList,false,false);
      }
    }
  }
  _assertAbsentOutputs(this);
}