Program: 75466
Project: 75466
Buggy source:
/** 
 * Set the value of the shadow variables for the channel of the port. If the specified port is not an input port, then do nothing.
 * @see #_createInputVariables(IOPort port)
 * @param port An input port of this actor.
 * @param channel A channel of the input port.
 * @exception IllegalActionException If the port is not contained bythis actor, or if the shadow variable cannot take the token read from the channel (should not occur).
 */
protected void _setInputVariables(IOPort port,int channel) throws IllegalActionException {
  if (port.getContainer() != this) {
    throw new IllegalActionException(this,port,"String_Node_Str" + "String_Node_Str");
  }
  if (!port.isInput()) {
    return;
  }
  int width=port.getWidth();
  Variable[][] shadowVariables=(Variable[][])_inputVariableMap.get(port);
  if (shadowVariables == null) {
    throw new InternalErrorException(getName() + "String_Node_Str" + "String_Node_Str"+ port.getName()+ "String_Node_Str");
  }
  if (port.isKnown(channel)) {
    int portRate=SDFScheduler.getTokenConsumptionRate(port);
    if (_debug_info) {
      System.out.println(port.getName() + "String_Node_Str" + portRate);
    }
    if (_firingsSoFar == 0) {
      _hdfArray=new Token[portRate * _firingsPerScheduleIteration];
    }
    int index=portRate * _firingsSoFar;
    int flag=0;
    while (port.hasToken(channel)) {
      Token token=port.get(channel);
      flag++;
      if (index < portRate * (_firingsSoFar + 1)) {
        if (_debugging) {
          _debug("String_Node_Str",port.getName(),"String_Node_Str" + channel + "String_Node_Str",token.toString());
        }
        _hdfArray[index]=token;
        if (_debug_info) {
          System.out.println("String_Node_Str" + index + "String_Node_Str"+ _hdfArray[index].toString());
        }
        index++;
      }
    }
    if (_debug_info) {
      System.out.println("String_Node_Str" + port.getFullName() + "String_Node_Str"+ flag);
    }
    if (index == portRate * _firingsPerScheduleIteration) {
      shadowVariables[channel][0].setToken(BooleanToken.TRUE);
      shadowVariables[channel][1].setToken(_hdfArray[index - 1]);
      shadowVariables[channel][2].setToken(new ArrayToken(_hdfArray));
      if (_debug_info) {
        System.out.println("String_Node_Str" + _hdfArray[index - 1].toString());
      }
    }
 else {
      shadowVariables[channel][0].setToken(BooleanToken.FALSE);
      if (_debugging) {
        _debug("String_Node_Str",port.getName(),"String_Node_Str" + channel + "String_Node_Str");
      }
    }
  }
 else {
    shadowVariables[channel][0].setUnknown(true);
    shadowVariables[channel][1].setUnknown(true);
    shadowVariables[channel][2].setUnknown(true);
  }
}

Fixed version (ground truth):
/** 
 * Set the value of the shadow variables for the channel of the port. If the specified port is not an input port, then do nothing.
 * @see #_createInputVariables(IOPort port)
 * @param port An input port of this actor.
 * @param channel A channel of the input port.
 * @exception IllegalActionException If the port is not contained bythis actor, or if the shadow variable cannot take the token read from the channel (should not occur).
 */
protected void _setInputVariables(IOPort port,int channel) throws IllegalActionException {
  if (port.getContainer() != this) {
    throw new IllegalActionException(this,port,"String_Node_Str" + "String_Node_Str");
  }
  if (!port.isInput()) {
    return;
  }
  int width=port.getWidth();
  Variable[][] shadowVariables=(Variable[][])_inputVariableMap.get(port);
  if (shadowVariables == null) {
    throw new InternalErrorException(getName() + "String_Node_Str" + "String_Node_Str"+ port.getName()+ "String_Node_Str");
  }
  if (port.isKnown(channel)) {
    int portRate=SDFScheduler.getTokenConsumptionRate(port);
    if (_debug_info) {
      System.out.println(port.getFullName() + "String_Node_Str" + portRate);
    }
    if (_firingsSoFar == 0 && channel == 0) {
      Token[][] a_of_p=new Token[width][portRate * _firingsPerScheduleIteration];
      _hdfArrays.put(port,a_of_p);
    }
    int index=portRate * _firingsSoFar;
    int flag=0;
    while (port.hasToken(channel)) {
      Token token=port.get(channel);
      flag++;
      if (index < portRate * (_firingsSoFar + 1)) {
        if (_debugging) {
          _debug("String_Node_Str",port.getName(),"String_Node_Str" + channel + "String_Node_Str",token.toString());
        }
        Token[][] a_of_p=(Token[][])_hdfArrays.get(port);
        a_of_p[channel][index]=token;
        if (_debug_info) {
          System.out.println("String_Node_Str" + index + "String_Node_Str"+ a_of_p[channel][index].toString());
        }
        index++;
      }
    }
    if (_debug_info) {
      System.out.println("String_Node_Str" + port.getFullName() + "String_Node_Str"+ flag);
    }
    if (index == portRate * _firingsPerScheduleIteration && index > 0) {
      Token[][] a_of_p=(Token[][])_hdfArrays.get(port);
      shadowVariables[channel][0].setToken(BooleanToken.TRUE);
      shadowVariables[channel][1].setToken(a_of_p[channel][index - 1]);
      shadowVariables[channel][2].setToken(new ArrayToken(a_of_p[channel]));
    }
 else {
      shadowVariables[channel][0].setToken(BooleanToken.FALSE);
      if (_debugging) {
        _debug("String_Node_Str",port.getName(),"String_Node_Str" + channel + "String_Node_Str");
      }
    }
  }
 else {
    shadowVariables[channel][0].setUnknown(true);
    shadowVariables[channel][1].setUnknown(true);
    shadowVariables[channel][2].setUnknown(true);
  }
}