Program: 75470
Project: 75470
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. 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 {
  _firingsPerScheduleIteration=1;
  _firingsSoFar=0;
  super.preinitialize();
  FSMActor ctrl=getController();
  State initialState=ctrl.getInitialState();
  if (_debug_info) {
    System.out.println(getName() + "String_Node_Str" + "String_Node_Str"+ initialState.getName());
  }
  TypedCompositeActor curRefinement=(TypedCompositeActor)(initialState.getRefinement())[0];
  if (curRefinement != null) {
    Director refinementDir=curRefinement.getDirector();
    if (_debug_info) {
      System.out.println(getName() + "String_Node_Str" + "String_Node_Str"+ refinementDir.getName());
    }
    if (refinementDir instanceof HDFFSMDirector) {
      refinementDir.preinitialize();
    }
 else     if (refinementDir instanceof SDFDirector) {
      Scheduler refinmentSched=((StaticSchedulingDirector)refinementDir).getScheduler();
      refinmentSched.setValid(true);
      refinmentSched.getSchedule();
    }
 else     if (refinementDir instanceof HDFDirector) {
      Scheduler refinmentSched=((StaticSchedulingDirector)refinementDir).getScheduler();
      refinmentSched.setValid(false);
      ((HDFDirector)refinementDir).getSchedule();
      if (_debug_info)       System.out.println(getName() + "String_Node_Str" + refinementDir.getFullName());
      if (_debug_info) {
        CompositeActor container=(CompositeActor)getContainer();
        System.out.println(getName() + "String_Node_Str" + ((Nameable)container).getName());
      }
    }
 else {
      throw new IllegalActionException(this,"String_Node_Str" + "String_Node_Str");
    }
    _updateInputTokenConsumptionRates(curRefinement);
    _updateOutputTokenProductionRates(curRefinement);
    if (_debug_info)     System.out.println(getName() + "String_Node_Str" + "String_Node_Str");
    CompositeActor hdfActor=_getHighestFSM();
    Director director=hdfActor.getExecutiveDirector();
    ((StaticSchedulingDirector)director).invalidateSchedule();
  }
 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. 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 {
  _firingsPerScheduleIteration=1;
  _firingsSoFar=0;
  super.preinitialize();
  FSMActor ctrl=getController();
  State initialState=ctrl.getInitialState();
  if (_debug_info) {
    System.out.println(getName() + "String_Node_Str" + "String_Node_Str"+ initialState.getName());
  }
  TypedCompositeActor curRefinement=(TypedCompositeActor)(initialState.getRefinement())[0];
  if (curRefinement != null) {
    Director refinementDir=curRefinement.getDirector();
    if (_debug_info) {
      System.out.println(getName() + "String_Node_Str" + "String_Node_Str"+ curRefinement.getFullName());
      System.out.println(getName() + "String_Node_Str" + "String_Node_Str"+ refinementDir.getFullName());
    }
    if (refinementDir instanceof HDFFSMDirector) {
      refinementDir.preinitialize();
    }
 else     if (refinementDir instanceof HDFDirector) {
      Scheduler refinmentSched=((StaticSchedulingDirector)refinementDir).getScheduler();
      refinmentSched.setValid(false);
      ((HDFDirector)refinementDir).getSchedule();
      if (_debug_info)       System.out.println(getName() + "String_Node_Str" + refinementDir.getFullName());
      if (_debug_info) {
        CompositeActor container=(CompositeActor)getContainer();
        System.out.println(getName() + "String_Node_Str" + ((Nameable)container).getName());
      }
    }
 else     if (refinementDir instanceof SDFDirector) {
      Scheduler refinmentSched=((StaticSchedulingDirector)refinementDir).getScheduler();
      refinmentSched.setValid(false);
      refinmentSched.getSchedule();
    }
 else {
      throw new IllegalActionException(this,"String_Node_Str" + "String_Node_Str");
    }
    _updateInputTokenConsumptionRates(curRefinement);
    _updateOutputTokenProductionRates(curRefinement);
    if (_debug_info)     System.out.println(getName() + "String_Node_Str" + "String_Node_Str");
    CompositeActor hdfActor=_getHighestFSM();
    Director director=hdfActor.getExecutiveDirector();
    ((StaticSchedulingDirector)director).invalidateSchedule();
  }
 else {
    throw new IllegalActionException(this,"String_Node_Str");
  }
}