Program: 76114
Project: 76114
Buggy source:
/** 
 * Create receivers and invoke the preinitialize() methods of all actors deeply contained by the container of this director.  Propagate the consumption and production rates of the current state out to the corresponding ports of the container of this director. Note that in HDF, distinct current refinements may have distinct type signatures (port rates). This method is invoked once per execution, before any iteration, and before the initialize() method.
 * @exception IllegalActionException If the preinitialize() method ofone of the associated actors throws it, or there is no controller.
 */
public void preinitialize() throws IllegalActionException {
  super.preinitialize();
  _buildLocalReceiverMaps();
  FSMActor ctrl=getController();
  State initialState=ctrl.getInitialState();
  TypedCompositeActor curRefinement=(TypedCompositeActor)initialState.getRefinement();
  if (curRefinement != null) {
    CompositeActor container=(CompositeActor)getContainer();
    if (_debugging)     _debug("String_Node_Str" + ((Nameable)container).getName());
    SDFDirector sdfDir=(SDFDirector)(container.getExecutiveDirector());
    Scheduler s=sdfDir.getScheduler();
    _updateInputTokenConsumptionRates(curRefinement);
    _updateOutputTokenProductionRates(curRefinement);
    if (_debugging)     _debug("String_Node_Str" + "String_Node_Str");
    s.setValid(false);
  }
 else {
    throw new IllegalActionException(this,"String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Create receivers and invoke the preinitialize() methods of all actors deeply contained by the container of this director.  Propagate the consumption and production rates of the current state out to the corresponding ports of the container of this director. Note that in HDF, distinct current refinements may have distinct type signatures (port rates). This method is invoked once per execution, before any iteration, and before the initialize() method.
 * @exception IllegalActionException If the preinitialize() method ofone of the associated actors throws it, or there is no controller.
 */
public void preinitialize() throws IllegalActionException {
  super.preinitialize();
  _buildLocalReceiverMaps();
  FSMActor ctrl=getController();
  State initialState=ctrl.getInitialState();
  TypedCompositeActor curRefinement=(TypedCompositeActor)initialState.getRefinement();
  if (curRefinement != null) {
    SDFDirector refinementDir=(SDFDirector)curRefinement.getDirector();
    Scheduler refinmentSched=refinementDir.getScheduler();
    refinmentSched.setValid(false);
    refinmentSched.schedule();
    if (_debugging)     _debug("String_Node_Str" + refinementDir.getFullName());
    CompositeActor container=(CompositeActor)getContainer();
    if (_debugging)     _debug("String_Node_Str" + ((Nameable)container).getName());
    SDFDirector sdfDir=(SDFDirector)(container.getExecutiveDirector());
    Scheduler s=sdfDir.getScheduler();
    _updateInputTokenConsumptionRates(curRefinement);
    _updateOutputTokenProductionRates(curRefinement);
    if (_debugging)     _debug("String_Node_Str" + "String_Node_Str");
    s.setValid(false);
  }
 else {
    throw new IllegalActionException(this,"String_Node_Str");
  }
}