nus-yam/ex-repair huggingface dataset:
Program: 75819
Project: 75819
Buggy source:
/** 
 * Consume a single IntToken on the input. Produce 32 consecutive BooleanTokens on the output port which is the bitwise representation of the input IntToken. The most significant bit is the first boolean token send out. The least significant bit is the last boolean token send out.
 * @exception IllegalActionException If there is no director.
 */
public final void fire() throws IllegalActionException {
  int i;
  int integer, remainder;
  IntToken token;
  BooleanToken[] bits;
  bits=new BooleanToken[32];
  token=(IntToken)(input.get(0));
  integer=token.intValue();
  for (i=31; i >= 0; i--) {
    remainder=integer % 2;
    integer=integer / 2;
    if (remainder == 0)     bits[i]=new BooleanToken(false);
 else     bits[i]=new BooleanToken(true);
  }
  output.send(0,bits,bits.length);
}

Fixed version (ground truth):
/** 
 * Consume a single IntToken on the input. Produce 32 consecutive BooleanTokens on the output port which is the bitwise representation of the input IntToken. The most significant bit is the first boolean token send out. The least significant bit is the last boolean token send out.
 * @exception IllegalActionException If there is no director.
 */
public final void fire() throws IllegalActionException {
  int i;
  int integer, remainder;
  IntToken token;
  BooleanToken[] bits;
  bits=new BooleanToken[32];
  token=(IntToken)(input.get(0));
  integer=token.intValue();
  if (integer < 0) {
    bits[0]=new BooleanToken(true);
    integer=(int)(2147483648L + integer);
  }
 else {
    bits[0]=new BooleanToken(false);
  }
  for (i=31; i >= 1; i--) {
    remainder=integer % 2;
    integer=integer / 2;
    if (remainder == 0)     bits[i]=new BooleanToken(false);
 else     bits[i]=new BooleanToken(true);
  }
  output.send(0,bits,bits.length);
}
Program: 75820
Project: 75820
Buggy source:
/** 
 * Initialize the firing of the director by resetting state variables and resetting all receivers to have unknown status.
 */
private void _initFiring(){
  _postfireReturns=false;
  _actorsAllowedToFire=null;
  _actorsFired=null;
  _cachedAllInputsKnown=null;
  _cachedAllOutputsKnown=null;
  _lastNumOfActorsAllowedToFire=-1;
  _lastNumOfKnownReceivers=-1;
  _resetAllReceivers();
  _currentNumOfKnownReceivers=0;
}

Fixed version (ground truth):
/** 
 * Initialize the firing of the director by resetting state variables and resetting all receivers to have unknown status.
 */
private void _initFiring(){
  _postfireReturns=false;
  _actorsAllowedToFire=null;
  _actorsFired=null;
  _cachedAllInputsKnown=null;
  _cachedAllOutputsKnown=null;
  _lastNumOfActorsAllowedToFire=-1;
  _lastNumOfKnownReceivers=-1;
}
Program: 75821
Project: 75821
Buggy source:
/** 
 * Reset all receivers to allow a new firing of the director.
 */
private void _resetAllReceivers(){
  Iterator i=_receivers.iterator();
  while (i.hasNext()) {
    ((SRReceiver)i.next()).reset();
  }
}

Fixed version (ground truth):
/** 
 * Reset all receivers to allow a new firing of the director.
 */
private void _resetAllReceivers(){
  _currentNumOfKnownReceivers=0;
  Iterator i=_receivers.iterator();
  while (i.hasNext()) {
    ((SRReceiver)i.next()).reset();
  }
}
Program: 75822
Project: 75822
Buggy source:
/** 
 * Return false if the system has finished executing, either by reaching the iteration limit, or if no actors in the model return true in postfire.
 * @return True if the execution is not finished.
 * @exception IllegalActionException If the iterations parameter doesnot have a valid token.
 */
public boolean postfire() throws IllegalActionException {
  int numberOfIterations=getIterations();
  _iteration++;
  _debug("String_Node_Str",String.valueOf(_iteration - 1),"String_Node_Str");
  if ((numberOfIterations > 0) && (_iteration >= numberOfIterations)) {
    _iteration=0;
    return false;
  }
  return _postfireReturns;
}

Fixed version (ground truth):
/** 
 * Return false if the system has finished executing, either by reaching the iteration limit, or if no actors in the model return true in postfire.
 * @return True if the execution is not finished.
 * @exception IllegalActionException If the iterations parameter doesnot have a valid token.
 */
public boolean postfire() throws IllegalActionException {
  int numberOfIterations=getIterations();
  _iteration++;
  _debug("String_Node_Str",String.valueOf(_iteration - 1),"String_Node_Str");
  _resetAllReceivers();
  if ((numberOfIterations > 0) && (_iteration >= numberOfIterations)) {
    _iteration=0;
    return false;
  }
  return _postfireReturns;
}
Program: 75823
Project: 75823
Buggy source:
/** 
 * Initialize the director and invoke the initialize() methods of all  actors deeply contained by the container.
 * @exception IllegalActionException If the superclass throws it.
 */
public void initialize() throws IllegalActionException {
  super.initialize();
  _iteration=0;
  _actorsNotAllowedToIterate=null;
  _getSchedule();
}

Fixed version (ground truth):
/** 
 * Initialize the director and invoke the initialize() methods of all  actors deeply contained by the container.
 * @exception IllegalActionException If the superclass throws it.
 */
public void initialize() throws IllegalActionException {
  super.initialize();
  _iteration=0;
  _actorsNotAllowedToIterate=null;
  _resetAllReceivers();
  _getSchedule();
}
Program: 75825
Project: 75825
Buggy source:
/** 
 * Return true if the transition is enabled, that is the guard is true.
 * @return True if the transition is enabled.
 * @exception IllegalActionException If thrown when evaluating the guard.
 */
public boolean isEnabled() throws IllegalActionException {
  try {
    Token tok=_guard.getToken();
    return ((BooleanToken)tok).booleanValue();
  }
 catch (  UnknownResultException ex) {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * Return true if the transition is enabled, that is the guard is true.
 * @return True if the transition is enabled.
 * @exception IllegalActionException If thrown when evaluating the guard.
 */
public boolean isEnabled() throws IllegalActionException {
  try {
    Token tok=_guard.getToken();
    if (tok == null)     return false;
    return ((BooleanToken)tok).booleanValue();
  }
 catch (  UnknownResultException ex) {
    return false;
  }
}
Program: 75826
Project: 75826
Buggy source:
/** 
 * Initialize the director by creating the scheduler and the parameters.
 */
private void _init(){
  try {
    SRScheduler scheduler=new SRScheduler(this,uniqueName("String_Node_Str"));
    setScheduler(scheduler);
  }
 catch (  Exception ex) {
    throw new InternalErrorException("String_Node_Str" + ex.getMessage());
  }
  try {
    iterations=new Parameter(this,"String_Node_Str",new IntToken(0));
    iterations.setTypeEquals(BaseType.INT);
    setCurrentTime(0.0);
  }
 catch (  KernelException ex) {
    throw new InternalErrorException("String_Node_Str" + ex.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Initialize the director by creating the scheduler and the parameters.
 */
private void _init(){
  try {
    SRScheduler scheduler=new SRScheduler(this,uniqueName("String_Node_Str"));
    setScheduler(scheduler);
  }
 catch (  Exception ex) {
    throw new InternalErrorException("String_Node_Str" + ex.getMessage());
  }
  try {
    iterations=new Parameter(this,"String_Node_Str",new IntToken(0));
    iterations.setTypeEquals(BaseType.INT);
    setCurrentTime(0.0);
  }
 catch (  KernelException ex) {
    throw new InternalErrorException("String_Node_Str" + ex.getMessage());
  }
  _receivers=new LinkedList();
}
Program: 75827
Project: 75827
Buggy source:
/** 
 * Reset all receivers to allow a new firing of the director.
 */
private void _resetAllReceivers(){
  _currentNumOfKnownReceivers=0;
  Iterator i=_receivers.iterator();
  while (i.hasNext()) {
    ((SRReceiver)i.next()).reset();
  }
}

Fixed version (ground truth):
/** 
 * Reset all receivers to allow a new firing of the director.
 */
private void _resetAllReceivers(){
  _debug("String_Node_Str");
  _currentNumOfKnownReceivers=0;
  Iterator i=_receivers.iterator();
  while (i.hasNext()) {
    ((SRReceiver)i.next()).reset();
  }
}
Program: 75828
Project: 75828
Buggy source:
/** 
 * Fire contained actors until the iteration converges.  This method also calls the prefire() method of an actor before it is fired for the first time, and at the end, calls the postfire() methods of all  actors that were fired.
 * @exception IllegalActionException If an actor attempts to modifya known value.
 */
public void fire() throws IllegalActionException {
  Schedule schedule=_getSchedule();
  Iterator firingIterator;
  _initFiring();
  do {
    firingIterator=schedule.firingIterator();
    while (firingIterator.hasNext()) {
      Firing firing=(Firing)firingIterator.next();
      Actor actor=firing.getActor();
      if (_isIterationAllowed(actor)) {
        _fireActor(actor);
      }
 else {
        _sendAbsentToAllUnknownOutputsOf(actor);
      }
    }
  }
 while (!_hasIterationConverged());
  firingIterator=schedule.firingIterator();
  while (firingIterator.hasNext()) {
    Firing firing=(Firing)firingIterator.next();
    Actor actor=firing.getActor();
    if (_isIterationAllowed(actor)) {
      if (_postfireActor(actor)) {
        _postfireReturns=true;
      }
 else {
        _doNotAllowIterationOf(actor);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Fire contained actors until the iteration converges.  This method also calls the prefire() method of an actor before it is fired for the first time, and at the end, calls the postfire() methods of all  actors that were fired.
 * @exception IllegalActionException If an actor attempts to modifya known value.
 */
public void fire() throws IllegalActionException {
  Schedule schedule=_getSchedule();
  Iterator firingIterator;
  _initFiring();
  do {
    firingIterator=schedule.firingIterator();
    while (firingIterator.hasNext()) {
      Firing firing=(Firing)firingIterator.next();
      Actor actor=firing.getActor();
      if (_isIterationAllowed(actor)) {
        _fireActor(actor);
      }
 else {
        _sendAbsentToAllUnknownOutputsOf(actor);
      }
    }
  }
 while (!_hasIterationConverged());
}
Program: 75829
Project: 75829
Buggy source:
/** 
 * Return a new receiver consistent with the SR domain.
 * @return A new SRReceiver.
 */
public Receiver newReceiver(){
  if (_receivers == null)   _receivers=new LinkedList();
  Receiver receiver=new SRReceiver(this);
  _receivers.add(receiver);
  return receiver;
}

Fixed version (ground truth):
/** 
 * Return a new receiver consistent with the SR domain.
 * @return A new SRReceiver.
 */
public Receiver newReceiver(){
  if (_receivers == null)   _receivers=new LinkedList();
  Receiver receiver=new SRReceiver(this);
  _receivers.add(receiver);
  _debug("String_Node_Str" + _receivers.size());
  return receiver;
}
Program: 75830
Project: 75830
Buggy source:
/** 
 * Initialize the internal receiver list and invoke the preinitialize()  methods of all deeply contained actors.
 * @exception IllegalActionException If the superclass throws it.
 */
public void preinitialize() throws IllegalActionException {
  _receivers=new LinkedList();
  super.preinitialize();
}

Fixed version (ground truth):
/** 
 * Initialize the internal receiver list and invoke the preinitialize()  methods of all deeply contained actors.
 * @exception IllegalActionException If the superclass throws it.
 */
public void preinitialize() throws IllegalActionException {
  super.preinitialize();
}
Program: 75831
Project: 75831
Buggy source:
/** 
 * Return false if the system has finished executing, either by reaching the iteration limit, or if no actors in the model return true in postfire.
 * @return True if the execution is not finished.
 * @exception IllegalActionException If the iterations parameter doesnot have a valid token.
 */
public boolean postfire() throws IllegalActionException {
  int numberOfIterations=getIterations();
  _iteration++;
  _debug("String_Node_Str",String.valueOf(_iteration - 1),"String_Node_Str");
  _resetAllReceivers();
  if ((numberOfIterations > 0) && (_iteration >= numberOfIterations)) {
    _iteration=0;
    return false;
  }
  return _postfireReturns;
}

Fixed version (ground truth):
/** 
 * Return false if the system has finished executing, either by reaching the iteration limit, or if no actors in the model return true in postfire.
 * @return True if the execution is not finished.
 * @exception IllegalActionException If the iterations parameter doesnot have a valid token.
 */
public boolean postfire() throws IllegalActionException {
  Schedule schedule=_getSchedule();
  Iterator firingIterator=schedule.firingIterator();
  while (firingIterator.hasNext()) {
    Firing firing=(Firing)firingIterator.next();
    Actor actor=firing.getActor();
    if (_isIterationAllowed(actor)) {
      if (_postfireActor(actor)) {
        _postfireReturns=true;
      }
 else {
        _doNotAllowIterationOf(actor);
      }
    }
  }
  int numberOfIterations=getIterations();
  _iteration++;
  _debug("String_Node_Str",String.valueOf(_iteration - 1),"String_Node_Str");
  _resetAllReceivers();
  if ((numberOfIterations > 0) && (_iteration >= numberOfIterations)) {
    _iteration=0;
    return false;
  }
  return _postfireReturns;
}
Program: 75832
Project: 75832
Buggy source:
/** 
 * Initialize the object. In this case, we give the HDFDirector a default scheduler of the class HDFScheduler.
 */
private void _init(){
  try {
    SDFScheduler scheduler=new SDFScheduler(this,uniqueName("String_Node_Str"));
    setScheduler(scheduler);
  }
 catch (  Exception e) {
    throw new InternalErrorException("String_Node_Str" + e.getMessage());
  }
  try {
    int cacheSize=100;
    scheduleCacheSize=new Parameter(this,"String_Node_Str",new IntToken(cacheSize));
    _scheduleCache=new HashMap();
    _scheduleKeyList=new ArrayList(cacheSize);
  }
 catch (  Exception e) {
    throw new InternalErrorException("String_Node_Str" + e.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Initialize the object. In this case, we give the HDFDirector a default scheduler of the class HDFScheduler.
 */
private void _init(){
  try {
    SDFScheduler scheduler=new SDFScheduler(this,uniqueName("String_Node_Str"));
    setScheduler(scheduler);
  }
 catch (  Exception e) {
    throw new InternalErrorException("String_Node_Str" + e.getMessage());
  }
  try {
    int cacheSize=100;
    _cacheSize=cacheSize;
    scheduleCacheSize=new Parameter(this,"String_Node_Str",new IntToken(cacheSize));
    _scheduleCache=new HashMap();
    _scheduleKeyList=new ArrayList(cacheSize);
  }
 catch (  Exception e) {
    throw new InternalErrorException("String_Node_Str" + e.getMessage());
  }
}
Program: 75834
Project: 75834
Buggy source:
/** 
 * Return the firing count of the specified actor in the schedule. The specified actor must be director contained by this director. Otherwise an exception will occur.
 * @param actor The actor to return the firing count for.
 * @exception IllegalActionException I
 */
public int getFiringCount(Actor actor) throws IllegalActionException {
  Schedule schedule=getSchedule();
  Iterator firings=schedule.firingIterator();
  int occurrence=0;
  while (firings.hasNext()) {
    Firing firing=(Firing)firings.next();
    Actor actorInSchedule=(Actor)(firing.getActor());
    String actorInScheduleName=((Nameable)actorInSchedule).getName();
    String actorName=((Nameable)actor).getName();
    if (actorInScheduleName.equals(actorName)) {
      occurrence+=firing.getIterationCount();
    }
    if (_debug_info) {
      System.out.println(getName() + "String_Node_Str" + ((Nameable)actor).getName());
      System.out.println(getName() + "String_Node_Str" + occurrence);
    }
  }
  return occurrence;
}

Fixed version (ground truth):
/** 
 * Return the firing count of the specified actor in the schedule. The specified actor must be director contained by this director. Otherwise an exception will occur.
 * @param actor The actor to return the firing count for.
 * @exception IllegalActionException If there is a problem computingthe firing count.
 */
public int getFiringCount(Actor actor) throws IllegalActionException {
  Schedule schedule=getSchedule();
  Iterator firings=schedule.firingIterator();
  int occurrence=0;
  while (firings.hasNext()) {
    Firing firing=(Firing)firings.next();
    Actor actorInSchedule=(Actor)(firing.getActor());
    String actorInScheduleName=((Nameable)actorInSchedule).getName();
    String actorName=((Nameable)actor).getName();
    if (actorInScheduleName.equals(actorName)) {
      occurrence+=firing.getIterationCount();
    }
    if (_debug_info) {
    }
  }
  return occurrence;
}
Program: 75837
Project: 75837
Buggy source:
/** 
 * Return a list of all the input ports contained by the deeply contained entities of the container of this director.
 * @return The list of input ports.
 */
private List _getInputPortList(){
  CompositeActor container=(CompositeActor)getContainer();
  List actors=container.deepEntityList();
  Iterator actorIterator=actors.iterator();
  List inputPortList=new LinkedList();
  ;
  List inputPortRateList=new LinkedList();
  while (actorIterator.hasNext()) {
    Actor containedActor=(Actor)actorIterator.next();
    List temporaryInputPortList=containedActor.inputPortList();
    Iterator inputPortIterator=temporaryInputPortList.iterator();
    while (inputPortIterator.hasNext()) {
      IOPort inputPort=(IOPort)inputPortIterator.next();
      inputPortList.add(inputPort);
    }
  }
  return inputPortList;
}

Fixed version (ground truth):
/** 
 * Return a list of all the input ports contained by the deeply contained entities of the container of this director.
 * @return The list of input ports.
 */
private List _getInputPortList(){
  CompositeActor container=(CompositeActor)getContainer();
  List actors=container.deepEntityList();
  Iterator actorIterator=actors.iterator();
  List inputPortList=new LinkedList();
  ;
  List inputPortRateList=new LinkedList();
  while (actorIterator.hasNext()) {
    Actor containedActor=(Actor)actorIterator.next();
    List temporaryInputPortList=containedActor.inputPortList();
    Iterator inputPortIterator=temporaryInputPortList.iterator();
    while (inputPortIterator.hasNext()) {
      IOPort inputPort=(IOPort)inputPortIterator.next();
      if (_debug_info) {
        System.out.println(getName() + "String_Node_Str" + inputPort.getName());
      }
      inputPortList.add(inputPort);
    }
  }
  return inputPortList;
}
Program: 75839
Project: 75839
Buggy source:
/** 
 * Return a list of all the output ports contained by the deeply contained entities of the container of this director.
 * @return The list of output ports.
 */
private List _getOutputPortList(){
  CompositeActor container=(CompositeActor)getContainer();
  List actors=container.deepEntityList();
  Iterator actorIterator2=actors.iterator();
  List outputPortList=new LinkedList();
  ;
  List outputPortRateList=new LinkedList();
  while (actorIterator2.hasNext()) {
    Actor containedActor=(Actor)actorIterator2.next();
    List temporaryOutputPortList=containedActor.outputPortList();
    Iterator outputPortIterator=temporaryOutputPortList.iterator();
    while (outputPortIterator.hasNext()) {
      IOPort outputPort=(IOPort)outputPortIterator.next();
      outputPortList.add(outputPort);
    }
  }
  return outputPortList;
}

Fixed version (ground truth):
/** 
 * Return a list of all the output ports contained by the deeply contained entities of the container of this director.
 * @return The list of output ports.
 */
private List _getOutputPortList(){
  CompositeActor container=(CompositeActor)getContainer();
  List actors=container.deepEntityList();
  Iterator actorIterator2=actors.iterator();
  List outputPortList=new LinkedList();
  ;
  List outputPortRateList=new LinkedList();
  while (actorIterator2.hasNext()) {
    Actor containedActor=(Actor)actorIterator2.next();
    List temporaryOutputPortList=containedActor.outputPortList();
    Iterator outputPortIterator=temporaryOutputPortList.iterator();
    while (outputPortIterator.hasNext()) {
      IOPort outputPort=(IOPort)outputPortIterator.next();
      if (_debug_info) {
        System.out.println(getName() + "String_Node_Str" + outputPort.getName());
      }
      outputPortList.add(outputPort);
    }
  }
  return outputPortList;
}
Program: 75842
Project: 75842
Buggy source:
/** 
 * Initialize the firing of the director by resetting state variables and resetting all receivers to have unknown status.
 */
private void _initFiring(){
  _postfireReturns=false;
  _actorsAllowedToFire=null;
  _cachedAllInputsKnown=null;
  _cachedAllOutputsKnown=null;
  _lastNumOfActorsAllowedToFire=-1;
  _lastNumOfKnownReceivers=-1;
  _resetAllReceivers();
  _currentNumOfKnownReceivers=0;
}

Fixed version (ground truth):
/** 
 * Initialize the firing of the director by resetting state variables and resetting all receivers to have unknown status.
 */
private void _initFiring(){
  _postfireReturns=false;
  _actorsAllowedToFire=null;
  _actorsFired=null;
  _cachedAllInputsKnown=null;
  _cachedAllOutputsKnown=null;
  _lastNumOfActorsAllowedToFire=-1;
  _lastNumOfKnownReceivers=-1;
  _resetAllReceivers();
  _currentNumOfKnownReceivers=0;
}
Program: 75843
Project: 75843
Buggy source:
/** 
 * Return true if the specified actor is finished firing.  An actor  has finished firing if it is strict and has defined all of its outputs.
 */
private boolean _isFinishedFiring(Actor actor) throws IllegalActionException {
  if (_isNonStrict(actor))   return false;
  return _areAllOutputsKnown(actor);
}

Fixed version (ground truth):
/** 
 * Return true if the specified actor is finished firing.  An actor  has finished firing if it is strict and has defined all of its outputs.
 */
private boolean _isFinishedFiring(Actor actor) throws IllegalActionException {
  if (_isNonStrict(actor))   return false;
  if (_actorsFired == null)   return false;
  if (!_actorsFired.contains(actor))   return false;
  return _areAllOutputsKnown(actor);
}
Program: 75844
Project: 75844
Buggy source:
/** 
 * Fire the specified actor if the actor is ready to fire.  If the  prefire() method of this actor has not returned true in the current  iteration, the prefire() method will be called first.
 */
private void _fireActor(Actor actor) throws IllegalActionException {
  if (_isReadyToFire(actor)) {
    if (_isFiringAllowed(actor)) {
      if (!_isFinishedFiring(actor)) {
        _debug("String_Node_Str",_getNameOf(actor));
        boolean allInputsKnownBeforeFiring=_areAllInputsKnown(actor);
        actor.fire();
        if (allInputsKnownBeforeFiring)         _sendAbsentToAllUnknownOutputsOf(actor);
      }
    }
 else {
      _debug("String_Node_Str",_getNameOf(actor));
      if (actor.prefire()) {
        _doAllowFiringOf(actor);
        _fireActor(actor);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Fire the specified actor if the actor is ready to fire.  If the  prefire() method of this actor has not returned true in the current  iteration, the prefire() method will be called first.
 */
private void _fireActor(Actor actor) throws IllegalActionException {
  if (_isReadyToFire(actor)) {
    if (_isFiringAllowed(actor)) {
      if (!_isFinishedFiring(actor)) {
        _debug("String_Node_Str",_getNameOf(actor));
        boolean allInputsKnownBeforeFiring=_areAllInputsKnown(actor);
        actor.fire();
        if (_actorsFired == null)         _actorsFired=new HashSet();
        _actorsFired.add(actor);
        if (allInputsKnownBeforeFiring)         _sendAbsentToAllUnknownOutputsOf(actor);
      }
    }
 else {
      _debug("String_Node_Str",_getNameOf(actor));
      if (actor.prefire()) {
        _doAllowFiringOf(actor);
        _fireActor(actor);
      }
    }
  }
}
Program: 75845
Project: 75845
Buggy source:
/** 
 * Read one RecordToken from the input port and send its fields to the output ports. If the input does not have a token, suspend firing and return.
 * @exception IllegalActionException If there is no director.
 */
public void fire() throws IllegalActionException {
  Director director=getDirector();
  if (director == null) {
    throw new IllegalActionException(this,"String_Node_Str");
  }
  if (input.hasToken(0)) {
    RecordToken record=(RecordToken)input.get(0);
    Iterator labels=record.labelSet().iterator();
    while (labels.hasNext()) {
      String label=(String)labels.next();
      Token value=record.get(label);
      IOPort port=(IOPort)getPort(label);
      port.send(0,value);
    }
  }
}

Fixed version (ground truth):
/** 
 * Read one RecordToken from the input port and send its fields to the output ports. If the input does not have a token, suspend firing and return.
 * @exception IllegalActionException If there is no director.
 */
public void fire() throws IllegalActionException {
  Director director=getDirector();
  if (director == null) {
    throw new IllegalActionException(this,"String_Node_Str");
  }
  if (input.hasToken(0)) {
    RecordToken record=(RecordToken)input.get(0);
    Iterator labels=record.labelSet().iterator();
    while (labels.hasNext()) {
      String label=(String)labels.next();
      Token value=record.get(label);
      IOPort port=(IOPort)getPort(label);
      if (port != null) {
        port.send(0,value);
      }
    }
  }
}
Program: 75846
Project: 75846
Buggy source:
/** 
 * Consume the inputs and produce the outputs of the FIR filter.
 * @exception IllegalActionException If parameter values are invalid,or if there is no director, or if runtime type conflicts occur.
 */
public void fire() throws IllegalActionException {
  int phase=_dec - _decPhase - 1;
  if (--_mostRecent < 0)   _mostRecent=_data.length - 1;
  _data[_mostRecent]=input.get(0);
  for (int inC=1; inC <= _dec; inC++) {
    while (phase < _interp) {
      _outToken=_zero;
      for (int i=0; i < _phaseLength; i++) {
        int tapsIndex=i * _interp + phase;
        int dataIndex=(_mostRecent + _dec - inC + i) % (_data.length);
        if (tapsIndex < _taps.length) {
          _tapItem=_taps[tapsIndex];
          _dataItem=_data[dataIndex];
          _dataItem=_tapItem.multiply(_dataItem);
          _outToken=_outToken.add(_dataItem);
        }
      }
      output.send(0,_outToken);
      phase+=_dec;
    }
    phase-=_interp;
  }
}

Fixed version (ground truth):
/** 
 * Consume the inputs and produce the outputs of the FIR filter.
 * @exception IllegalActionException If parameter values are invalid,or if there is no director, or if runtime type conflicts occur.
 */
public void fire() throws IllegalActionException {
  int phase=_dec - _decPhase - 1;
  for (int inC=1; inC <= _dec; inC++) {
    if (--_mostRecent < 0)     _mostRecent=_data.length - 1;
    _data[_mostRecent]=input.get(0);
    while (phase < _interp) {
      _outToken=_zero;
      for (int i=0; i < _phaseLength; i++) {
        int tapsIndex=i * _interp + phase;
        int dataIndex=(_mostRecent + _dec - inC + i) % (_data.length);
        if (tapsIndex < _taps.length) {
          _tapItem=_taps[tapsIndex];
          _dataItem=_data[dataIndex];
          _dataItem=_tapItem.multiply(_dataItem);
          _outToken=_outToken.add(_dataItem);
        }
      }
      output.send(0,_outToken);
      phase+=_dec;
    }
    phase-=_interp;
  }
}
Program: 75847
Project: 75847
Buggy source:
/** 
 * Reset the receiver by removing any contained token and setting the state of this receiver to be unknown.  Should be called only by the director.
 */
protected void reset(){
}

Fixed version (ground truth):
/** 
 * Reset the receiver by removing any contained token and setting the state of this receiver to be unknown.  Should be called only by the director.
 */
protected void reset(){
  if (isKnown()) {
    if (hasToken())     super.get();
    _known=false;
  }
}
Program: 75848
Project: 75848
Buggy source:
/** 
 * Clone the actor into the specified workspace. This calls the base class and then sets up the type constraints.
 * @param workspace The workspace for the new object.
 * @return A new actor.
 * @exception CloneNotSupportedException If a derived class containsan attribute that cannot be cloned.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  Server newObject=(Server)(super.clone(workspace));
  ArrayType dataType=(ArrayType)newObject.data.getType();
  InequalityTerm elemTerm=dataType.getElementTypeTerm();
  newObject.output.setTypeAtLeast(elemTerm);
  return newObject;
}

Fixed version (ground truth):
/** 
 * Clone the actor into the specified workspace. This calls the base class and then sets up the type constraints.
 * @param workspace The workspace for the new object.
 * @return A new actor.
 * @exception CloneNotSupportedException If a derived class containsan attribute that cannot be cloned.
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  Server newObject=(Server)(super.clone(workspace));
  ArrayType dataType=(ArrayType)data.getType();
  InequalityTerm elemTerm=dataType.getElementTypeTerm();
  newObject.output.setTypeAtLeast(elemTerm);
  return newObject;
}
Program: 75849
Project: 75849
Buggy source:
/** 
 * Consume at most one input token from each input channel, and produce a token on the output port if it can be determined. If there is no input on any channel, then produce no output.
 * @exception IllegalActionException If there is no director.
 */
public void fire() throws IllegalActionException {
  BooleanToken value=null;
  BooleanToken in=null;
  for (int i=0; i < input.getWidth(); i++) {
    if (input.hasToken(i)) {
      in=(BooleanToken)(input.get(i));
      if (in != null)       value=_updateFunction(in,value);
    }
  }
  value=_nullifyIncompleteResults(value);
  if (value != null) {
    if (_negate)     value=value.not();
    output.send(0,(BooleanToken)value);
  }
}

Fixed version (ground truth):
/** 
 * Consume at most one input token from each input channel, and produce a token on the output port if it can be determined. If there is no input on any channel, then produce no output.
 * @exception IllegalActionException If there is no director.
 */
public void fire() throws IllegalActionException {
  BooleanToken value=null;
  BooleanToken in=null;
  for (int i=0; i < input.getWidth(); i++) {
    if (input.hasToken(i)) {
      in=(BooleanToken)(input.get(i));
      if (in != null)       value=_updateFunction(in,value);
    }
  }
  if (value != null)   value=_nullifyIncompleteResults(value);
  if (value != null) {
    if (_negate)     value=value.not();
    output.send(0,(BooleanToken)value);
  }
}
Program: 75852
Project: 75852
Buggy source:
/** 
 * Check if the value of this token is strictly less than that of the argument token.
 * @param arg A ScalarToken.
 * @return A BooleanToken with value true if this token is strictlyless than the argument.
 * @exception IllegalActionException If the type of the argument tokenis incomparable with the type of this token.
 */
public BooleanToken isLessThan(ScalarToken arg) throws IllegalActionException {
  int typeInfo=TypeLattice.compare(this,arg);
  if (typeInfo == CPO.INCOMPARABLE) {
    throw new IllegalActionException("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ arg.getType());
  }
  if (typeInfo == CPO.LOWER) {
    return arg.isLessThan(this);
  }
  ScalarToken intArg=arg;
  if (typeInfo == CPO.HIGHER) {
    intArg=(ScalarToken)convert(arg);
  }
  if (_value < intArg.intValue()) {
    return new BooleanToken(true);
  }
  return new BooleanToken(false);
}

Fixed version (ground truth):
/** 
 * Check if the value of this token is strictly less than that of the argument token.
 * @param arg A ScalarToken.
 * @return A BooleanToken with value true if this token is strictlyless than the argument.
 * @exception IllegalActionException If the type of the argument tokenis incomparable with the type of this token.
 */
public BooleanToken isLessThan(ScalarToken arg) throws IllegalActionException {
  int typeInfo=TypeLattice.compare(this,arg);
  if (typeInfo == CPO.INCOMPARABLE) {
    throw new IllegalActionException("String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ arg.getType());
  }
  if (typeInfo == CPO.LOWER) {
    return arg.isLessThan(this).not();
  }
  ScalarToken intArg=arg;
  if (typeInfo == CPO.HIGHER) {
    intArg=(ScalarToken)convert(arg);
  }
  if (_value < intArg.intValue()) {
    return new BooleanToken(true);
  }
  return new BooleanToken(false);
}
Program: 75853
Project: 75853
Buggy source:
public void insertClock() throws ChangeFailedException {
  ChangeRequest change=new ChangeRequest(_top,"String_Node_Str"){
    public void _execute() throws ChangeFailedException {
      try {
        _clock.output.unlinkAll();
        _rec.input.unlinkAll();
        Clock clock2=new Clock(_top,"String_Node_Str");
        clock2.values.setExpression("String_Node_Str");
        clock2.offsets.setExpression("String_Node_Str");
        clock2.period.setExpression("String_Node_Str");
        Merge merge=new Merge(_top,"String_Node_Str");
        _top.connect(_clock.output,merge.input);
        _top.connect(clock2.output,merge.input);
        _top.connect(merge.output,_rec.input);
        _rec.input.createReceivers();
      }
 catch (      IllegalActionException ex) {
        throw new ChangeFailedException(this,ex);
      }
catch (      NameDuplicationException ex) {
        throw new ChangeFailedException(this,ex);
      }
    }
  }
;
  manager.requestChange(change);
}

Fixed version (ground truth):
public void insertClock(){
  ChangeRequest change=new ChangeRequest(_top,"String_Node_Str"){
    public void _execute() throws IllegalActionException, NameDuplicationException {
      _clock.output.unlinkAll();
      _rec.input.unlinkAll();
      Clock clock2=new Clock(_top,"String_Node_Str");
      clock2.values.setExpression("String_Node_Str");
      clock2.offsets.setExpression("String_Node_Str");
      clock2.period.setExpression("String_Node_Str");
      Merge merge=new Merge(_top,"String_Node_Str");
      _top.connect(_clock.output,merge.input);
      _top.connect(clock2.output,merge.input);
      _top.connect(merge.output,_rec.input);
      _rec.input.createReceivers();
      _director.invalidateSchedule();
    }
  }
;
  _top.requestChange(change);
}
Program: 75854
Project: 75854
Buggy source:
public void _execute() throws ChangeFailedException {
  try {
    _clock.output.unlinkAll();
    _rec.input.unlinkAll();
    Clock clock2=new Clock(_top,"String_Node_Str");
    clock2.values.setExpression("String_Node_Str");
    clock2.offsets.setExpression("String_Node_Str");
    clock2.period.setExpression("String_Node_Str");
    Merge merge=new Merge(_top,"String_Node_Str");
    _top.connect(_clock.output,merge.input);
    _top.connect(clock2.output,merge.input);
    _top.connect(merge.output,_rec.input);
    _rec.input.createReceivers();
  }
 catch (  IllegalActionException ex) {
    throw new ChangeFailedException(this,ex);
  }
catch (  NameDuplicationException ex) {
    throw new ChangeFailedException(this,ex);
  }
}

Fixed version (ground truth):
public void _execute() throws IllegalActionException, NameDuplicationException {
  _clock.output.unlinkAll();
  _rec.input.unlinkAll();
  Clock clock2=new Clock(_top,"String_Node_Str");
  clock2.values.setExpression("String_Node_Str");
  clock2.offsets.setExpression("String_Node_Str");
  clock2.period.setExpression("String_Node_Str");
  Merge merge=new Merge(_top,"String_Node_Str");
  _top.connect(_clock.output,merge.input);
  _top.connect(clock2.output,merge.input);
  _top.connect(merge.output,_rec.input);
  _rec.input.createReceivers();
  _director.invalidateSchedule();
}
Program: 75855
Project: 75855
Buggy source:
protected void _createModel() throws IllegalActionException {
}

Fixed version (ground truth):
protected void _createModel() throws IllegalActionException {
  QuadArray plane=new QuadArray(4,GeometryArray.COORDINATES | QuadArray.NORMALS | GeometryArray.TEXTURE_COORDINATE_2);
  Point3f p=new Point3f(-1.0f,1.0f,0.0f);
  plane.setCoordinate(0,p);
  p.set(-1.0f,-1.0f,0.0f);
  plane.setCoordinate(1,p);
  p.set(1.0f,-1.0f,0.0f);
  plane.setCoordinate(2,p);
  p.set(1.0f,1.0f,0.0f);
  plane.setCoordinate(3,p);
  Point2f[] qq=new Point2f[4];
  qq[0]=new Point2f(0.0f,1.0f);
  qq[1]=new Point2f(0.0f,0.0f);
  qq[2]=new Point2f(1.0f,0.0f);
  qq[3]=new Point2f(1.0f,1.0f);
  plane.setTextureCoordinate(0,0,new TexCoord2f(qq[0]));
  plane.setTextureCoordinate(0,1,new TexCoord2f(qq[1]));
  plane.setTextureCoordinate(0,2,new TexCoord2f(qq[2]));
  plane.setTextureCoordinate(0,3,new TexCoord2f(qq[3]));
  Appearance appear=new Appearance();
  String fileName=(String)((StringToken)filename.getToken()).stringValue();
  TextureLoader loader=new TextureLoader(fileName,((ViewScreen)_root).getCanvas());
  ImageComponent2D image=loader.getImage();
  System.out.println("String_Node_Str" + image);
  if (image == null) {
    System.out.println("String_Node_Str" + filename);
    Texture2D texture=new Texture2D(Texture.BASE_LEVEL,Texture.RGBA,image.getWidth(),image.getHeight());
    texture.setImage(0,image);
    appear.setTexture(texture);
    appear.setTransparencyAttributes(new TransparencyAttributes(TransparencyAttributes.FASTEST,0.1f));
    top=new BranchGroup();
    _containedNode=new Shape3D(plane,appear);
    top.addChild(_containedNode);
  }
}
Program: 75856
Project: 75856
Buggy source:
/** 
 * Return the function result.
 * @return A Type.
 */
public Object getValue(){
  TypedIOPort recordInput=(TypedIOPort)_updater.getPort("String_Node_Str");
  Type inputType=recordInput.getType();
  if (inputType == BaseType.UNKNOWN) {
    return BaseType.UNKNOWN;
  }
  if (!(inputType instanceof RecordType)) {
    throw new InvalidStateException(_updater,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ inputType);
  }
  RecordType recordType=(RecordType)inputType;
  Map outputMap=new HashMap();
  Set recordLabels=recordType.labelSet();
  Iterator iter=recordLabels.iterator();
  while (iter.hasNext()) {
    String label=(String)iter.next();
    Type type=recordType.get(label);
    outputMap.put(label,type);
  }
  List inputPorts=inputPortList();
  iter=inputPorts.iterator();
  TypedIOPort recordPort=(TypedIOPort)_updater.getPort("String_Node_Str");
  while (iter.hasNext()) {
    TypedIOPort port=(TypedIOPort)iter.next();
    if (port != recordPort) {
      outputMap.put(port.getName(),port.getType());
    }
  }
  Object[] labelsObj=outputMap.keySet().toArray();
  String[] labels=new String[labelsObj.length];
  Type[] types=new Type[labelsObj.length];
  for (int i=0; i < labels.length; i++) {
    labels[i]=(String)labelsObj[i];
    types[i]=(Type)outputMap.get(labels[i]);
  }
  return new RecordType(labels,types);
}

Fixed version (ground truth):
/** 
 * Return the function result.
 * @return A Type.
 */
public Object getValue(){
  TypedIOPort recordInput=(TypedIOPort)_updater.getPort("String_Node_Str");
  Type inputType=recordInput.getType();
  if (inputType == BaseType.UNKNOWN) {
    return BaseType.UNKNOWN;
  }
  if (!(inputType instanceof RecordType)) {
    throw new InvalidStateException(_updater,"String_Node_Str" + "String_Node_Str" + "String_Node_Str"+ inputType);
  }
  RecordType recordType=(RecordType)inputType;
  Map outputMap=new HashMap();
  Set recordLabels=recordType.labelSet();
  Iterator iter=recordLabels.iterator();
  while (iter.hasNext()) {
    String label=(String)iter.next();
    Type type=recordType.get(label);
    outputMap.put(label,type);
  }
  List inputPorts=_updater.inputPortList();
  iter=inputPorts.iterator();
  while (iter.hasNext()) {
    TypedIOPort port=(TypedIOPort)iter.next();
    if (port != recordInput) {
      outputMap.put(port.getName(),port.getType());
    }
  }
  Object[] labelsObj=outputMap.keySet().toArray();
  String[] labels=new String[labelsObj.length];
  Type[] types=new Type[labelsObj.length];
  for (int i=0; i < labels.length; i++) {
    labels[i]=(String)labelsObj[i];
    types[i]=(Type)outputMap.get(labels[i]);
  }
  return new RecordType(labels,types);
}
Program: 75857
Project: 75857
Buggy source:
/** 
 * Return all the InequalityTerms for all input ports in an array.
 * @return An array of InequalityTerm.
 */
public InequalityTerm[] getVariables(){
  List inputPorts=inputPortList();
  Object[] portsObj=inputPorts.toArray();
  InequalityTerm[] variables=new InequalityTerm[portsObj.length];
  for (int i=0; i < variables.length; i++) {
    TypedIOPort port=(TypedIOPort)portsObj[i];
    variables[i]=port.getTypeTerm();
  }
  return variables;
}

Fixed version (ground truth):
/** 
 * Return all the InequalityTerms for all input ports in an array.
 * @return An array of InequalityTerm.
 */
public InequalityTerm[] getVariables(){
  List inputPorts=_updater.inputPortList();
  Object[] portsObj=inputPorts.toArray();
  InequalityTerm[] variables=new InequalityTerm[portsObj.length];
  for (int i=0; i < variables.length; i++) {
    TypedIOPort port=(TypedIOPort)portsObj[i];
    variables[i]=port.getTypeTerm();
  }
  return variables;
}
Program: 75858
Project: 75858
Buggy source:
protected void _createModel() throws IllegalActionException {
  QuadArray plane=new QuadArray(4,GeometryArray.COORDINATES | QuadArray.NORMALS | GeometryArray.TEXTURE_COORDINATE_2);
  Point3f p=new Point3f(-1.0f,1.0f,0.0f);
  plane.setCoordinate(0,p);
  p.set(-1.0f,-1.0f,0.0f);
  plane.setCoordinate(1,p);
  p.set(1.0f,-1.0f,0.0f);
  plane.setCoordinate(2,p);
  p.set(1.0f,1.0f,0.0f);
  plane.setCoordinate(3,p);
  Point2f[] qq=new Point2f[4];
  qq[0]=new Point2f(0.0f,1.0f);
  qq[1]=new Point2f(0.0f,0.0f);
  qq[2]=new Point2f(1.0f,0.0f);
  qq[3]=new Point2f(1.0f,1.0f);
  plane.setTextureCoordinate(0,0,new TexCoord2f(qq[0]));
  plane.setTextureCoordinate(0,1,new TexCoord2f(qq[1]));
  plane.setTextureCoordinate(0,2,new TexCoord2f(qq[2]));
  plane.setTextureCoordinate(0,3,new TexCoord2f(qq[3]));
  Appearance appear=new Appearance();
  String fileName=(String)((StringToken)filename.getToken()).stringValue();
  TextureLoader loader=new TextureLoader(fileName,((ViewScreen)_root).getCanvas());
  ImageComponent2D image=loader.getImage();
  System.out.println("String_Node_Str" + image);
  if (image == null) {
    System.out.println("String_Node_Str" + filename);
    Texture2D texture=new Texture2D(Texture.BASE_LEVEL,Texture.RGBA,image.getWidth(),image.getHeight());
    texture.setImage(0,image);
    appear.setTexture(texture);
    appear.setTransparencyAttributes(new TransparencyAttributes(TransparencyAttributes.FASTEST,0.1f));
    top=new BranchGroup();
    _containedNode=new Shape3D(plane,appear);
    top.addChild(_containedNode);
  }
}

Fixed version (ground truth):
protected void _createModel() throws IllegalActionException {
  QuadArray plane=new QuadArray(4,GeometryArray.COORDINATES | QuadArray.NORMALS | GeometryArray.TEXTURE_COORDINATE_2);
  Point3f p=new Point3f(-1.0f,1.0f,0.0f);
  plane.setCoordinate(0,p);
  p.set(-1.0f,-1.0f,0.0f);
  plane.setCoordinate(1,p);
  p.set(1.0f,-1.0f,0.0f);
  plane.setCoordinate(2,p);
  p.set(1.0f,1.0f,0.0f);
  plane.setCoordinate(3,p);
  Point2f[] qq=new Point2f[4];
  qq[0]=new Point2f(0.0f,1.0f);
  qq[1]=new Point2f(0.0f,0.0f);
  qq[2]=new Point2f(1.0f,0.0f);
  qq[3]=new Point2f(1.0f,1.0f);
  plane.setTextureCoordinate(0,0,new TexCoord2f(qq[0]));
  plane.setTextureCoordinate(0,1,new TexCoord2f(qq[1]));
  plane.setTextureCoordinate(0,2,new TexCoord2f(qq[2]));
  plane.setTextureCoordinate(0,3,new TexCoord2f(qq[3]));
  Appearance appear=new Appearance();
  String fileName=(String)((StringToken)filename.getToken()).stringValue();
  TextureLoader loader=new TextureLoader(fileName,((ViewScreen)_root).getCanvas());
  ImageComponent2D image=loader.getImage();
  System.out.println("String_Node_Str" + image);
  if (image == null) {
    System.out.println("String_Node_Str" + filename);
  }
  Texture2D texture=new Texture2D(Texture.BASE_LEVEL,Texture.RGBA,image.getWidth(),image.getHeight());
  texture.setImage(0,image);
  appear.setTexture(texture);
  appear.setTransparencyAttributes(new TransparencyAttributes(TransparencyAttributes.FASTEST,0.1f));
  top=new BranchGroup();
  _containedNode=new Shape3D(plane,appear);
  top.addChild(_containedNode);
}
Program: 75859
Project: 75859
Buggy source:
/** 
 * Override the base class to reinitialize the state if either the <i>step</i> or the <i>init</i> parameter is changed.
 * @param attribute The attribute that changed.
 * @exception IllegalActionException Not thrown in this base class.
 */
public void attributeChanged(Attribute attribute) throws IllegalActionException {
  if (attribute == step) {
    _step=step.getToken();
    _stateToken=init.getToken();
  }
 else   if (attribute == init) {
    _stateToken=init.getToken();
  }
}

Fixed version (ground truth):
/** 
 * Override the base class to reinitialize the state if either the <i>step</i> or the <i>init</i> parameter is changed.
 * @param attribute The attribute that changed.
 * @exception IllegalActionException Not thrown in this base class.
 */
public void attributeChanged(Attribute attribute) throws IllegalActionException {
  if (attribute == step) {
    _step=step.getToken();
    _stateToken=init.getToken();
  }
 else   if (attribute == init) {
    _stateToken=init.getToken();
  }
 else   super.attributeChanged(attribute);
}
Program: 75860
Project: 75860
Buggy source:
/** 
 * Invoke a specified number of iterations of this actor. Each iteration updates the state of the actor by adding the value of the <i>step</i> parameter to the state and sending the value of the state to the output. The iteration count is also incremented by the value of <i>count</i>, and if the result is greater than or equal to <i>firingCountLimit</i> then return STOP_ITERATING. <p> This method should be called instead of the usual prefire(), fire(), postfire() methods when this actor is used in a domain that supports vectorized actors.  This leads to more efficient execution.
 * @param count The number of iterations to perform.
 * @return COMPLETED if the actor was successfully iterated thespecified number of times. Otherwise, if the maximum iteration count has been reached, return STOP_ITERATING.
 * @exception IllegalActionException If iterating cannot beperformed.
 */
public int iterate(int count) throws IllegalActionException {
  super.iterate(count);
  if (count > _resultArray.length) {
    _resultArray=new Token[count];
  }
  for (int i=0; i < count; i++) {
    _resultArray[i]=_stateToken;
    try {
      _stateToken=_stateToken.add(_step);
    }
 catch (    IllegalActionException ex) {
      throw new InternalErrorException(ex.getMessage());
    }
  }
  output.send(0,_resultArray,count);
  if (_firingCountLimit != 0) {
    _iterationCount+=count;
    if (_iterationCount >= _firingCountLimit) {
      return STOP_ITERATING;
    }
  }
  return COMPLETED;
}

Fixed version (ground truth):
/** 
 * Invoke a specified number of iterations of this actor. Each iteration updates the state of the actor by adding the value of the <i>step</i> parameter to the state and sending the value of the state to the output. The iteration count is also incremented by the value of <i>count</i>, and if the result is greater than or equal to <i>firingCountLimit</i> then return STOP_ITERATING. <p> This method should be called instead of the usual prefire(), fire(), postfire() methods when this actor is used in a domain that supports vectorized actors.  This leads to more efficient execution.
 * @param count The number of iterations to perform.
 * @return COMPLETED if the actor was successfully iterated thespecified number of times. Otherwise, if the maximum iteration count has been reached, return STOP_ITERATING.
 * @exception IllegalActionException If iterating cannot beperformed.
 */
public int iterate(int count) throws IllegalActionException {
  if (count > _resultArray.length) {
    _resultArray=new Token[count];
  }
  for (int i=0; i < count; i++) {
    _resultArray[i]=_stateToken;
    try {
      _stateToken=_stateToken.add(_step);
    }
 catch (    IllegalActionException ex) {
      throw new InternalErrorException(ex.getMessage());
    }
  }
  output.send(0,_resultArray,count);
  if (_firingCountLimit != 0) {
    _iterationCount+=count;
    if (_iterationCount >= _firingCountLimit) {
      return STOP_ITERATING;
    }
  }
  return COMPLETED;
}