Program: 76275
Project: 76275
Buggy source:
/** 
 * Create the guard variables assiciated with <i>port</i> and add them to a protected queue containing all the guard variables associated with all of the ports of contained by the HDF composite actor with this director. <p> The number of guard variables created for <i>port</i> is the number returned by getGuardTokenHistory(). This variables of the queue are returned by _getTransitionGuardVars().
 * @param port The port to create guard variables for.
 */
private void _createGuardVariables(IOPort port) throws IllegalActionException {
  int history=getGuardTokenHistory();
  Variable[] guardVarArray=new Variable[history];
  if (port.isInput()) {
    if (_inputPortNameToVariableArray == null) {
      _inputPortNameToVariableArray=new HashMap();
    }
    if (!_inputPortNameToVariableArray.containsKey(port.getFullName())) {
      _inputPortNameToVariableArray.put(port.getFullName(),guardVarArray);
    }
  }
 else   if (port.isOutput()) {
    if (_outputPortNameToVariableArray == null) {
      _outputPortNameToVariableArray=new HashMap();
    }
    if (!_outputPortNameToVariableArray.containsKey(port.getFullName())) {
      _outputPortNameToVariableArray.put(port.getFullName(),guardVarArray);
    }
  }
 else {
    throw new IllegalActionException(this,"String_Node_Str" + "String_Node_Str");
  }
  try {
    for (int i=0; i < history; i++) {
      Integer iInt=new Integer(i);
      String guardName=port.getName() + "String_Node_Str" + iInt.toString();
      guardVarArray[i]=new Variable(this,guardName);
    }
    if (_allGuardVars == null) {
      _allGuardVars=new ArrayFIFOQueue();
    }
    _allGuardVars.putArray(guardVarArray);
  }
 catch (  NameDuplicationException ex) {
    System.err.println("String_Node_Str" + ex.getMessage());
  }
}

Fixed version (ground truth):
/** 
 * Create the guard variables assiciated with <i>port</i> and add them to a queue containing all the guard variables associated with all of the ports of contained by the HDF composite actor with this director. <p> The number of guard variables created for <i>port</i> is the number returned by getGuardTokenHistory(). This variables in the queue are returned by _getTransitionGuardVars().
 * @param port The port to create guard variables for.
 */
private void _createGuardVariables(IOPort port) throws IllegalActionException {
  int history=getGuardTokenHistory();
  Variable[] guardVarArray=new Variable[history];
  if (port.isInput()) {
    if (_inputPortNameToVariableArray == null) {
      _inputPortNameToVariableArray=new HashMap();
    }
    if (!_inputPortNameToVariableArray.containsKey(port.getFullName())) {
      _inputPortNameToVariableArray.put(port.getFullName(),guardVarArray);
      try {
        for (int i=0; i < history; i++) {
          Integer iInt=new Integer(i);
          String guardName=port.getName() + "String_Node_Str" + iInt.toString();
          guardVarArray[i]=new Variable(this,guardName);
        }
        if (_allGuardVars == null) {
          _allGuardVars=new ArrayFIFOQueue();
        }
        _allGuardVars.putArray(guardVarArray);
      }
 catch (      NameDuplicationException ex) {
        System.err.println("String_Node_Str" + ex.getMessage());
      }
    }
  }
 else   if (port.isOutput()) {
    if (_outputPortNameToVariableArray == null) {
      _outputPortNameToVariableArray=new HashMap();
    }
    if (!_outputPortNameToVariableArray.containsKey(port.getFullName())) {
      _outputPortNameToVariableArray.put(port.getFullName(),guardVarArray);
      try {
        for (int i=0; i < history; i++) {
          Integer iInt=new Integer(i);
          String guardName=port.getName() + "String_Node_Str" + iInt.toString();
          guardVarArray[i]=new Variable(this,guardName);
        }
        if (_allGuardVars == null) {
          _allGuardVars=new ArrayFIFOQueue();
        }
        _allGuardVars.putArray(guardVarArray);
      }
 catch (      NameDuplicationException ex) {
        System.err.println("String_Node_Str" + ex.getMessage());
      }
    }
  }
 else {
    throw new IllegalActionException(this,"String_Node_Str" + "String_Node_Str");
  }
}