Program: 75164
Project: 75164
Buggy source:
/** 
 * Set up new state and connection map if exactly one transition is enabled. Get the schedule of the current refinement and propagate its port rates to the outside.
 * @return True if the super class method returns true.
 * @exception IllegalActionException If a refinement throws it,if there is no controller, or if an inconsistency in port rates is detected between refinement actors.
 */
public boolean makeStateTransition() throws IllegalActionException {
  FSMActor controller=getController();
  State currentState=controller.currentState();
  Transition lastChosenTransition=_getLastChosenTransition();
  TypedCompositeActor actor;
  Director refinementDir;
  boolean superPostfire;
  if (lastChosenTransition == null) {
    TypedActor[] actors=currentState.getRefinement();
    actor=(TypedCompositeActor)(actors[0]);
    superPostfire=super.postfire();
  }
 else {
    State newState=lastChosenTransition.destinationState();
    _setCurrentState(newState);
    superPostfire=super.postfire();
    currentState=newState;
    TypedActor[] actors=currentState.getRefinement();
    actor=(TypedCompositeActor)(actors[0]);
    refinementDir=actor.getDirector();
    if (refinementDir instanceof HDFFSMDirector) {
      refinementDir.postfire();
    }
 else     if (refinementDir instanceof HDFDirector) {
      Scheduler refinmentSched=((StaticSchedulingDirector)refinementDir).getScheduler();
      refinmentSched.setValid(false);
      ((HDFDirector)refinementDir).getSchedule();
    }
 else     if (refinementDir instanceof SDFDirector) {
      Scheduler refinmentSched=((StaticSchedulingDirector)refinementDir).getScheduler();
      refinmentSched.setValid(true);
      ((SDFScheduler)refinmentSched).getSchedule();
    }
 else {
      throw new IllegalActionException(this,"String_Node_Str" + "String_Node_Str");
    }
  }
  _updateInputTokenConsumptionRates(actor);
  _updateOutputTokenProductionRates(actor);
  CompositeActor hdfActor=_getEnclosingDomainActor();
  Director director=hdfActor.getExecutiveDirector();
  if (director instanceof HDFDirector) {
    ((HDFDirector)director).invalidateSchedule();
  }
  return superPostfire;
}

Fixed version (ground truth):
/** 
 * Set up new state and connection map if exactly one transition is enabled. Get the schedule of the current refinement and propagate its port rates to the outside.
 * @return True if the super class method returns true.
 * @exception IllegalActionException If a refinement throws it,if there is no controller, or if an inconsistency in port rates is detected between refinement actors.
 */
public boolean makeStateTransition() throws IllegalActionException {
  FSMActor controller=getController();
  State currentState=controller.currentState();
  Transition lastChosenTransition=_getLastChosenTransition();
  TypedCompositeActor actor;
  Director refinementDir;
  boolean superPostfire;
  if (lastChosenTransition == null) {
    TypedActor[] actors=currentState.getRefinement();
    if (actors.length != 1) {
      throw new IllegalActionException(this,"String_Node_Str" + currentState.getName());
    }
    actor=(TypedCompositeActor)(actors[0]);
    superPostfire=super.postfire();
  }
 else {
    State newState=lastChosenTransition.destinationState();
    _setCurrentState(newState);
    superPostfire=super.postfire();
    currentState=newState;
    TypedActor[] actors=currentState.getRefinement();
    if (actors.length != 1) {
      throw new IllegalActionException(this,"String_Node_Str" + currentState.getName());
    }
    actor=(TypedCompositeActor)(actors[0]);
    refinementDir=actor.getDirector();
    if (refinementDir instanceof HDFFSMDirector) {
      refinementDir.postfire();
    }
 else     if (refinementDir instanceof StaticSchedulingDirector) {
      refinementDir.invalidateSchedule();
      ((StaticSchedulingDirector)refinementDir).getScheduler().getSchedule();
    }
  }
  _updateInputTokenConsumptionRates(actor);
  _updateOutputTokenProductionRates(actor);
  CompositeActor hdfActor=_getEnclosingDomainActor();
  Director director=hdfActor.getExecutiveDirector();
  director.invalidateSchedule();
  return superPostfire;
}