Program: 75775
Project: 75775
Buggy source:
/** 
 * Return true if the receiver containing this boundary detector is connected to the inside of an input boundary port; return false otherwise. A boundary port is an opaque port that is contained by a composite actor. This method is not synchronized so the caller should be.
 * @return True if the containing receiver is connected to theinside of a boundary port; return false otherwise.
 */
public boolean isConnectedToBoundaryInside(){
  if (_connectedInsideOfBoundaryCacheIsOn) {
    return _isConnectedInsideOfBoundaryValue;
  }
 else {
    IOPort contPort=(IOPort)_rcvr.getContainer();
    if (contPort == null) {
      _connectedInsideOfBoundaryCacheIsOn=false;
      _isConnectedInsideOfBoundaryValue=false;
      return _isConnectedInsideOfBoundaryValue;
    }
    ComponentEntity contEntity=(ComponentEntity)contPort.getContainer();
    IOPort connectedPort=null;
    ComponentEntity connectedEntity=null;
    Iterator ports=contPort.connectedPortList().iterator();
    int cnt=0;
    while (ports.hasNext()) {
      connectedPort=(IOPort)ports.next();
      connectedEntity=(ComponentEntity)connectedPort.getContainer();
      if (connectedEntity == contEntity.getContainer() && connectedPort.isInput()) {
        try {
          Receiver[][] rcvrs=connectedPort.deepGetReceivers();
          for (int i=0; i < rcvrs.length; i++) {
            for (int j=0; j < rcvrs[i].length; j++) {
              if (_rcvr == rcvrs[i][j]) {
                _connectedInsideOfBoundaryCacheIsOn=true;
                _isConnectedInsideOfBoundaryValue=true;
                return true;
              }
            }
          }
        }
 catch (        IllegalActionException e) {
          System.out.println("String_Node_Str" + "String_Node_Str");
        }
      }
    }
    _connectedInsideOfBoundaryCacheIsOn=true;
    _isConnectedInsideOfBoundaryValue=false;
    return _isConnectedInsideOfBoundaryValue;
  }
}

Fixed version (ground truth):
/** 
 * Return true if the receiver containing this boundary detector is connected to the inside of an input boundary port; return false otherwise. A boundary port is an opaque port that is contained by a composite actor. This method is not synchronized so the caller should be.
 * @return True if the containing receiver is connected to theinside of a boundary port; return false otherwise.
 */
public boolean isConnectedToBoundaryInside(){
  if (_connectedInsideOfBoundaryCacheIsOn) {
    return _isConnectedInsideOfBoundaryValue;
  }
 else {
    IOPort contPort=(IOPort)_receiver.getContainer();
    if (contPort == null) {
      _connectedInsideOfBoundaryCacheIsOn=false;
      _isConnectedInsideOfBoundaryValue=false;
      return _isConnectedInsideOfBoundaryValue;
    }
    ComponentEntity contEntity=(ComponentEntity)contPort.getContainer();
    IOPort connectedPort=null;
    ComponentEntity connectedEntity=null;
    Iterator ports=contPort.connectedPortList().iterator();
    while (ports.hasNext()) {
      connectedPort=(IOPort)ports.next();
      connectedEntity=(ComponentEntity)connectedPort.getContainer();
      if (connectedEntity == contEntity.getContainer() && connectedPort.isInput()) {
        try {
          Receiver[][] receivers=connectedPort.deepGetReceivers();
          for (int i=0; i < receivers.length; i++) {
            for (int j=0; j < receivers[i].length; j++) {
              if (_receiver == receivers[i][j]) {
                _connectedInsideOfBoundaryCacheIsOn=true;
                _isConnectedInsideOfBoundaryValue=true;
                return true;
              }
            }
          }
        }
 catch (        IllegalActionException e) {
          System.out.println("String_Node_Str" + "String_Node_Str");
        }
      }
    }
    _connectedInsideOfBoundaryCacheIsOn=true;
    _isConnectedInsideOfBoundaryValue=false;
    return _isConnectedInsideOfBoundaryValue;
  }
}