Program: 73304
Project: 73304
Buggy source:
/** 
 * Parent constructor that replaces either targetEntity if replaceTargetEntity is true or otherwise all entities connected to it with a proxy instance (RemoteSink or RemoteSource).  The proxy actor is named the same as the original with addition of "_remote" suffix.  All links of the targetEntity are removed. The proxy actor dynamically adds ports that were present in the targetEntity (with the same port name) or and connects them to the targetEntity's relations.
 * @param container The container
 * @param targetEntity the targetEntity to be replaced by a proxy
 * @param replaceTargetEntity true to replace the target entity with the proxy,otherwise replace all entities connecting to it with one proxy
 * @param portTypes Map of ports and their resolved types
 * @exception IllegalActionException If the actor cannot be containedby the proposed container.
 * @exception NameDuplicationException If the container already has anactor with this name.
 * @exception CloneNotSupportedException If port cloning is not supported
 */
public RemoteActor(CompositeEntity container,ComponentEntity targetEntity,boolean replaceTargetEntity,HashMap<String,Type> portTypes) throws IllegalActionException, NameDuplicationException, CloneNotSupportedException {
  this(container,targetEntity.getName() + "String_Node_Str");
  setTargetEntityName(targetEntity.getFullName());
  _targetEntityName.setExpression(getTargetEntityName());
  if (replaceTargetEntity) {
    _replaceTargetEntity(targetEntity,portTypes);
  }
 else {
    _replaceConnectingEntities(targetEntity,portTypes);
  }
}

Fixed version (ground truth):
/** 
 * Parent constructor that replaces either targetEntity if replaceTargetEntity is true or otherwise all entities connected to it with a proxy instance (RemoteSink or RemoteSource).  The proxy actor is named the same as the original with addition of "_remote" suffix.  All links of the targetEntity are removed. The proxy actor dynamically adds ports that were present in the targetEntity (with the same port name) or and connects them to the targetEntity's relations.
 * @param container The container
 * @param targetEntity the targetEntity to be replaced by a proxy
 * @param replaceTargetEntity true to replace the target entity with the proxy,otherwise replace all entities connecting to it with one proxy
 * @param portTypes Map of ports and their resolved types
 * @exception IllegalActionException If the actor cannot be containedby the proposed container.
 * @exception NameDuplicationException If the container already has anactor with this name.
 * @exception CloneNotSupportedException If port cloning is not supported
 */
public RemoteActor(CompositeEntity container,ComponentEntity targetEntity,boolean replaceTargetEntity,HashMap<String,String> portTypes) throws IllegalActionException, NameDuplicationException, CloneNotSupportedException {
  this(container,targetEntity.getName() + "String_Node_Str");
  setTargetEntityName(targetEntity.getFullName());
  _targetEntityName.setExpression(getTargetEntityName());
  if (replaceTargetEntity) {
    _replaceTargetEntity(targetEntity,portTypes);
  }
 else {
    _replaceConnectingEntities(targetEntity,portTypes);
  }
}