Program: 76276
Project: 76276
Buggy source:
/** 
 * Return true if it transfers data from an input port of the container to the ports it is connected to on the inside.  The port argument must be an opaque input port.  If any channel of the input port has no data, then that channel is ignored.
 * @exception IllegalActionException If the port is not an opaqueinput port.
 * @return True if data are transfered.
 */
public boolean transferInputs(IOPort port) throws IllegalActionException {
  t=null;
  if (!port.isInput() || !port.isOpaque()) {
    throw new IllegalActionException(this,port,"String_Node_Str");
  }
  boolean trans=false;
  Entity refine=(Entity)_controller.currentRefinement();
  if (refine == null) {
    System.out.println("String_Node_Str");
  }
 else {
    System.out.println("String_Node_Str" + refine.getFullName());
  }
  IOPort p;
  Receiver rec;
  while (port.hasToken(0)) {
    try {
      t=port.get(0);
      ArrayFIFOQueue guardTokenArray=(ArrayFIFOQueue)inputPortNameToArrayFIFOQueue.get(port.getName());
      guardTokenArray.take();
      guardTokenArray.put(t);
      Variable[] guardVarArray=(Variable[])inputPortNameToVariableArray.get(port.getName());
      Token tempToken2=(Token)guardTokenArray.get(0);
      (guardVarArray[0]).setToken(tempToken2);
      System.out.println("String_Node_Str" + port.getFullName() + "String_Node_Str");
      System.out.println("String_Node_Str" + t.toString());
      System.out.println("String_Node_Str" + port.getName());
      if (_controller == null) {
        System.out.println("String_Node_Str");
      }
 else       if (refine == null) {
        System.out.println("String_Node_Str");
      }
 else {
        for (Enumeration e=refine.getPorts(); e.hasMoreElements(); ) {
          System.out.println("String_Node_Str" + e.nextElement());
        }
      }
      p=(IOPort)refine.getPort(port.getName());
      if (p != null) {
        rec=(p.getReceivers())[0][0];
        System.out.println("String_Node_Str");
        rec.put(t);
      }
 else {
        System.out.println("String_Node_Str");
        throw new IllegalActionException(this,port,"String_Node_Str");
      }
      trans=true;
    }
 catch (    NoTokenException ex) {
      throw new InternalErrorException("String_Node_Str" + ex.getMessage());
    }
  }
  return trans;
}

Fixed version (ground truth):
/** 
 * Return true if it transfers data from an input port of the container to the ports it is connected to on the inside.  The port argument must be an opaque input port.  If any channel of the input port has no data, then that channel is ignored.
 * @exception IllegalActionException If the port is not an opaqueinput port.
 * @return True if data are transfered.
 */
public boolean transferInputs(IOPort port) throws IllegalActionException {
  t=null;
  if (!port.isInput() || !port.isOpaque()) {
    throw new IllegalActionException(this,port,"String_Node_Str");
  }
  boolean trans=false;
  Entity refine=(Entity)_controller.currentRefinement();
  if (refine == null) {
    System.out.println("String_Node_Str");
  }
 else {
    System.out.println("String_Node_Str" + refine.getFullName());
  }
  IOPort p;
  Receiver rec;
  ArrayFIFOQueue guardTokenArray=(ArrayFIFOQueue)inputPortNameToArrayFIFOQueue.get(port.getName());
  while (port.hasToken(0)) {
    try {
      t=port.get(0);
      guardTokenArray.take();
      guardTokenArray.put(t);
      System.out.println("String_Node_Str" + port.getFullName() + "String_Node_Str");
      System.out.println("String_Node_Str" + t.toString());
      System.out.println("String_Node_Str" + port.getName());
      if (_controller == null) {
        System.out.println("String_Node_Str");
      }
 else       if (refine == null) {
        System.out.println("String_Node_Str");
      }
 else {
        for (Enumeration e=refine.getPorts(); e.hasMoreElements(); ) {
          System.out.println("String_Node_Str" + e.nextElement());
        }
      }
      p=(IOPort)refine.getPort(port.getName());
      if (p != null) {
        rec=(p.getReceivers())[0][0];
        System.out.println("String_Node_Str");
        rec.put(t);
      }
 else {
        System.out.println("String_Node_Str");
        throw new IllegalActionException(this,port,"String_Node_Str");
      }
      trans=true;
    }
 catch (    NoTokenException ex) {
      throw new InternalErrorException("String_Node_Str" + ex.getMessage());
    }
  }
  Variable[] guardVarArray=(Variable[])inputPortNameToVariableArray.get(port.getName());
  int i;
  for (i=0; i < guardVarArray.length; i++) {
    (guardVarArray[i]).setToken((Token)guardTokenArray.get(guardVarArray.length - 1 - i));
  }
  return trans;
}