Program: 136159
Project: 136159
Buggy source:
/** 
 * Set Assigned Type. Sets the Assigned type node and add this owner to that user list via where used listener. This method assures there is a target and that the owner is editable. Sets the TLModel type If the target represents a complex type (BO, Core, facet, alias) then the owner's name is changed.
 * @return true if assignment could be made, false otherwise
 */
public boolean set(TypeProvider target){
  if (owner == null || !owner.isEditable())   return false;
  if (target instanceof SharedFacetNode) {
    target=(TypeProvider)target.getParent();
    LOGGER.debug("String_Node_Str");
  }
  TypeProvider oldProvider=owner.getAssignedType();
  if (owner.getRequiredType() != null)   return false;
  if (oldProvider == target) {
    if (!target.getWhereAssigned().contains(owner)) {
      target.addTypeUser(owner);
    }
    if (target != ModelNode.getUnassignedNode())     return true;
  }
  if (target == null || target == ModelNode.getUnassignedNode()) {
    oldProvider.removeWhereAssigned(owner);
    ModelNode.getUnassignedNode().addTypeUser(owner);
    return false;
  }
  TLModelElement tlTarget=target.getTLModelObject();
  if (target.getLibrary() != null && target.getLibrary().isBuiltIn() && target.getLibrary().getNamespace().equals(XMLConstants.W3C_XML_SCHEMA_NS_URI))   if (target.getXsdObjectHandler() != null)   tlTarget=target.getXsdObjectHandler().getTLLibraryMember();
  boolean result=owner.setAssignedTLType(tlTarget);
  if (result) {
    ModelNode.getUnassignedNode().removeWhereAssigned(owner);
    oldProvider.removeWhereAssigned(owner);
    target.addTypeUser(owner);
  }
  if (get().getTLModelObject() != tlTarget) {
    TypeProvider actual=get();
    if (actual.getXsdObjectHandler() == null || actual.getXsdObjectHandler().getTLLibraryMember() != tlTarget) {
      LOGGER.debug("String_Node_Str" + ((Node)target).getNameWithPrefix() + "String_Node_Str"+ owner+ "String_Node_Str"+ ((Node)get()).getNameWithPrefix());
      return false;
    }
  }
  return result;
}

Fixed version (ground truth):
/** 
 * Set Assigned Type. Sets the Assigned type node and add this owner to that user list via where used listener. This method assures there is a target and that the owner is editable. Sets the TLModel type If the target represents a complex type (BO, Core, facet, alias) then the owner's name is changed.
 * @return true if assignment could be made, false otherwise
 */
public boolean set(TypeProvider target){
  if (owner == null || !owner.isEditable())   return false;
  if (target instanceof SharedFacetNode) {
    target=(TypeProvider)target.getParent();
    LOGGER.debug("String_Node_Str");
  }
  TypeProvider oldProvider=owner.getAssignedType();
  if (owner.getRequiredType() != null)   return false;
  if (oldProvider == target) {
    if (!target.getWhereAssigned().contains(owner)) {
      target.addTypeUser(owner);
    }
    if (target != ModelNode.getUnassignedNode())     return true;
  }
  if (target == null || target == ModelNode.getUnassignedNode()) {
    oldProvider.removeWhereAssigned(owner);
    ModelNode.getUnassignedNode().addTypeUser(owner);
    return false;
  }
  TLModelElement tlTarget=target.getTLModelObject();
  if (target.getLibrary() != null && target.getLibrary().isBuiltIn() && target.getLibrary().getNamespace().equals(XMLConstants.W3C_XML_SCHEMA_NS_URI))   if (target.getXsdObjectHandler() != null)   tlTarget=target.getXsdObjectHandler().getTLLibraryMember();
  boolean result=owner.setAssignedTLType(tlTarget);
  if (result) {
    ModelNode.getUnassignedNode().removeWhereAssigned(owner);
    oldProvider.removeWhereAssigned(owner);
    target.addTypeUser(owner);
  }
 else   LOGGER.debug("String_Node_Str" + target + "String_Node_Str"+ owner);
  if (get().getTLModelObject() != tlTarget) {
    TypeProvider actual=get();
    if (actual.getXsdObjectHandler() == null || actual.getXsdObjectHandler().getTLLibraryMember() != tlTarget) {
      LOGGER.debug("String_Node_Str" + ((Node)target).getNameWithPrefix() + "String_Node_Str"+ owner+ "String_Node_Str"+ ((Node)get()).getNameWithPrefix());
      return false;
    }
  }
  return result;
}