Program: 76001
Project: 76001
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 getMoMLElementName(), 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 #getMoMLElementName()
 * @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;
    newobj._changeListeners=new LinkedList();
    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 (getMoMLElementName().equals("String_Node_Str")) {
      newobj._setDeferMoMLDefinitionTo(this);
    }
    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 getMoMLElementName(), 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 #getMoMLElementName()
 * @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;
    newobj._changeListeners=new LinkedList();
    newobj._deferredFrom=null;
    if (_deferTo != null) {
      _deferTo._deferredFrom.add(newobj);
    }
    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 (getMoMLElementName().equals("String_Node_Str")) {
      newobj._setDeferMoMLDefinitionTo(this);
    }
    return newobj;
  }
  finally {
    _workspace.doneReading();
  }
}