Program: 75995
Project: 75995
Buggy source:
/** 
 * Clone the object into the specified workspace. The new object is <i>not</i> added to the directory of that workspace (you must do this yourself if you want it there). This uses the clone() method of java.lang.Object, which makes a field-by-field copy. It then adjusts the workspace reference and clones the attributes on the attribute list, if there is one. In addition, if this object has the MoML element name "class", as determined by className field of the associated MoMLInfo object, then the new object will not export its contents when exportMoML() is called, but rather will declare that it extends this one, and will export only its attributes. This method read-synchronizes on the workspace.
 * @param ws The workspace for the new object.
 * @return A new NamedObj.
 * @exception CloneNotSupportedException If any of the attributescannot be cloned.
 * @see #getMoMLInfo()
 * @see #exportMoML(Writer,int,String)
 */
public Object clone(Workspace ws) throws CloneNotSupportedException {
  try {
    _workspace.getReadAccess();
    NamedObj newobj=(NamedObj)super.clone();
    newobj._attributes=null;
    newobj._workspace=ws;
    newobj._fullNameVersion=-1;
    Iterator params=attributeList().iterator();
    while (params.hasNext()) {
      Attribute p=(Attribute)params.next();
      Attribute np=(Attribute)p.clone(ws);
      try {
        np.setContainer(newobj);
      }
 catch (      KernelException ex) {
        throw new CloneNotSupportedException("String_Node_Str" + getFullName() + "String_Node_Str"+ ex.getMessage());
      }
    }
    if (_debugging) {
      if (ws == null) {
        _debug("String_Node_Str",getFullName(),"String_Node_Str");
      }
 else {
        _debug("String_Node_Str",getFullName(),"String_Node_Str",ws.getFullName());
      }
    }
    if (_MoMLInfo != null) {
      newobj._MoMLInfo=new MoMLInfo(newobj);
      newobj._MoMLInfo.elementName=_MoMLInfo.elementName;
      newobj._MoMLInfo.source=_MoMLInfo.source;
      newobj._MoMLInfo.deferredFrom=null;
      if (_MoMLInfo.deferTo != null) {
        _MoMLInfo.deferTo._MoMLInfo.getDeferredFrom().add(newobj);
      }
      if (getMoMLInfo().elementName.equals("String_Node_Str")) {
        newobj._setDeferMoMLDefinitionTo(this);
        newobj._MoMLInfo.className=getFullName();
      }
 else {
        newobj._MoMLInfo.className=_MoMLInfo.className;
      }
    }
    return newobj;
  }
  finally {
    _workspace.doneReading();
  }
}

Fixed version (ground truth):
/** 
 * Clone the object into the specified workspace. The new object is <i>not</i> added to the directory of that workspace (you must do this yourself if you want it there). This uses the clone() method of java.lang.Object, which makes a field-by-field copy. It then adjusts the workspace reference and clones the attributes on the attribute list, if there is one. In addition, if this object has the MoML element name "class", as determined by className field of the associated MoMLInfo object, then the new object will not export its contents when exportMoML() is called, but rather will declare that it extends this one, and will export only its attributes. This method read-synchronizes on the workspace.
 * @param ws The workspace for the new object.
 * @return A new NamedObj.
 * @exception CloneNotSupportedException If any of the attributescannot be cloned.
 * @see #getMoMLInfo()
 * @see #exportMoML(Writer,int,String)
 */
public Object clone(Workspace workspace) throws CloneNotSupportedException {
  try {
    _workspace.getReadAccess();
    NamedObj newObject=(NamedObj)super.clone();
    newObject._attributes=null;
    newObject._workspace=workspace;
    newObject._fullNameVersion=-1;
    Iterator parameters=attributeList().iterator();
    while (parameters.hasNext()) {
      Attribute parameter=(Attribute)parameters.next();
      Attribute newParameter=(Attribute)parameter.clone(workspace);
      try {
        newParameter.setContainer(newObject);
      }
 catch (      KernelException exception) {
        throw new CloneNotSupportedException("String_Node_Str" + getFullName() + "String_Node_Str"+ exception.getMessage());
      }
    }
    if (_debugging) {
      if (workspace == null) {
        _debug("String_Node_Str",getFullName(),"String_Node_Str");
      }
 else {
        _debug("String_Node_Str",getFullName(),"String_Node_Str",workspace.getFullName());
      }
    }
    if (_MoMLInfo != null) {
      newObject._MoMLInfo=new MoMLInfo(newObject);
      newObject._MoMLInfo.elementName=_MoMLInfo.elementName;
      newObject._MoMLInfo.source=_MoMLInfo.source;
      newObject._MoMLInfo.deferredFrom=null;
      if (_MoMLInfo.deferTo != null) {
        _MoMLInfo.deferTo._MoMLInfo.getDeferredFrom().add(newObject);
      }
      if (getMoMLInfo().elementName.equals("String_Node_Str")) {
        newObject._setDeferMoMLDefinitionTo(this);
        newObject._MoMLInfo.className=getFullName();
      }
 else {
        newObject._MoMLInfo.className=_MoMLInfo.className;
      }
    }
    return newObject;
  }
  finally {
    _workspace.doneReading();
  }
}