Program: 73034
Project: 73034
Buggy source:
/** 
 * Specify the container, and add this variable to the list of attributes in the container. If this variable already has a container, remove this variable from the attribute list of the current container first. Otherwise, remove it from the directory of the workspace, if it is there. If the specified container is null, remove this variable from the list of attributes of the current container. If the specified container already contains an attribute with the same name, then throw an exception and do not make any changes. Similarly, if the container is not in the same workspace as this variable, throw an exception. If this variable is already contained by the specified container, do nothing. <p> If this method results in a change of container (which it usually does), then remove this variable from the scope of any scope dependent of this variable. <p> This method is write-synchronized on the workspace and increments its version number.
 * @param container The proposed container of this variable.
 * @exception IllegalActionException If the container will not accepta variable as its attribute, or this variable and the container are not in the same workspace, or the proposed container would result in recursive containment.
 * @exception NameDuplicationException If the container already hasan attribute with the name of this variable.
 */
public void setContainer(NamedObj container) throws IllegalActionException, NameDuplicationException {
  Nameable previousContainer=getContainer();
  if (container != previousContainer && previousContainer != null && _valueListeners != null && _valueListeners.size() > 0) {
    new IllegalActionException(this,"String_Node_Str" + getName() + "String_Node_Str"+ _valueListeners.size()+ "String_Node_Str"+ "String_Node_Str"+ _valueListeners.get(0)).printStackTrace();
  }
  super.setContainer(container);
  if (container != previousContainer) {
    _invalidateShadowedSettables(container);
    if (previousContainer != null) {
      if (container != null) {
        validate();
      }
 else {
        _notifyValueListeners();
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Specify the container, and add this variable to the list of attributes in the container. If this variable already has a container, remove this variable from the attribute list of the current container first. Otherwise, remove it from the directory of the workspace, if it is there. If the specified container is null, remove this variable from the list of attributes of the current container. If the specified container already contains an attribute with the same name, then throw an exception and do not make any changes. Similarly, if the container is not in the same workspace as this variable, throw an exception. If this variable is already contained by the specified container, do nothing. <p> If this method results in a change of container (which it usually does), then remove this variable from the scope of any scope dependent of this variable. <p> This method is write-synchronized on the workspace and increments its version number.
 * @param container The proposed container of this variable.
 * @exception IllegalActionException If the container will not accepta variable as its attribute, or this variable and the container are not in the same workspace, or the proposed container would result in recursive containment.
 * @exception NameDuplicationException If the container already hasan attribute with the name of this variable.
 */
public void setContainer(NamedObj container) throws IllegalActionException, NameDuplicationException {
  Nameable previousContainer=getContainer();
  if (container != previousContainer && previousContainer != null && _valueListeners != null && _valueListeners.size() > 0) {
    if (!MessageHandler.yesNoQuestion("String_Node_Str" + getName() + "String_Node_Str")) {
      throw new IllegalActionException(this,"String_Node_Str");
    }
  }
  super.setContainer(container);
  if (container != previousContainer) {
    _invalidateShadowedSettables(container);
    if (previousContainer != null) {
      if (container != null) {
        validate();
      }
 else {
        _notifyValueListeners();
      }
    }
  }
}