Program: 72610
Project: 72610
Buggy source:
/** 
 * Send out an
 */
@Override public void event(MirrorDecorator ssm,DecoratorEvent eventType,String portName){
  ComponentEntity container=(ComponentEntity)this.getContainer();
  try {
    String decoratorName=this.getDecorator().getName();
    String targetPortName=decoratorName + "String_Node_Str" + portName;
    TypedIOPort port=(TypedIOPort)container.getPort(targetPortName);
    if (eventType == DecoratorEvent.ADDED_PORT) {
      if (enabled()) {
        if (port == null) {
          port=new TypedIOPort(container,targetPortName,true,false);
          SingletonParameter showNameParam=((SingletonParameter)port.getAttribute("String_Node_Str"));
          if (showNameParam == null) {
            showNameParam=new SingletonParameter(port,"String_Node_Str");
          }
          showNameParam.setExpression("String_Node_Str");
        }
 else {
          if (port.isOutput()) {
            throw new IllegalActionException(this,"String_Node_Str" + "String_Node_Str" + "String_Node_Str");
          }
        }
      }
    }
 else     if (eventType == DecoratorEvent.REMOVED_PORT) {
      boolean portAddedByDecorator=((MirrorDecorator)this._decorator).getAddedPortNames().contains(portName);
      boolean paramPortAddedByDecorator=((MirrorDecorator)this._decorator).getAddedPortParameterNames().contains(portName);
      if (port != null) {
        if (portAddedByDecorator) {
          port.setContainer(null);
        }
      }
 else {
        port=(TypedIOPort)container.getPort(portName);
        if (port != null && paramPortAddedByDecorator) {
          port.setContainer(null);
        }
      }
    }
  }
 catch (  IllegalActionException|NameDuplicationException e) {
    throw new InternalErrorException(e);
  }
}

Fixed version (ground truth):
/** 
 * Send out an
 */
@Override public void event(MirrorDecorator ssm,DecoratorEvent eventType,String portName){
  ComponentEntity container=(ComponentEntity)this.getContainer();
  try {
    String decoratorName=this.getDecorator().getName();
    String targetPortName=decoratorName + "String_Node_Str" + portName;
    TypedIOPort port=(TypedIOPort)container.getPort(targetPortName);
    if (eventType == DecoratorEvent.ADDED_PORT) {
      if (enabled()) {
        if (port == null) {
          port=new TypedIOPort(container,targetPortName,true,false);
          SingletonParameter showNameParam=((SingletonParameter)port.getAttribute("String_Node_Str"));
          if (showNameParam == null) {
            showNameParam=new SingletonParameter(port,"String_Node_Str");
          }
          showNameParam.setExpression("String_Node_Str");
        }
 else {
          if (port.isOutput()) {
            throw new IllegalActionException(this,"String_Node_Str" + "String_Node_Str" + "String_Node_Str");
          }
        }
      }
      _cachedDecoratorPorts.put(portName,port);
    }
 else     if (eventType == DecoratorEvent.REMOVED_PORT) {
      boolean portAddedByDecorator=_cachedDecoratorPorts.keySet().contains(portName);
      boolean paramPortAddedByDecorator=_cachedDecoratorPortParameters.keySet().contains(portName);
      if (port != null) {
        if (portAddedByDecorator) {
          port.setContainer(null);
        }
      }
 else {
        port=(TypedIOPort)container.getPort(portName);
        if (port != null && paramPortAddedByDecorator) {
          port.setContainer(null);
        }
      }
      _cachedDecoratorPorts.remove(portName);
    }
  }
 catch (  IllegalActionException|NameDuplicationException e) {
    throw new InternalErrorException(e);
  }
}