Program: 136330
Project: 136330
Buggy source:
/** 
 * Add node to this library. Links to library's complex/simple or element root. Adds underlying the TL object to this library's TLModel library. Handles adding nodes to chains. Adds context to the TL Model library if needed. Does not change type assignments. <p> Add to tlLibrary.addNamedMember() <br> linkMember() <br> getChain.add()
 */
public void addMember(final Node n){
  if (!isEditable()) {
    LOGGER.warn("String_Node_Str" + n + "String_Node_Str"+ this);
    return;
  }
  if (n == null || n.getTLModelObject() == null) {
    LOGGER.warn("String_Node_Str" + n);
    return;
  }
  if (!(n.getTLModelObject() instanceof LibraryMember)) {
    LOGGER.warn("String_Node_Str" + n);
    return;
  }
  if (n.getParent() != null && n.getParent().getChildren().contains(n)) {
    LOGGER.warn(n + "String_Node_Str");
    return;
  }
 else   if ((n instanceof SimpleComponentInterface) && getSimpleRoot().getChildren().contains(n)) {
    LOGGER.warn(n + "String_Node_Str");
    return;
  }
 else   if ((n instanceof ComplexComponentInterface) && getComplexRoot().getChildren().contains(n)) {
    LOGGER.warn(n + "String_Node_Str");
    return;
  }
  if (n.getLibrary() != null && n.getLibrary() != this)   n.removeFromLibrary();
  getTLLibrary().addNamedMember((LibraryMember)n.getTLModelObject());
  if (linkMember(n)) {
    if (isInChain()) {
      getChain().add((ComponentNode)n);
    }
  }
  if (n.getParent().getChildren().indexOf(n) != n.getParent().getChildren().lastIndexOf(n))   LOGGER.error(n + "String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Add node to this library. Links to library's complex/simple or element root. Adds underlying the TL object to this library's TLModel library. Handles adding nodes to chains. Adds context to the TL Model library if needed. Does not change type assignments. <p> Add to tlLibrary.addNamedMember() <br> linkMember() <br> getChain.add()
 */
public void addMember(final Node n){
  if (!isEditable()) {
    LOGGER.warn("String_Node_Str" + n + "String_Node_Str"+ this);
    return;
  }
  if (n == null || n.getTLModelObject() == null) {
    LOGGER.warn("String_Node_Str" + n);
    return;
  }
  if (!(n.getTLModelObject() instanceof LibraryMember)) {
    LOGGER.warn("String_Node_Str" + n);
    return;
  }
  if (n.getParent() != null && n.getParent().getChildren().contains(n)) {
    LOGGER.warn(n + "String_Node_Str");
    return;
  }
 else   if ((n instanceof SimpleComponentInterface) && getSimpleRoot().getChildren().contains(n)) {
    LOGGER.warn(n + "String_Node_Str");
    return;
  }
 else   if ((n instanceof ComplexComponentInterface) && getComplexRoot().getChildren().contains(n)) {
    LOGGER.warn(n + "String_Node_Str");
    return;
  }
  if (n.getLibrary() != null && n.getLibrary() != this)   n.removeFromLibrary();
  AbstractLibrary owningLib=null;
  if (n.getTLModelObject() instanceof LibraryMember)   owningLib=((LibraryMember)n.getTLModelObject()).getOwningLibrary();
  if (owningLib != getTLLibrary()) {
    owningLib.removeNamedMember((LibraryMember)n.getTLModelObject());
    getTLLibrary().addNamedMember((LibraryMember)n.getTLModelObject());
  }
  if (owningLib == null)   getTLLibrary().addNamedMember((LibraryMember)n.getTLModelObject());
  if (linkMember(n)) {
    if (isInChain())     getChain().add((ComponentNode)n);
  }
  if (n.getParent().getChildren().indexOf(n) != n.getParent().getChildren().lastIndexOf(n))   LOGGER.error(n + "String_Node_Str");
}