Program: 75376
Project: 75376
Buggy source:
/** 
 * Apply the changes by renaming the object.
 */
public void apply(){
  if (_changed) {
    String newName=getStringValue("String_Node_Str");
    NamedObj parent=MoMLChangeRequest.getDeferredToParent(_object);
    if (parent == null) {
      parent=(NamedObj)_object.getContainer();
    }
    String oldName=_object.getName(parent);
    StringBuffer moml=new StringBuffer("String_Node_Str");
    String elementName="String_Node_Str";
    if (_object instanceof Port) {
      elementName="String_Node_Str";
    }
 else     if (_object instanceof Attribute) {
      elementName="String_Node_Str";
    }
 else     if (_object instanceof Relation) {
      elementName="String_Node_Str";
    }
    moml.append(elementName);
    moml.append("String_Node_Str");
    moml.append(oldName);
    moml.append("String_Node_Str");
    moml.append(newName);
    moml.append("String_Node_Str");
    boolean showName=getBooleanValue("String_Node_Str");
    if (_object instanceof Port) {
      if (showName) {
        moml.append("String_Node_Str" + "String_Node_Str");
      }
 else {
        if (_object.getAttribute("String_Node_Str") != null) {
          moml.append("String_Node_Str");
        }
      }
    }
 else {
      if (showName) {
        if (_object.getAttribute("String_Node_Str") != null) {
          moml.append("String_Node_Str");
        }
      }
 else {
        moml.append("String_Node_Str" + "String_Node_Str");
      }
    }
    moml.append("String_Node_Str");
    moml.append(elementName);
    moml.append("String_Node_Str");
    MoMLChangeRequest request=new MoMLChangeRequest(this,parent,moml.toString(),null);
    request.addChangeListener(this);
    request.setUndoable(true);
    parent.requestChange(request);
  }
}

Fixed version (ground truth):
/** 
 * Apply the changes by renaming the object.
 */
public void apply(){
  if (_changed) {
    String newName=getStringValue("String_Node_Str");
    NamedObj parent=MoMLChangeRequest.getDeferredToParent((NamedObj)_object.getContainer());
    if (parent == null) {
      parent=(NamedObj)_object.getContainer();
    }
    String oldName=_object.getName(parent);
    StringBuffer moml=new StringBuffer("String_Node_Str");
    String elementName="String_Node_Str";
    if (_object instanceof Port) {
      elementName="String_Node_Str";
    }
 else     if (_object instanceof Attribute) {
      elementName="String_Node_Str";
    }
 else     if (_object instanceof Relation) {
      elementName="String_Node_Str";
    }
    moml.append(elementName);
    moml.append("String_Node_Str");
    moml.append(oldName);
    moml.append("String_Node_Str");
    moml.append(newName);
    moml.append("String_Node_Str");
    boolean showName=getBooleanValue("String_Node_Str");
    if (_object instanceof Port) {
      if (showName) {
        moml.append("String_Node_Str" + "String_Node_Str");
      }
 else {
        if (_object.getAttribute("String_Node_Str") != null) {
          moml.append("String_Node_Str");
        }
      }
    }
 else {
      if (showName) {
        if (_object.getAttribute("String_Node_Str") != null) {
          moml.append("String_Node_Str");
        }
      }
 else {
        moml.append("String_Node_Str" + "String_Node_Str");
      }
    }
    moml.append("String_Node_Str");
    moml.append(elementName);
    moml.append("String_Node_Str");
    MoMLChangeRequest request=new MoMLChangeRequest(this,parent,moml.toString(),null);
    request.addChangeListener(this);
    request.setUndoable(true);
    parent.requestChange(request);
  }
}