nus-yam/ex-repair huggingface dataset:
Program: 136302
Project: 136302
Buggy source:
private void updateLibrary(TypeUserNode userNode){
  DefaultRepositoryController rc=(DefaultRepositoryController)mc.getRepositoryController();
  List<LibraryNode> usedLibs=new ArrayList<LibraryNode>();
  usedLibs.add(userNode.getOwner());
  LibraryNode libToUpdate=(LibraryNode)userNode.getParent();
  boolean includeDrafts=false;
  String question="String_Node_Str";
  String[] buttons={"String_Node_Str","String_Node_Str","String_Node_Str"};
  int result=DialogUserNotifier.openQuestionWithButtons("String_Node_Str",question,buttons);
  if (result == 1)   includeDrafts=true;
 else   if (result == 2)   return;
  HashMap<LibraryNode,LibraryNode> replacementMap;
  try {
    replacementMap=rc.getVersionUpdateMap(usedLibs,includeDrafts);
  }
 catch (  RepositoryException e1) {
    DialogUserNotifier.openWarning("String_Node_Str",e1.getLocalizedMessage());
    return;
  }
  LibraryNode targetLib=null;
  LibraryNode oldLib=null;
  for (  Entry<LibraryNode,LibraryNode> e : replacementMap.entrySet()) {
    targetLib=e.getValue();
    oldLib=e.getKey();
  }
  if (targetLib == null) {
    DialogUserNotifier.openWarning("String_Node_Str","String_Node_Str");
    return;
  }
  question="String_Node_Str" + oldLib.getNameWithPrefix() + "String_Node_Str"+ targetLib.getNameWithPrefix()+ "String_Node_Str";
  if (DialogUserNotifier.openQuestion("String_Node_Str",question))   libToUpdate.replaceTypeUsers(replacementMap);
  libToUpdate.getWhereUsedHandler().refreshUsedByNode();
  mc.refresh(libToUpdate);
}

Fixed version (ground truth):
private void updateLibrary(TypeUserNode userNode){
  DefaultRepositoryController rc=(DefaultRepositoryController)mc.getRepositoryController();
  List<LibraryNode> usedLibs=new ArrayList<LibraryNode>();
  usedLibs.add(userNode.getOwner());
  LibraryNode libToUpdate=(LibraryNode)userNode.getParent();
  String question="String_Node_Str";
  String[] buttons={"String_Node_Str","String_Node_Str","String_Node_Str"};
  int result=DialogUserNotifier.openQuestionWithButtons("String_Node_Str",question,buttons);
  boolean includeDrafts=false;
  if (result == 0)   includeDrafts=true;
 else   if (result == 2)   return;
  HashMap<LibraryNode,LibraryNode> replacementMap;
  try {
    replacementMap=rc.getVersionUpdateMap(usedLibs,includeDrafts);
  }
 catch (  RepositoryException e1) {
    DialogUserNotifier.openWarning("String_Node_Str",e1.getLocalizedMessage());
    return;
  }
  LibraryNode targetLib=null;
  LibraryNode oldLib=null;
  for (  Entry<LibraryNode,LibraryNode> e : replacementMap.entrySet()) {
    targetLib=e.getValue();
    oldLib=e.getKey();
  }
  if (targetLib == null) {
    DialogUserNotifier.openWarning("String_Node_Str","String_Node_Str");
    return;
  }
  question="String_Node_Str" + oldLib.getNameWithPrefix() + "String_Node_Str"+ targetLib.getNameWithPrefix()+ "String_Node_Str";
  if (DialogUserNotifier.openQuestion("String_Node_Str",question))   libToUpdate.replaceTypeUsers(replacementMap);
  libToUpdate.getWhereUsedHandler().refreshUsedByNode();
  mc.refresh(libToUpdate);
}
Program: 136303
Project: 136303
Buggy source:
public static int openQuestionWithButtons(final String title,final String question,final String[] labels){
  if (!OtmRegistry.getMainWindow().hasDisplay())   return 2;
  final MessageDialog dg=new MessageDialog(OtmRegistry.getActiveShell(),title,null,question,MessageDialog.QUESTION,labels,0);
  return dg.open();
}

Fixed version (ground truth):
/** 
 * @param title
 * @param question
 * @param labels
 * @return - index to button pressed (0, 1, ...)
 */
public static int openQuestionWithButtons(final String title,final String question,final String[] labels){
  if (!OtmRegistry.getMainWindow().hasDisplay())   return 2;
  final MessageDialog dg=new MessageDialog(OtmRegistry.getActiveShell(),title,null,question,MessageDialog.QUESTION,labels,0);
  return dg.open();
}
Program: 136304
Project: 136304
Buggy source:
@Override protected void updateFamily(){
  final Node parent=getParent();
  if (getChildren().size() == 1) {
    final Node child=getChildren().get(0);
    parent.getChildren().add(child);
    if (!parent.getChildren().remove(this))     LOGGER.info("String_Node_Str" + this.getName() + "String_Node_Str"+ parent.getName());
  }
}

Fixed version (ground truth):
@Override protected void updateFamily(){
  final Node parent=getParent();
  if (getChildren().size() == 1) {
    final Node child=getChildren().get(0);
    parent.getChildren().add(child);
    if (!parent.getChildren().remove(this))     LOGGER.info("String_Node_Str" + this.getName() + "String_Node_Str"+ parent.getName());
    deleted=true;
    getChildren().clear();
  }
}
Program: 136305
Project: 136305
Buggy source:
protected void remove(Node node){
  getChildren().remove(node);
  updateFamily();
}

Fixed version (ground truth):
/** 
 * Attempt to remove passed node from this family. If successful, update the family and delete it if there is only one member.
 * @param node
 */
protected void remove(Node node){
  if (getChildren().remove(node))   updateFamily();
}
Program: 136306
Project: 136306
Buggy source:
protected void remove(Node node){
  if (!getChildren().remove(node)) {
    ArrayList<Node> kids=new ArrayList<Node>(getChildren());
    for (    Node n : kids) {
      if ((n instanceof AggregateFamilyNode) && (n.family.equals(node.family))) {
        ((AggregateFamilyNode)n).remove(node);
        if (n.getChildren().isEmpty())         getChildren().remove(n);
      }
    }
  }
}

Fixed version (ground truth):
protected void remove(Node node){
  if (!getChildren().remove(node)) {
    ArrayList<Node> kids=new ArrayList<Node>(getChildren());
    for (    Node n : kids) {
      if (n instanceof AggregateFamilyNode)       ((AggregateFamilyNode)n).remove(node);
    }
  }
}
Program: 136307
Project: 136307
Buggy source:
/** 
 * Set object, children, parent, add to parent's child list, listener(s)
 */
public ActionNode(TLAction tlAction){
  super(tlAction);
}

Fixed version (ground truth):
/** 
 * Create Action node including TL object and the request. Designed for resource command actions.
 * @param parent
 */
public ActionNode(ResourceNode parent){
  super(new TLAction(),parent);
  tlObj.setActionId("String_Node_Str");
  parent.getTLModelObject().addAction(tlObj);
  TLActionRequest tlr=new TLActionRequest();
  tlObj.setRequest(tlr);
  new ActionRequest(tlr);
}
Program: 136308
Project: 136308
Buggy source:
@Override public void delete(){
  List<Node> kids=new ArrayList<Node>(getChildren());
  for (  Node child : kids)   child.delete();
  tlObj.getOwner().removeAction(tlObj);
  super.delete();
}

Fixed version (ground truth):
@Override public void delete(){
  List<Node> kids=new ArrayList<Node>(getChildren());
  for (  Node child : kids)   child.delete();
  if (tlObj.getOwner() != null)   tlObj.getOwner().removeAction(tlObj);
  super.delete();
}
Program: 136309
Project: 136309
Buggy source:
/** 
 * Find all type providers in a library that have types assigned to owner library.
 * @return
 */
public List<Node> getUsersOfTypesFromOwnerLibrary(LibraryNode lib){
  List<Node> ul=new ArrayList<Node>();
  for (  TypeUser user : lib.getDescendants_TypeUsers()) {
    TypeProvider ut=user.getAssignedType();
    if (ut != null && ((Node)ut).getLibrary() == owner) {
      if (!ul.contains(user))       ul.add((Node)user);
    }
  }
  for (  ExtensionOwner o : lib.getDescendants_ExtensionOwners()) {
    Node extensionBase=o.getExtensionBase();
    if (extensionBase != null && extensionBase.getLibrary() == owner) {
      if (!ul.contains(extensionBase))       ul.add((Node)o);
    }
  }
  return ul;
}

Fixed version (ground truth):
/** 
 * Find all type providers in a library that have types assigned to owner library.
 * @return
 */
public List<Node> getUsersOfTypesFromOwnerLibrary(LibraryNode lib){
  List<Node> ul=new ArrayList<Node>();
  if (lib == null)   return ul;
  for (  TypeUser user : lib.getDescendants_TypeUsers()) {
    TypeProvider ut=user.getAssignedType();
    if (ut != null && ((Node)ut).getLibrary() == owner) {
      if (!ul.contains(user))       ul.add((Node)user);
    }
  }
  for (  ExtensionOwner o : lib.getDescendants_ExtensionOwners()) {
    Node extensionBase=o.getExtensionBase();
    if (extensionBase != null && extensionBase.getLibrary() == owner) {
      if (!ul.contains(extensionBase))       ul.add((Node)o);
    }
  }
  return ul;
}
Program: 136310
Project: 136310
Buggy source:
@Override public void remove(final Collection<? extends Node> libraries){
  Set<ProjectNode> projectsToSave=new HashSet<ProjectNode>();
  for (  LibraryNode ln : getLibrariesToClose(libraries)) {
    if (ln == null || ln.getParent() == null) {
      LOGGER.error("String_Node_Str" + ln + "String_Node_Str");
    }
 else {
      projectsToSave.add(ln.getProject());
      ln.close();
    }
  }
  for (  ProjectNode project : projectsToSave) {
    mc.getProjectController().save(project);
    mc.refresh(project);
  }
  mc.clearSelection();
}

Fixed version (ground truth):
@Override public void remove(final Collection<? extends Node> libraries){
  Set<ProjectNode> projectsToSave=new HashSet<ProjectNode>();
  Set<LibraryChainNode> chains=new HashSet<LibraryChainNode>();
  for (  Node n : libraries)   if (n instanceof LibraryChainNode)   chains.add((LibraryChainNode)n);
 else   if (n.getChain() != null)   chains.add(n.getChain());
  for (  LibraryNode ln : getLibrariesToClose(libraries)) {
    if (ln == null || ln.getParent() == null) {
      LOGGER.error("String_Node_Str" + ln + "String_Node_Str");
    }
 else {
      projectsToSave.add(ln.getProject());
      ln.close();
    }
  }
  for (  Node n : chains) {
    if (n.getParent() != null)     n.getParent().getChildren().remove(n);
    n.setParent(null);
  }
  for (  ProjectNode project : projectsToSave) {
    mc.getProjectController().save(project);
    mc.refresh(project);
  }
  mc.clearSelection();
}
Program: 136311
Project: 136311
Buggy source:
/** 
 * @return list of open user (TLLibrary) libraries. Returns empty list if there are no userlibraries.
 */
List<LibraryNode> getUserLibraries();

Fixed version (ground truth):
/** 
 * @return list of open user (TLLibrary) libraries. Returns empty list if there are no user libraries.
 */
List<LibraryNode> getUserLibraries();
Program: 136312
Project: 136312
Buggy source:
@Override public String getLabel(){
  if (getExtensionBase() == null)   return super.getLabel();
 else   if (isVersioned())   return super.getLabel() + "String_Node_Str" + getExtensionBase().getLibrary().getVersion()+ "String_Node_Str";
 else   return super.getLabel() + "String_Node_Str" + getExtensionBase().getNameWithPrefix()+ "String_Node_Str";
}

Fixed version (ground truth):
@Override public String getLabel(){
  if (getExtensionBase() == null)   return super.getLabel();
  return super.getLabel() + "String_Node_Str" + getExtensionBase().getNameWithPrefix()+ "String_Node_Str";
}
Program: 136313
Project: 136313
Buggy source:
private org.opentravel.schemas.node.Node findOwningNode(){
  String nodeName=getNodeName();
  org.opentravel.schemas.node.Node result=null;
  if (nodeName.equals(getNode().getName()))   return result;
  if (getNode().getName().startsWith("String_Node_Str"))   return result;
  org.opentravel.schemas.node.Node root=owningNode;
  if (owningNode == null)   root=getNode();
  for (  org.opentravel.schemas.node.Node n : root.getDescendants())   if (n.getName().equals(nodeName)) {
    result=n;
    break;
  }
 else   if (n instanceof FacetNode) {
    for (    org.opentravel.schemas.node.Node in : n.getInheritedChildren())     if (in.getName().equals(nodeName)) {
      result=in;
      break;
    }
  }
  return result;
}

Fixed version (ground truth):
private org.opentravel.schemas.node.Node findOwningNode(){
  String nodeName=getNodeName();
  org.opentravel.schemas.node.Node result=null;
  if (nodeName.equals(getNode().getName()))   return result;
  if (getNode().getName().startsWith("String_Node_Str"))   return result;
  org.opentravel.schemas.node.Node root=getNode();
  if (owningNode != null)   if (owningNode instanceof TypeUser)   root=(org.opentravel.schemas.node.Node)((TypeUser)owningNode).getAssignedType();
 else   root=owningNode.getOwningComponent();
  for (  org.opentravel.schemas.node.Node n : root.getDescendants())   if (n.getName().equals(nodeName)) {
    result=n;
    break;
  }
 else   if (n instanceof FacetNode) {
    for (    org.opentravel.schemas.node.Node in : n.getInheritedChildren())     if (in.getName().equals(nodeName)) {
      result=in;
      break;
    }
  }
  return result;
}
Program: 136314
Project: 136314
Buggy source:
private Collection<? extends ExampleModel> createChildren(NodeList childNodes){
  List<ExampleModel> ret=new ArrayList<ExampleModel>(childNodes.getLength());
  for (int i=0; i < childNodes.getLength(); i++) {
    Node child=childNodes.item(i);
    if (child.getNodeType() != Node.TEXT_NODE) {
      DOMExampleModel childModel=new DOMExampleModel(getNode(),child);
      childModel.setXmlString(getXmlString());
      childModel.setJsonString(getJsonString());
      ret.add(childModel);
    }
  }
  return ret;
}

Fixed version (ground truth):
private Collection<? extends ExampleModel> createChildren(NodeList childNodes){
  List<ExampleModel> ret=new ArrayList<ExampleModel>(childNodes.getLength());
  for (int i=0; i < childNodes.getLength(); i++) {
    Node child=childNodes.item(i);
    if (child.getNodeType() != Node.TEXT_NODE) {
      DOMExampleModel childModel=new DOMExampleModel(getNode(),getOwningNode(),child);
      childModel.setXmlString(getXmlString());
      childModel.setJsonString(getJsonString());
      ret.add(childModel);
    }
  }
  return ret;
}
Program: 136315
Project: 136315
Buggy source:
/** 
 * @param lib
 * @param examples
 */
public DOMExampleModel(org.opentravel.schemas.node.Node lib,Node domNode){
  super(lib);
  this.domNode=domNode;
  this.owningNode=findOwningNode();
  this.setLabelProvider(new LabelProvider(){
    @Override public Image getImage(    Object element){
      DOMExampleModel e=(DOMExampleModel)element;
      if (e.isXSDComplexType()) {
        return Images.getImageRegistry().get(Images.XSDComplexType);
      }
 else       if (e.isService()) {
        return Images.getImageRegistry().get(Images.Service);
      }
 else       if (e.isFacet()) {
        return Images.getImageRegistry().get(Images.Facet);
      }
 else       if (e.isAttribute()) {
        return Images.getImageRegistry().get(Images.XSDAttribute);
      }
      return Images.getImageRegistry().get(Images.XSDElement);
    }
    @Override public String getText(    Object element){
      DOMExampleModel e=(DOMExampleModel)element;
      return e.getDisplayText();
    }
  }
);
}

Fixed version (ground truth):
/** 
 * @param lib
 * @param examples
 */
public DOMExampleModel(org.opentravel.schemas.node.Node lib,Node domNode){
  super(lib);
  this.domNode=domNode;
  this.owningNode=findOwningNode();
  this.setLabelProvider(new DOMExampleLabelProvider());
}
Program: 136316
Project: 136316
Buggy source:
private void addProperty(){
  if (selectedNode.getChain() != null) {
    if (actOnNode.isEnabled_AddProperties() && !actOnNode.isInHead())     actOnNode=createVersionExtension(selectedNode);
    if (actOnNode == null)     return;
    try {
      NewPropertiesWizard2 w2=new NewPropertiesWizard2(actOnNode);
      w2.setValidator(new NewPropertyValidator(actOnNode,null));
      w2.run(OtmRegistry.getActiveShell());
    }
 catch (    IllegalArgumentException e) {
      DialogUserNotifier.openError("String_Node_Str",e.getLocalizedMessage());
    }
  }
  mc.refresh(actOnNode.getOwningComponent());
}

Fixed version (ground truth):
private void addProperty(){
  if (selectedNode.getChain() != null) {
    if (actOnNode.isEnabled_AddProperties() && !actOnNode.isInHead())     actOnNode=createVersionExtension(selectedNode);
  }
  if (actOnNode == null)   return;
  try {
    NewPropertiesWizard2 w2=new NewPropertiesWizard2(actOnNode);
    w2.setValidator(new NewPropertyValidator(actOnNode,null));
    w2.run(OtmRegistry.getActiveShell());
  }
 catch (  IllegalArgumentException e) {
    DialogUserNotifier.openError("String_Node_Str",e.getLocalizedMessage());
  }
  mc.refresh(actOnNode.getOwningComponent());
}
Program: 136317
Project: 136317
Buggy source:
/** 
 * Create a component in the head library that versions (extends) the selected node. Prompts the user to confirm before creating node.
 * @return newly created node or null if user cancelled or error.
 */
public ComponentNode createVersionExtension(Node selectedNode){
  ComponentNode actOnNode=null;
  if (selectedNode.getChain().getHead().isPatchVersion()) {
    if (!selectedNode.isExtensionPointFacet()) {
      if (postConfirm("String_Node_Str",selectedNode))       actOnNode=((ComponentNode)selectedNode).createPatchVersionComponent();
    }
  }
 else   if (selectedNode.getChain().getHead().isMinorOrMajorVersion()) {
    if (selectedNode instanceof VersionedObjectInterface) {
      if (postConfirm("String_Node_Str",selectedNode))       actOnNode=((VersionedObjectInterface)selectedNode).createMinorVersionComponent();
    }
 else     if (selectedNode.isEditable_inService())     if (selectedNode.getLibrary().getChain().getHead() == selectedNode.getLibrary())     actOnNode=(ComponentNode)selectedNode;
 else     actOnNode=new OperationNode((ServiceNode)selectedNode.getLibrary().getServiceRoot().getChildren().get(0),"String_Node_Str");
  }
  if (actOnNode == null)   DialogUserNotifier.openWarning("String_Node_Str","String_Node_Str" + selectedNode + "String_Node_Str");
  return actOnNode;
}

Fixed version (ground truth):
/** 
 * Create a component in the head library that versions (extends) the selected node. Prompts the user to confirm before creating node.
 * @return newly created node or null if user cancelled or error.
 */
public ComponentNode createVersionExtension(Node selectedNode){
  ComponentNode actOnNode=null;
  boolean result=false;
  if (selectedNode.getChain().getHead().isPatchVersion()) {
    if (!selectedNode.isExtensionPointFacet()) {
      if (result=postConfirm("String_Node_Str",selectedNode))       actOnNode=((ComponentNode)selectedNode).createPatchVersionComponent();
    }
  }
 else   if (selectedNode.getChain().getHead().isMinorOrMajorVersion()) {
    if (selectedNode instanceof VersionedObjectInterface) {
      if (result=postConfirm("String_Node_Str",selectedNode))       actOnNode=((VersionedObjectInterface)selectedNode).createMinorVersionComponent();
    }
 else     if (selectedNode.isEditable_inService())     if (selectedNode.getLibrary().getChain().getHead() == selectedNode.getLibrary())     actOnNode=(ComponentNode)selectedNode;
 else     actOnNode=new OperationNode((ServiceNode)selectedNode.getLibrary().getServiceRoot().getChildren().get(0),"String_Node_Str");
  }
  if (actOnNode == null && result == true)   DialogUserNotifier.openWarning("String_Node_Str","String_Node_Str" + selectedNode + "String_Node_Str");
  return actOnNode;
}
Program: 136318
Project: 136318
Buggy source:
/** 
 * Is the owning object editable and new to the chain. The object is represented by one or more nodes with the same name within the chain. Properties in an object in a head library are new and therefore editable.
 * @return True if this node is editable AND is not in a chain, OR it is in the latest library of the chain AND notin a previous version.
 */
public boolean isEditable_newToChain(){
  if (getLibrary() == null || isDeleted() || !isEditable())   return false;
  if (this instanceof NavNode && !(this instanceof FamilyNode))   return false;
  if (getChain() == null)   return true;
  if (getChain().getHead().isPatchVersion())   if (getOwningComponent() instanceof ExtensionPointNode)   return !isInheritedProperty();
 else   return false;
  if (isInService())   return getLibrary().getChain().getHead() == getLibrary();
  if (getOwningComponent().getVersionNode() == null)   return true;
  if (getLibrary() != getChain().getHead())   return false;
  if (this instanceof PropertyNode)   return !isInheritedProperty();
  return getOwningComponent().getVersionNode().getPreviousVersion() == null;
}

Fixed version (ground truth):
/** 
 * Is the owning object editable and new to the chain. The object is represented by one or more nodes with the same name within the chain. Properties in an object in a head library are new and therefore editable.
 * @return True if this node is editable AND is not in a chain, OR it is in the latest library of the chain AND notin a previous version.
 */
public boolean isEditable_newToChain(){
  if (getLibrary() == null || isDeleted() || !isEditable())   return false;
  if (getChain() == null)   return true;
  if (getChain().getHead().isPatchVersion())   if (getOwningComponent() instanceof ExtensionPointNode)   return !isInheritedProperty();
 else   return false;
  if (isInService())   return getLibrary().getChain().getHead() == getLibrary();
  if (getOwningComponent().getVersionNode() == null)   return true;
  if (getLibrary() != getChain().getHead())   return false;
  if (this instanceof PropertyNode)   return !isInheritedProperty();
  return getOwningComponent().getVersionNode().getPreviousVersion() == null;
}
Program: 136319
Project: 136319
Buggy source:
public static boolean openConfirm(final String title,final String message){
  if (!OtmRegistry.getMainWindow().hasDisplay()) {
    LOGGER.warn("String_Node_Str" + message);
    return true;
  }
  boolean ret;
  ret=MessageDialog.openConfirm(OtmRegistry.getActiveShell(),title,message);
  return ret;
}

Fixed version (ground truth):
/** 
 * @return true if the user presses the OK button, false otherwise
 */
public static boolean openConfirm(final String title,final String message){
  if (!OtmRegistry.getMainWindow().hasDisplay()) {
    LOGGER.warn("String_Node_Str" + message);
    return true;
  }
  boolean ret;
  ret=MessageDialog.openConfirm(OtmRegistry.getActiveShell(),title,message);
  return ret;
}
Program: 136320
Project: 136320
Buggy source:
public Node getSubject(){
  if (tlObj.getBusinessObjectRef() != null)   subject=this.getNode(tlObj.getBusinessObjectRef().getListeners());
  return subject;
}

Fixed version (ground truth):
public Node getSubject(){
  if (tlObj != null && tlObj.getBusinessObjectRef() != null)   subject=this.getNode(tlObj.getBusinessObjectRef().getListeners());
  return subject;
}
Program: 136321
Project: 136321
Buggy source:
/** 
 * Create a resource in the library of the libraryMember.
 */
public ResourceNode(Node libraryMember){
  super(new TLResource());
  if (libraryMember.getName().isEmpty())   tlObj.setName("String_Node_Str");
 else   tlObj.setName(libraryMember.getName() + "String_Node_Str");
  libraryMember.getLibrary().addMember(this);
}

Fixed version (ground truth):
/** 
 * Create a resource in the library of the libraryMember.
 */
public ResourceNode(BusinessObjectNode businessObject){
  super(new ResourceBuilder().buildTL(businessObject));
  tlObj=getTLModelObject();
  businessObject.getLibrary().addMember(this);
}
Program: 136322
Project: 136322
Buggy source:
public boolean isValid(){
  ValidationFindings findings=TLModelCompileValidator.validateModelElement(tlObj);
  return findings.isEmpty();
}

Fixed version (ground truth):
public boolean isValid(){
  return TLModelCompileValidator.validateModelElement(tlObj).isEmpty();
}
Program: 136323
Project: 136323
Buggy source:
@Override public TLResource getTLModelObject(){
  return tlObj;
}

Fixed version (ground truth):
@Override public TLResource getTLModelObject(){
  if (tlObj == null)   tlObj=(TLResource)modelObject.getTLModelObj();
  return tlObj;
}
Program: 136324
Project: 136324
Buggy source:
@Override protected void addMOChildren(){
  TLResource tlObj=(TLResource)getTLModelObject();
  for (  TLParamGroup tlp : tlObj.getParamGroups())   new ParamGroup(tlp);
  for (  TLAction action : tlObj.getActions())   new ActionNode(action);
  for (  TLActionFacet af : tlObj.getActionFacets())   new ActionFacet(af);
}

Fixed version (ground truth):
@Override protected void addMOChildren(){
  if (tlObj != null) {
    for (    TLParamGroup tlp : tlObj.getParamGroups())     new ParamGroup(tlp);
    for (    TLAction action : tlObj.getActions())     new ActionNode(action);
    for (    TLActionFacet af : tlObj.getActionFacets())     new ActionFacet(af);
  }
}
Program: 136325
Project: 136325
Buggy source:
private TLResource buildTLResource(){
  final String NAME="String_Node_Str";
  TLResource resource=new TLResource();
  resource.setName(NAME);
  TLParamGroup params=new TLParamGroup();
  resource.addParamGroup(params);
  params.setName(NAME);
  TLParameter parameter=new TLParameter();
  params.addParameter(parameter);
  parameter.setFieldRefName(NAME);
  TLAction action=new TLAction();
  resource.addAction(action);
  action.setActionId(NAME);
  TLActionResponse response=new TLActionResponse();
  action.addResponse(response);
  response.setPayloadTypeName(NAME);
  TLActionRequest request=new TLActionRequest();
  action.setRequest(request);
  request.setPayloadTypeName(NAME);
  TLActionFacet facet=new TLActionFacet();
  resource.addActionFacet(facet);
  facet.setName(NAME);
  return resource;
}

Fixed version (ground truth):
private TLResource buildTLResource(){
  return new ResourceBuilder().buildTL();
}
Program: 136326
Project: 136326
Buggy source:
private void setExample(final OtmEventData wd){
  final Node n=(Node)mc.getCurrentNode_PropertiesView();
  final String text=wd.getText();
  if (n instanceof PropertyNode && ((PropertyNode)n).getExampleHandler() != null)   ((PropertyNode)n).getExampleHandler().set(text,n.getLibrary().getDefaultContextId());
}

Fixed version (ground truth):
private void setExample(final OtmEventData wd){
  final Node n=(Node)mc.getCurrentNode_PropertiesView();
  final String text=wd.getText();
  if (n instanceof PropertyNode)   ((PropertyNode)n).setExample(text);
}
Program: 136327
Project: 136327
Buggy source:
private void setEquivalence(final OtmEventData wd){
  final Node n=(Node)mc.getCurrentNode_PropertiesView();
  final String text=wd.getText();
  if (n instanceof PropertyNode && ((PropertyNode)n).getEquivalentHandler() != null) {
    ((PropertyNode)n).getEquivalentHandler().set(text,n.getLibrary().getDefaultContextId());
  }
}

Fixed version (ground truth):
private void setEquivalence(final OtmEventData wd){
  final Node n=(Node)mc.getCurrentNode_PropertiesView();
  final String text=wd.getText();
  if (n instanceof PropertyNode)   ((PropertyNode)n).setEquivalent(text);
}
Program: 136328
Project: 136328
Buggy source:
/** 
 * Create a component in the head library that versions (extends) the selected node. Prompts the user to confirm before creating node.
 * @return newly created node or null if user cancelled or error.
 */
public ComponentNode createVersionExtension(Node selectedNode){
  ComponentNode actOnNode=null;
  if (selectedNode.getChain().getHead().isPatchVersion()) {
    if (!selectedNode.isExtensionPointFacet()) {
      if (postConfirm("String_Node_Str",selectedNode))       actOnNode=((ComponentNode)selectedNode).createPatchVersionComponent();
    }
  }
 else   if (selectedNode.getChain().getHead().isMinorOrMajorVersion()) {
    if (selectedNode instanceof VersionedObjectInterface) {
      if (postConfirm("String_Node_Str",selectedNode))       actOnNode=((VersionedObjectInterface)selectedNode).createMinorVersionComponent();
    }
 else     if (selectedNode.isEditable_inService())     if (selectedNode.getLibrary().getChain().getHead() == selectedNode.getLibrary())     actOnNode=(ComponentNode)selectedNode;
 else     actOnNode=new OperationNode((ServiceNode)selectedNode.getLibrary().getServiceRoot().getChildren().get(0),"String_Node_Str");
  }
  return actOnNode;
}

Fixed version (ground truth):
/** 
 * Create a component in the head library that versions (extends) the selected node. Prompts the user to confirm before creating node.
 * @return newly created node or null if user cancelled or error.
 */
public ComponentNode createVersionExtension(Node selectedNode){
  ComponentNode actOnNode=null;
  if (selectedNode.getChain().getHead().isPatchVersion()) {
    if (!selectedNode.isExtensionPointFacet()) {
      if (postConfirm("String_Node_Str",selectedNode))       actOnNode=((ComponentNode)selectedNode).createPatchVersionComponent();
    }
  }
 else   if (selectedNode.getChain().getHead().isMinorOrMajorVersion()) {
    if (selectedNode instanceof VersionedObjectInterface) {
      if (postConfirm("String_Node_Str",selectedNode))       actOnNode=((VersionedObjectInterface)selectedNode).createMinorVersionComponent();
    }
 else     if (selectedNode.isEditable_inService())     if (selectedNode.getLibrary().getChain().getHead() == selectedNode.getLibrary())     actOnNode=(ComponentNode)selectedNode;
 else     actOnNode=new OperationNode((ServiceNode)selectedNode.getLibrary().getServiceRoot().getChildren().get(0),"String_Node_Str");
  }
  if (actOnNode == null)   DialogUserNotifier.openWarning("String_Node_Str","String_Node_Str" + selectedNode + "String_Node_Str");
  return actOnNode;
}
Program: 136329
Project: 136329
Buggy source:
protected ComponentNode createMinorVersionComponent(ComponentNode newNode){
  Node owner=this.getOwningComponent();
  if (owner.getLibrary() == owner.getChain().getHead())   return null;
  newNode.getTypeClass().setBaseType(owner);
  if (newNode.getName() == null || newNode.getName().isEmpty())   newNode.setName(owner.getName());
  owner.getChain().getHead().addMember(newNode);
  return newNode;
}

Fixed version (ground truth):
protected ComponentNode createMinorVersionComponent(ComponentNode newNode){
  if (newNode.getModelObject() instanceof EmptyMO) {
    return null;
  }
  Node owner=this.getOwningComponent();
  if (owner.getLibrary() == owner.getChain().getHead())   return null;
  newNode.getTypeClass().setBaseType(owner);
  if (newNode.getName() == null || newNode.getName().isEmpty())   newNode.setName(owner.getName());
  owner.getChain().getHead().addMember(newNode);
  return newNode;
}
Program: 136331
Project: 136331
Buggy source:
/** 
 * @return False for node that can not be deleted: not-editable, facets, simpleFacets. Custom and Query Facets aredelete-able. Libraries are <b>always</b> delete-able
 */
public boolean isDeleteable(){
  if (getLibrary() == null)   return false;
  if (getLibrary().getChain() != null)   if (getLibrary().getChain().getHead().isPatchVersion() && !(getOwningComponent() instanceof ExtensionPointNode))   return false;
  if (getOwningComponent().getParent() == null)   return true;
  if (isInService())   return getLibrary().getChain().getHead() == getLibrary() && isEditable();
  return getLibrary().isManaged() ? isInHead() && isEditable() : isEditable();
}

Fixed version (ground truth):
/** 
 * @return False for node that can not be deleted: not-editable, facets, simpleFacets. Custom and Query Facets aredelete-able. Libraries are <b>always</b> delete-able
 */
public boolean isDeleteable(){
  if (getLibrary() == null)   return false;
  if (getLibrary().getChain() != null)   if (getLibrary().getChain().getHead().isPatchVersion() && !(getOwningComponent() instanceof ExtensionPointNode))   return false;
  if (getOwningComponent().getParent() == null)   return true;
  if (isInService() && getChain() != null)   return getLibrary().getChain().getHead() == getLibrary() && isEditable();
  return getLibrary().isManaged() ? isInHead() && isEditable() : isEditable();
}
Program: 136332
Project: 136332
Buggy source:
private void testNewVersion(LibraryNode ln,LibraryNode major){
  List<Node> namedTypes=major.getDescendants_NamedTypes();
  for (  Node n : namedTypes) {
    if (n instanceof VersionedObjectInterface) {
      LOGGER.debug("String_Node_Str" + n);
      Node nc=((VersionedObjectInterface)n).createMinorVersionComponent();
      assertNotNull(nc);
      assertNotNull(nc.getLibrary());
      assertNotNull(nc.getExtendsType());
      assertEquals(n,nc.getExtendsType());
    }
  }
}

Fixed version (ground truth):
private void testNewVersion(LibraryNode ln,LibraryNode major){
  List<Node> namedTypes=major.getDescendants_NamedTypes();
  for (  Node n : namedTypes) {
    if (n instanceof VersionedObjectInterface) {
      LOGGER.debug("String_Node_Str" + n);
      Node nc=((VersionedObjectInterface)n).createMinorVersionComponent();
      assertNotNull(nc);
      assertNotNull(nc.getLibrary());
      assertNotNull(nc.getExtendsType());
      assertEquals(n,nc.getExtendsType());
      for (      Node t : nc.getParent().getChildren())       if (t.getName().equals(nc.getName()))       LOGGER.debug("String_Node_Str" + t);
    }
  }
}
Program: 136333
Project: 136333
Buggy source:
/** 
 * <pre> 1. Manage Library in repository  2. Lock Library  3. Remove repository from step 1.  4. Reopen project with library </pre>
 * @throws LibrarySaveException
 * @throws RepositoryException
 */
@Test public void openLibraryWithMissingRepository() throws LibrarySaveException, RepositoryException {
  ProjectNode uploadProject=createProject("String_Node_Str",getRepositoryForTest(),"String_Node_Str");
  LibraryNode testLibary=LibraryNodeBuilder.create("String_Node_Str",getRepositoryForTest().getNamespace() + "String_Node_Str","String_Node_Str",new Version(1,0,0)).build(uploadProject,pc);
  LibraryChainNode chain=rc.manage(getRepositoryForTest(),Collections.singletonList(testLibary)).get(0);
  boolean locked=rc.lock(chain.getHead());
  Assert.assertTrue(locked);
  Assert.assertEquals(RepositoryItemState.MANAGED_WIP,chain.getHead().getProjectItem().getState());
  String namespace=getRepositoryForTest().getNamespace();
  try {
    rc.removeRemoteRepository(getRepositoryForTest());
    pc.close(uploadProject);
    DefaultProjectController dc=(DefaultProjectController)pc;
    ProjectNode reopenedProject=dc.open(uploadProject.getProject().getProjectFile().toString());
    Assert.assertNotNull("String_Node_Str" + "String_Node_Str" + "String_Node_Str",reopenedProject);
  }
  finally {
    readdRemoteRepository();
  }
}

Fixed version (ground truth):
/** 
 * <pre> 1. Manage Library in repository  2. Lock Library  3. Remove repository from step 1.  4. Reopen project with library </pre>
 * @throws LibrarySaveException
 * @throws RepositoryException
 */
@Test public void openLibraryWithMissingRepository() throws LibrarySaveException, RepositoryException {
  ProjectNode uploadProject=createProject("String_Node_Str",getRepositoryForTest(),"String_Node_Str");
  LibraryNode testLibary=LibraryNodeBuilder.create("String_Node_Str",getRepositoryForTest().getNamespace() + "String_Node_Str","String_Node_Str",new Version(1,0,0)).build(uploadProject,pc);
  LibraryChainNode chain=rc.manage(getRepositoryForTest(),Collections.singletonList(testLibary)).get(0);
  boolean locked=rc.lock(chain.getHead());
  Assert.assertTrue(locked);
  Assert.assertEquals(RepositoryItemState.MANAGED_WIP,chain.getHead().getProjectItem().getState());
  String namespace=getRepositoryForTest().getNamespace();
  try {
    rc.removeRemoteRepository(getRepositoryForTest());
    pc.close(uploadProject);
    DefaultProjectController dc=(DefaultProjectController)pc;
    ProjectNode reopenedProject=dc.open(uploadProject.getProject().getProjectFile().toString(),null);
    Assert.assertNotNull("String_Node_Str" + "String_Node_Str" + "String_Node_Str",reopenedProject);
  }
  finally {
    readdRemoteRepository();
  }
}
Program: 136334
Project: 136334
Buggy source:
@Override public boolean isEnabled(){
  Node node=mc.getSelectedNode_NavigatorView();
  if ((node instanceof ProjectNode))   project=(ProjectNode)node;
 else {
    node=node.getLibrary();
    if (node != null)     project=((LibraryNode)node).getProject();
  }
  return project != null ? !project.isBuiltIn() : false;
}

Fixed version (ground truth):
@Override public boolean isEnabled(){
  Node node=mc.getSelectedNode_NavigatorView();
  if (node == null)   return false;
  if ((node instanceof ProjectNode))   project=(ProjectNode)node;
 else {
    node=node.getLibrary();
    if (node != null)     project=((LibraryNode)node).getProject();
  }
  return project != null ? !project.isBuiltIn() : false;
}
Program: 136335
Project: 136335
Buggy source:
private void setEditState(INode node){
  bbManager.enable(node.isEditable());
  if (node.isEditable()) {
  }
 else {
  }
}

Fixed version (ground truth):
private void setEditState(INode node){
}
Program: 136336
Project: 136336
Buggy source:
public String getLibraryVersion(LibraryNode lib){
  NamespaceHandler nsHandler=lib.getNsHandler();
  ProjectItem projectItem=lib.getProjectItem();
  String version="String_Node_Str";
  if (projectItem != null && nsHandler != null && !RepositoryItemState.UNMANAGED.equals(projectItem.getState())) {
    version=nsHandler.getNSVersion(lib.getNamespace());
  }
  return version;
}

Fixed version (ground truth):
public String getLibraryVersion(LibraryNode lib){
  String version="String_Node_Str";
  NamespaceHandler nsHandler=null;
  if (lib != null) {
    nsHandler=lib.getNsHandler();
    ProjectItem projectItem=lib.getProjectItem();
    if (projectItem != null && nsHandler != null && !RepositoryItemState.UNMANAGED.equals(projectItem.getState())) {
      version=nsHandler.getNSVersion(lib.getNamespace());
    }
  }
  return version;
}
Program: 136337
Project: 136337
Buggy source:
private void expandAndSelect(Node node){
  LinkedList<Node> parents=new LinkedList<Node>();
  while (viewer.testFindItem(node) == null) {
    node=node.getParent();
    if (node == null) {
      return;
    }
    parents.addFirst(node);
  }
  for (  Node p : parents) {
    viewer.expandToLevel(p,1);
  }
}

Fixed version (ground truth):
private void expandAndSelect(Node node){
  if (node != null) {
    LinkedList<Node> parents=new LinkedList<Node>();
    while (viewer.testFindItem(node) == null) {
      node=node.getParent();
      if (node == null) {
        return;
      }
      parents.addFirst(node);
    }
    for (    Node p : parents) {
      viewer.expandToLevel(p,1);
    }
  }
}
Program: 136338
Project: 136338
Buggy source:
/** 
 * Actual node where the inherited child is declared.
 * @return type inherited from or null if no inheritance. Note, Open Enumerations have aninherited attribute but null for inherits from.
 */
public Node getInheritsFrom(){
  return inheritsFrom;
}

Fixed version (ground truth):
/** 
 * Actual node where the inherited child is declared.
 * @return type inherited from or null if no inheritance. Note, Open Enumerations have an inherited attribute butnull for inherits from.
 */
public Node getInheritsFrom(){
  return inheritsFrom;
}
Program: 136339
Project: 136339
Buggy source:
/** 
 * Add a new property to <i>this</i>facet.
 * @param property node representing a TLProperty, TLIndicator, etc
 * @param index where to add the property in the child list.
 */
public void addProperty(final Node property,int index){
  if (!(this instanceof FacetNode)) {
    LOGGER.error("String_Node_Str" + this);
    return;
  }
  if (this.isSimpleFacet()) {
    if (property.isProperty())     getChildren().get(0).setAssignedType(property.getAssignedType());
 else     getChildren().get(0).setAssignedType(property);
  }
 else {
    property.setParent(this);
    if (index >= 0)     linkChild(property,index);
 else     linkChild(property,false);
    final ModelObject<?> propMO=property.getModelObject();
    final ModelObject<?> mo=getModelObject();
    if (propMO != null && mo != null) {
      if (index < 0) {
        propMO.addToTLParent(mo);
      }
 else {
        propMO.addToTLParent(mo,index);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Add a new property to <i>this</i>facet.
 * @param property node representing a TLProperty, TLIndicator, etc
 * @param index where to add the property in the child list.
 */
public void addProperty(final Node property,int index){
  if (!(this instanceof FacetNode) && !(this.isEnumeration())) {
    LOGGER.error("String_Node_Str" + this);
    return;
  }
  if (this.isSimpleFacet()) {
    if (property.isProperty())     getChildren().get(0).setAssignedType(property.getAssignedType());
 else     getChildren().get(0).setAssignedType(property);
  }
 else {
    property.setParent(this);
    if (index >= 0)     linkChild(property,index);
 else     linkChild(property,false);
    final ModelObject<?> propMO=property.getModelObject();
    final ModelObject<?> mo=getModelObject();
    if (propMO != null && mo != null) {
      if (index < 0) {
        propMO.addToTLParent(mo);
      }
 else {
        propMO.addToTLParent(mo,index);
      }
    }
  }
}
Program: 136340
Project: 136340
Buggy source:
public EnumerationClosedNode(EnumerationOpenNode openEnum){
  this(new TLClosedEnumeration());
  if (openEnum.getLibrary() != null) {
    setLibrary(openEnum.getLibrary());
    getLibrary().getTLaLib().addNamedMember((LibraryMember)this.getTLModelObject());
    for (    Node lit : openEnum.getChildren()) {
      addProperty(lit.clone(this,null));
    }
    getLibrary().getTLaLib().removeNamedMember((LibraryMember)openEnum.getTLModelObject());
    openEnum.unlinkNode();
    openEnum.getTypeClass().replaceTypeProvider(this,null);
    getLibrary().getSimpleRoot().linkChild(this);
  }
  setDocumentation(openEnum.getDocumentation());
  setName(openEnum.getName());
  openEnum.delete();
}

Fixed version (ground truth):
public EnumerationClosedNode(EnumerationOpenNode openEnum){
  this(new TLClosedEnumeration());
  if (openEnum.getLibrary() != null) {
    setLibrary(openEnum.getLibrary());
    getLibrary().getTLaLib().addNamedMember((LibraryMember)this.getTLModelObject());
    for (    Node lit : openEnum.getChildren()) {
      addProperty(lit.clone(this,null));
    }
    getLibrary().getTLaLib().removeNamedMember((LibraryMember)openEnum.getTLModelObject());
    openEnum.unlinkNode();
    openEnum.getTypeClass().replaceTypeProvider(this,null);
    getLibrary().getSimpleRoot().linkChild(this);
    if (getLibrary().isInChain())     getChain().add(this);
    setDocumentation(openEnum.getDocumentation());
    setName(openEnum.getName());
    openEnum.delete();
  }
}
Program: 136341
Project: 136341
Buggy source:
/** 
 * Create a family node for type aggregates. There are no back links in type aggregates.
 * @param n
 * @param peer
 */
public AggregateFamilyNode(AggregateNode parent,Node n,Node peer){
  super(NodeNameUtils.makeFamilyName(n.getName()),parent);
  setLibrary(n.getLibrary());
  getChildren().add(n);
  getChildren().add(peer);
  parent.getChildren().remove(peer);
}

Fixed version (ground truth):
/** 
 * Create a family node for type aggregates. There are no back links in type aggregates.
 * @param parent
 * @param name
 */
public AggregateFamilyNode(AggregateNode parent,String name){
  super(name,parent);
  setLibrary(parent.getLibrary());
}
Program: 136342
Project: 136342
Buggy source:
/** 
 * Adds node to the aggregate node's children list if appropriate.
 * @param node
 * @return
 */
public boolean add(ComponentNode node){
switch (type) {
case ComplexTypes:
    if (!(node instanceof ComplexComponentInterface))     throw new IllegalStateException("String_Node_Str");
  break;
case SimpleTypes:
if (!(node instanceof SimpleComponentInterface)) throw new IllegalStateException("String_Node_Str");
break;
case Service:
if (!(node instanceof ServiceNode || (node instanceof OperationNode))) throw new IllegalStateException("String_Node_Str");
break;
default :
throw new IllegalStateException("String_Node_Str" + node.getClass().getSimpleName());
}
boolean toBeAdded=true;
int doFamily=0;
String familyName=NodeNameUtils.makeFamilyName(node.getName());
for (Node n : getChildren()) {
if (n.getName().startsWith(familyName)) doFamily++;
if (!n.isFamily() && n.getName().equals(node.getName())) {
if (node.getLibrary().getTLaLib().isLaterVersion(n.getLibrary().getTLaLib())) {
getChildren().remove(n);
insertPreviousVersion(node,(ComponentNode)n);
toBeAdded=true;
doFamily--;
}
 else toBeAdded=false;
break;
}
}
if (toBeAdded) if (doFamily > 0) addToFamily(node);
 else {
getChildren().add(node);
}
return toBeAdded;
}

Fixed version (ground truth):
/** 
 * Adds node to the aggregate node's children list if appropriate.
 * @param node
 * @return
 */
public boolean add(ComponentNode node){
switch (type) {
case ComplexTypes:
    if (!(node instanceof ComplexComponentInterface))     throw new IllegalStateException("String_Node_Str");
  break;
case SimpleTypes:
if (!(node instanceof SimpleComponentInterface)) throw new IllegalStateException("String_Node_Str");
break;
case Service:
if (!(node instanceof ServiceNode || (node instanceof OperationNode))) throw new IllegalStateException("String_Node_Str");
break;
default :
throw new IllegalStateException("String_Node_Str" + node.getClass().getSimpleName());
}
String familyName=NodeNameUtils.makeFamilyName(node.getName());
for (Node n : getChildren()) {
if (!n.isFamily() && n.getName().equals(node.getName())) {
if (node.getLibrary().getTLaLib().isLaterVersion(n.getLibrary().getTLaLib())) {
getChildren().remove(n);
insertPreviousVersion(node,(ComponentNode)n);
return true;
}
 else {
return false;
}
}
}
AggregateFamilyNode family=findFamilyNode(getChildren(),familyName);
List<Node> nodes=findPrefixedNodes(getChildren(),familyName + "String_Node_Str");
if (!nodes.isEmpty()) {
if (family == null) {
family=new AggregateFamilyNode(this,familyName);
}
List<Node> kids=new ArrayList<Node>(nodes);
for (Node n : kids) {
getChildren().remove(n);
family.getChildren().add(n);
}
}
if (family != null) {
family.getChildren().add(node);
}
 else {
getChildren().add(node);
}
return true;
}
Program: 136343
Project: 136343
Buggy source:
@Override public boolean isEnabled(Node currentNode){
  if (currentNode == null)   return false;
  if (!(currentNode instanceof ComponentNode))   return false;
  if (currentNode.getChain() != null)   return currentNode.getChain().getEditStatus().equals(NodeEditStatus.FULL);
  return currentNode.isEditable();
}

Fixed version (ground truth):
@Override public boolean isEnabled(Node currentNode){
  if (currentNode == null)   return false;
  if (!(currentNode instanceof ComponentNode))   return false;
  if (currentNode.isNewToChain())   return currentNode.isEditable();
  if (currentNode.getChain() != null)   return currentNode.getChain().getEditStatus().equals(NodeEditStatus.FULL);
  return currentNode.isEditable();
}
Program: 136344
Project: 136344
Buggy source:
/** 
 * @return False for node that can not be deleted: not-editable, facets, simpleFacets. Custom and Query Facets aredelete-able.
 */
public boolean isDeleteable(){
  if (getLibrary() == null)   return false;
  if (getOwningComponent().getParent().isOperation())   return isEditable();
  return getLibrary().isManaged() ? isInHead() && isEditable() : isEditable();
}

Fixed version (ground truth):
/** 
 * @return False for node that can not be deleted: not-editable, facets, simpleFacets. Custom and Query Facets aredelete-able.
 */
public boolean isDeleteable(){
  if (getLibrary() == null)   return false;
  if (getOwningComponent().getParent() == null)   return true;
  if (getOwningComponent().getParent().isOperation())   return isEditable();
  return getLibrary().isManaged() ? isInHead() && isEditable() : isEditable();
}
Program: 136346
Project: 136346
Buggy source:
public BusinessObjectNode(VWA_Node vwa){
  this(new TLBusinessObject());
  setLibrary(vwa.getLibrary());
  setName(vwa.getName());
  setDocumentation(vwa.getDocumentation());
  getSummaryFacet().copyFacet((FacetNode)vwa.getAttributeFacet());
}

Fixed version (ground truth):
public BusinessObjectNode(VWA_Node vwa){
  this(new TLBusinessObject());
  vwa.getLibrary().addMember(this);
  setName(vwa.getName());
  setDocumentation(vwa.getDocumentation());
  getSummaryFacet().copyFacet((FacetNode)vwa.getAttributeFacet());
}
Program: 136347
Project: 136347
Buggy source:
public CoreObjectNode(VWA_Node vwa){
  this(new TLCoreObject());
  setLibrary(vwa.getLibrary());
  setName(vwa.getName());
  setDocumentation(vwa.getDocumentation());
  ((FacetNode)getSummaryFacet()).copyFacet((FacetNode)vwa.getAttributeFacet());
  setSimpleType(vwa.getSimpleType());
}

Fixed version (ground truth):
public CoreObjectNode(VWA_Node vwa){
  this(new TLCoreObject());
  vwa.getLibrary().addMember(this);
  setName(vwa.getName());
  setDocumentation(vwa.getDocumentation());
  ((FacetNode)getSummaryFacet()).copyFacet((FacetNode)vwa.getAttributeFacet());
  setSimpleType(vwa.getSimpleType());
}