nus-yam/ex-repair huggingface dataset:
Program: 136166
Project: 136166
Buggy source:
protected boolean setParameterGroup(ParamGroup group){
  if (tlObj != null && tlObj.getParamGroup() != null)   ((ParamGroup)getNode(tlObj.getParamGroup().getListeners())).removeListeners(this);
  if (group != null) {
    tlObj.setParamGroup(group.tlObj);
    group.addListeners(this);
  }
 else {
    tlObj.setParamGroup(null);
  }
  pathTemplate.setParameters();
  return false;
}

Fixed version (ground truth):
protected boolean setParameterGroup(ParamGroup group){
  if (tlObj != null && tlObj.getParamGroup() != null) {
    Node n=getNode(tlObj.getParamGroup().getListeners());
    if (n instanceof ParamGroup)     ((ParamGroup)n).removeListeners(this);
  }
  if (group != null) {
    tlObj.setParamGroup(group.tlObj);
    group.addListeners(this);
  }
 else {
    tlObj.setParamGroup(null);
  }
  pathTemplate.setParameters();
  return false;
}
Program: 136167
Project: 136167
Buggy source:
@Override public List<ResourceField> getFields(){
  List<ResourceField> fields=new ArrayList<ResourceField>();
  new ResourceField(fields,getPayloadName(),MSGKEY + "String_Node_Str",ResourceFieldType.Enum,new PayloadTypeListener(),getOwningComponent().getActionFacetNames());
  new ResourceField(fields,tlObj.getMimeTypes().toString(),MSGKEY + "String_Node_Str",ResourceFieldType.EnumList,new MimeTypeListener(),getMimeTypeStrings());
  new ResourceField(fields,tlObj.getParamGroupName(),MSGKEY + "String_Node_Str",ResourceFieldType.Enum,new ParamGroupListener(),getOwningComponent().getParameterGroupNames(false));
  new ResourceField(fields,tlObj.getPathTemplate(),MSGKEY + "String_Node_Str",ResourceField.ResourceFieldType.String,new PathTemplateListener());
  new ResourceField(fields,getHttpMethodAsString(),MSGKEY + "String_Node_Str",ResourceFieldType.Enum,new HttpMethodListener(),getHttpMethodStrings());
  return fields;
}

Fixed version (ground truth):
@Override public List<ResourceField> getFields(){
  List<ResourceField> fields=new ArrayList<>();
  new ResourceField(fields,getPayloadName(),MSGKEY + "String_Node_Str",ResourceFieldType.Enum,new PayloadTypeListener(),getOwningComponent().getActionFacetNames());
  new ResourceField(fields,tlObj.getMimeTypes().toString(),MSGKEY + "String_Node_Str",ResourceFieldType.EnumList,new MimeTypeListener(),getMimeTypeStrings());
  new ResourceField(fields,tlObj.getParamGroupName(),MSGKEY + "String_Node_Str",ResourceFieldType.Enum,new ParamGroupListener(),getOwningComponent().getParameterGroupNames(false));
  new ResourceField(fields,tlObj.getPathTemplate(),MSGKEY + "String_Node_Str",ResourceField.ResourceFieldType.String,new PathTemplateListener());
  new ResourceField(fields,getHttpMethodAsString(),MSGKEY + "String_Node_Str",ResourceFieldType.Enum,new HttpMethodListener(),getHttpMethodStrings());
  return fields;
}
Program: 136168
Project: 136168
Buggy source:
public List<Node> getPossibleFields(){
  List<Node> fields=new ArrayList<Node>();
  for (  TLMemberField<?> field : ResourceCodegenUtils.getEligibleParameterFields((TLFacet)getFacetRef().getTLModelObject())) {
    Node f=this.getNode(((TLModelElement)field).getListeners());
    if (f != null)     fields.add(f);
 else     LOGGER.debug("String_Node_Str" + field.getName());
  }
  return fields;
}

Fixed version (ground truth):
public List<Node> getPossibleFields(){
  List<Node> fields=new ArrayList<>();
  for (  TLMemberField<?> field : ResourceCodegenUtils.getEligibleParameterFields((TLFacet)getFacetRef().getTLModelObject())) {
    Node f=this.getNode(((TLModelElement)field).getListeners());
    if (f != null)     fields.add(f);
 else     LOGGER.debug("String_Node_Str" + field.getName());
  }
  return fields;
}
Program: 136169
Project: 136169
Buggy source:
public ParamGroup(ResourceNode rn,ComponentNode fn,boolean idGroup){
  this(rn);
  setIdGroup(idGroup);
  if (fn != null && fn instanceof FacetInterface) {
    setName(fn.getLabel());
    setReferenceFacet((FacetInterface)fn);
  }
}

Fixed version (ground truth):
public ParamGroup(ResourceNode rn,ComponentNode fn,boolean idGroup){
  this(rn);
  setIdGroup(idGroup);
  if (fn != null && fn instanceof FacetInterface) {
    String name=fn.getLabel();
    if (fn instanceof ContextualFacetNode)     name=((ContextualFacetNode)fn).getName();
    setName(name);
    setReferenceFacet((FacetInterface)fn);
  }
}
Program: 136170
Project: 136170
Buggy source:
/** 
 * @return list of strings for the components of the query
 */
public List<String> getQueryTemplates(){
  ArrayList<String> contributions=new ArrayList<String>();
  boolean firstParam=true;
  for (  Node param : getChildren()) {
    if (((ResourceParameter)param).getLocation().equals(TLParamLocation.QUERY.toString()))     if (firstParam) {
      contributions.add("String_Node_Str" + getQueryParam(param));
      firstParam=false;
    }
 else     contributions.add("String_Node_Str" + getQueryParam(param));
  }
  return contributions;
}

Fixed version (ground truth):
/** 
 * @return list of strings for the components of the query
 */
public List<String> getQueryTemplates(){
  ArrayList<String> contributions=new ArrayList<>();
  boolean firstParam=true;
  for (  Node param : getChildren()) {
    if (((ResourceParameter)param).getLocation().equals(TLParamLocation.QUERY.toString()))     if (firstParam) {
      contributions.add("String_Node_Str" + getQueryParam(param));
      firstParam=false;
    }
 else     contributions.add("String_Node_Str" + getQueryParam(param));
  }
  return contributions;
}
Program: 136171
Project: 136171
Buggy source:
/** 
 * @return an array of string template contributions based on parameters in this group
 */
public List<String> getPathTemplates(){
  ArrayList<String> contributions=new ArrayList<String>();
  for (  Node param : getChildren()) {
    if (((ResourceParameter)param).isPathParam())     contributions.add("String_Node_Str" + param.getName() + "String_Node_Str");
  }
  return contributions;
}

Fixed version (ground truth):
/** 
 * @return an array of string template contributions based on parameters in this group
 */
public List<String> getPathTemplates(){
  ArrayList<String> contributions=new ArrayList<>();
  for (  Node param : getChildren()) {
    if (((ResourceParameter)param).isPathParam())     contributions.add("String_Node_Str" + param.getName() + "String_Node_Str");
  }
  return contributions;
}
Program: 136172
Project: 136172
Buggy source:
/** 
 * Get facet names from subject business object. Omit query facets if this is an ID Parameter Group.
 * @return a string array of subject facet names.
 */
public String[] getSubjectFacets(){
  List<FacetInterface> facets=new ArrayList<FacetInterface>();
  if (getOwningComponent().getSubject() != null)   for (  Node facet : getOwningComponent().getSubject().getChildren()) {
    if (!(facet instanceof FacetInterface))     continue;
    if (isIdGroup() && facet instanceof QueryFacetNode)     continue;
    facets.add((FacetInterface)facet);
  }
  int size=facets.size();
  String[] fs=new String[size];
  int i=0;
  for (  FacetInterface facet : facets)   fs[i++]=ResourceCodegenUtils.getActionFacetReferenceName((TLFacet)facet.getTLModelObject());
  return fs;
}

Fixed version (ground truth):
/** 
 * Get facet names from subject business object. Omit query facets if this is an ID Parameter Group.
 * @return a string array of subject facet names.
 */
public String[] getSubjectFacets(){
  List<FacetInterface> facets=new ArrayList<>();
  if (getOwningComponent().getSubject() != null)   for (  Node facet : getOwningComponent().getSubject().getChildren()) {
    if (!(facet instanceof FacetInterface))     continue;
    if (isIdGroup() && facet instanceof QueryFacetNode)     continue;
    facets.add((FacetInterface)facet);
  }
  int size=facets.size();
  String[] fs=new String[size];
  int i=0;
  for (  FacetInterface facet : facets)   fs[i++]=ResourceCodegenUtils.getActionFacetReferenceName((TLFacet)facet.getTLModelObject());
  return fs;
}
Program: 136173
Project: 136173
Buggy source:
@Override public List<ResourceField> getFields(){
  List<ResourceField> fields=new ArrayList<ResourceField>();
  new ResourceField(fields,getFacetLabel(),"String_Node_Str",ResourceFieldType.Enum,new ReferenceFacetListener(),getSubjectFacets());
  new ResourceField(fields,Boolean.toString(tlObj.isIdGroup()),"String_Node_Str",ResourceFieldType.CheckButton,new IdGroupListener());
  return fields;
}

Fixed version (ground truth):
@Override public List<ResourceField> getFields(){
  List<ResourceField> fields=new ArrayList<>();
  new ResourceField(fields,getFacetLabel(),"String_Node_Str",ResourceFieldType.Enum,new ReferenceFacetListener(),getSubjectFacets());
  new ResourceField(fields,Boolean.toString(tlObj.isIdGroup()),"String_Node_Str",ResourceFieldType.CheckButton,new IdGroupListener());
  return fields;
}
Program: 136174
Project: 136174
Buggy source:
public void clearParameters(){
  List<Node> params=new ArrayList<Node>(getChildren());
  for (  Node p : params)   p.delete();
}

Fixed version (ground truth):
public void clearParameters(){
  List<Node> params=new ArrayList<>(getChildren());
  for (  Node p : params)   p.delete();
}
Program: 136175
Project: 136175
Buggy source:
/** 
 * Populate the passed resource to represent the passed business object.
 * @param rn resource node to populate
 * @param bo business object to use as the subject
 */
public void build(ResourceNode rn,BusinessObjectNode bo){
  if (bo == null || rn == null)   return;
  TLResource rnTL=rn.getTLModelObject();
  rn.setSubject(bo);
  rn.setName(bo.getName() + "String_Node_Str");
  rn.setBasePath("String_Node_Str");
  rnTL.setAbstract(false);
  rnTL.setFirstClass(true);
  ActionFacet subAF=new ActionFacet(rn,null);
  ActionFacet idAF=new ActionFacet(rn,TLFacetType.ID);
  ActionFacet summaryAF=new ActionFacet(rn,TLFacetType.SUMMARY);
  ParamGroup idPG=new ParamGroup(rn,bo.getFacet_ID(),true);
  for (  ComponentNode fn : bo.getQueryFacets()) {
    ParamGroup qpg=new ParamGroup(rn,fn,false);
    ActionNode action=buildAction(rn,idAF,qpg,TLHttpMethod.GET);
    action.setName(fn.getLabel());
  }
  buildAction(rn,idAF,idPG,TLHttpMethod.GET);
  buildAction(rn,subAF,null,TLHttpMethod.POST);
  buildAction(rn,subAF,idPG,TLHttpMethod.PUT);
  buildAction(rn,null,idPG,TLHttpMethod.DELETE);
}

Fixed version (ground truth):
/** 
 * Populate the passed resource to represent the passed business object.
 * @param rn resource node to populate
 * @param bo business object to use as the subject
 */
public void build(ResourceNode rn,BusinessObjectNode bo){
  if (bo == null || rn == null)   return;
  TLResource rnTL=rn.getTLModelObject();
  rn.setSubject(bo);
  rn.setName(bo.getName() + "String_Node_Str");
  rn.setBasePath("String_Node_Str");
  rnTL.setAbstract(false);
  rnTL.setFirstClass(true);
  ActionFacet subAF=new ActionFacet(rn,null);
  subAF.setName(rn.getSubjectName() + "String_Node_Str");
  ActionFacet listAF=new ActionFacet(rn,null);
  listAF.setName(rn.getSubjectName() + "String_Node_Str");
  listAF.setReferenceRepeat(1000);
  listAF.setReferenceType("String_Node_Str");
  ActionFacet idAF=new ActionFacet(rn,TLFacetType.ID);
  ActionFacet summaryAF=new ActionFacet(rn,TLFacetType.SUMMARY);
  ParamGroup idPG=new ParamGroup(rn,bo.getFacet_ID(),true);
  for (  ComponentNode fn : bo.getQueryFacets()) {
    ParamGroup qpg=new ParamGroup(rn,fn,false);
    ActionNode action=buildAction(rn,idAF,qpg,TLHttpMethod.POST);
    action.setName(fn.getName());
    ActionFacet af=new ActionFacet(rn,null);
    af.setReferenceFacetName(((ContextualFacetNode)fn).getLocalName());
    af.setName(fn.getName());
  }
  for (  ComponentNode fn : bo.getCustomFacets()) {
    ParamGroup qpg=new ParamGroup(rn,fn,false);
    ActionFacet af=new ActionFacet(rn,null);
    af.setReferenceFacetName(((ContextualFacetNode)fn).getLocalName());
    af.setName(fn.getName());
  }
  buildAction(rn,idAF,idPG,TLHttpMethod.GET);
  buildAction(rn,subAF,null,TLHttpMethod.POST);
  buildAction(rn,subAF,idPG,TLHttpMethod.PUT);
  buildAction(rn,null,idPG,TLHttpMethod.DELETE);
}
Program: 136176
Project: 136176
Buggy source:
/** 
 * Get all libraries under <i>this</i> project. <p> Returns libraries in chains, not the chain.
 * @return new list of library nodes.
 */
public List<LibraryNode> getLibraries(){
  ArrayList<LibraryNode> libs=new ArrayList<LibraryNode>();
  if (getChildrenHandler() != null)   for (  Node n : getChildrenHandler().get()) {
    if (n instanceof LibraryNavNode) {
      LibraryNavNode lnn=(LibraryNavNode)n;
      libs.addAll(lnn.getLibraries());
    }
  }
  return libs;
}

Fixed version (ground truth):
/** 
 * Get all libraries under <i>this</i> project. <p> Returns libraries in chains, not the chain.
 * @return new list of library nodes.
 */
public List<LibraryNode> getLibraries(){
  ArrayList<LibraryNode> libs=new ArrayList<>();
  if (getChildrenHandler() != null)   for (  Node n : getChildrenHandler().get()) {
    if (n instanceof LibraryNavNode) {
      LibraryNavNode lnn=(LibraryNavNode)n;
      libs.addAll(lnn.getLibraries());
    }
  }
  return libs;
}
Program: 136177
Project: 136177
Buggy source:
@Override public void processOwnershipEvent(OwnershipEvent<?,?> event){
  Node affectedNode=getAffectedNode(event);
}

Fixed version (ground truth):
@Override public void processOwnershipEvent(OwnershipEvent<?,?> event){
}
Program: 136178
Project: 136178
Buggy source:
@Override public void processOwnershipEvent(OwnershipEvent<?,?> event){
  Node affectedNode=getAffectedNode(event);
  LibraryNode ln=(LibraryNode)thisNode;
switch (event.getType()) {
case MEMBER_ADDED:
    if (affectedNode == null)     return;
  if (affectedNode instanceof ContextualFacetNode)   if (!((ContextualFacetNode)affectedNode).canBeLibraryMember())   break;
ln.getChildrenHandler().add(affectedNode);
break;
case MEMBER_REMOVED:
if (affectedNode == null || affectedNode.getParent() == null) return;
for (TypeUser n : affectedNode.getDescendants_TypeUsers()) if (n.getAssignedType() != null) n.getAssignedType().getWhereAssignedHandler().removeUser(n);
if (affectedNode instanceof TypeUser) if (((TypeUser)affectedNode).getAssignedType() != null) ((TypeUser)affectedNode).getAssignedType().getWhereAssignedHandler().removeUser((TypeUser)affectedNode);
ln.getChildrenHandler().remove(affectedNode);
break;
default :
break;
}
}

Fixed version (ground truth):
@Override public void processOwnershipEvent(OwnershipEvent<?,?> event){
  Node affectedNode=getAffectedNode(event);
  LibraryNode ln=(LibraryNode)thisNode;
switch (event.getType()) {
case MEMBER_ADDED:
    if (affectedNode == null)     return;
  if (affectedNode instanceof ContextualFacetNode)   if (!((ContextualFacetNode)affectedNode).canBeLibraryMember())   break;
ln.getChildrenHandler().add(affectedNode);
addAssignedTypes(affectedNode);
break;
case MEMBER_REMOVED:
if (affectedNode == null || affectedNode.getParent() == null) return;
clearAssignedTypes(affectedNode);
ln.getChildrenHandler().remove(affectedNode);
break;
default :
break;
}
}
Program: 136179
Project: 136179
Buggy source:
@Override public boolean setAssignedTLType(TLModelElement simpleType){
  if (simpleType == getTLModelObject().getSimpleType())   return false;
  NamedEntity ne=null;
  if (simpleType == null || !(simpleType instanceof NamedEntity))   ne=(NamedEntity)getEmptyNode().getTLModelObject();
 else   ne=(NamedEntity)simpleType;
  getTLModelObject().setSimpleType(ne);
  return getTLModelObject().getSimpleType() == ne;
}

Fixed version (ground truth):
@Override public boolean setAssignedTLType(TLModelElement simpleType){
  if (getTLModelObject() == null || simpleType == getTLModelObject().getSimpleType())   return false;
  NamedEntity ne=null;
  if (simpleType == null || !(simpleType instanceof NamedEntity))   ne=(NamedEntity)getEmptyNode().getTLModelObject();
 else   ne=(NamedEntity)simpleType;
  getTLModelObject().setSimpleType(ne);
  return getTLModelObject().getSimpleType() == ne;
}
Program: 136180
Project: 136180
Buggy source:
/** 
 * Remove each library from Project node and tlProject. Close each library and save impacted projects.
 */
@Override public void remove(List<LibraryNavNode> list){
  Set<ProjectNode> impactedProjects=new HashSet<>();
  if (list.isEmpty())   return;
  ProjectNode pn=list.get(0).getProject();
  List<LibraryNode> nodes=pn.getLibraries();
  List<ProjectItem> itemsB=pn.getTLProject().getProjectItems();
  for (  LibraryNavNode lnn : list) {
    pn=lnn.getProject();
    impactedProjects.add(pn);
    for (    LibraryNode ln : lnn.getLibraries()) {
      try {
        removeTL(ln.getTLModelObject(),ln.getProjectItem(),pn.getTLProject());
      }
 catch (      IllegalStateException e) {
        LOGGER.debug("String_Node_Str" + ln + "String_Node_Str"+ pn);
        LOGGER.debug(e.getLocalizedMessage());
        e.printStackTrace();
        DialogUserNotifier.openWarning("String_Node_Str","String_Node_Str" + ln + "String_Node_Str"+ pn);
      }
    }
    lnn.close();
    assert(!pn.getChildren().contains(lnn));
  }
  for (  ProjectNode imp : impactedProjects) {
    OtmRegistry.getNavigatorView().refresh(imp,true);
    save(pn);
    LOGGER.debug("String_Node_Str" + pn);
  }
  List<ProjectItem> itemsA=pn.getTLProject().getProjectItems();
}

Fixed version (ground truth):
/** 
 * Remove each library from Project node and tlProject. Close each library and save impacted projects.
 */
@Override public void remove(List<LibraryNavNode> list){
  Set<ProjectNode> impactedProjects=new HashSet<>();
  if (list.isEmpty())   return;
  for (  LibraryNavNode lnn : list)   impactedProjects.add(remove(lnn,false));
  for (  ProjectNode imp : impactedProjects) {
    OtmRegistry.getNavigatorView().refresh(imp,true);
    save(imp);
    LOGGER.debug("String_Node_Str" + imp + "String_Node_Str");
  }
}
Program: 136181
Project: 136181
Buggy source:
protected void createDefaultProject(){
  defaultNS=mc.getRepositoryController().getLocalRepository().getNamespace();
  defaultPath=DefaultPreferences.getDefaultProjectPath();
  defaultProject=create(new File(defaultPath),defaultNS,"String_Node_Str","String_Node_Str");
  if (defaultProject == null) {
    DialogUserNotifier.openError("String_Node_Str",Messages.getString("String_Node_Str",defaultPath),null);
  }
  defaultPath=defaultProject.getTLProject().getProjectFile().getPath();
  mc.getModelNode().addProject(defaultProject);
}

Fixed version (ground truth):
protected void createDefaultProject(){
  defaultNS=mc.getRepositoryController().getLocalRepository().getNamespace();
  defaultPath=DefaultPreferences.getDefaultProjectPath();
  File df=new File(defaultPath);
  if (df.isFile() && df.canWrite()) {
    df.delete();
    LOGGER.debug("String_Node_Str");
  }
  defaultProject=create(new File(defaultPath),defaultNS,"String_Node_Str","String_Node_Str");
  if (defaultProject == null) {
    DialogUserNotifier.openError("String_Node_Str",Messages.getString("String_Node_Str",defaultPath),null);
  }
  defaultPath=defaultProject.getTLProject().getProjectFile().getPath();
  mc.getModelNode().addProject(defaultProject);
}
Program: 136182
Project: 136182
Buggy source:
/** 
 * {@link org.opentravel.schemas.actions.VersionMajorAction#run()}
 */
@Override public LibraryNode createMajorVersion(LibraryNode library){
  if (!versionPreparation(library))   return null;
  RepositoryNode rn=find(library.getProjectItem().getRepository());
  MajorVersionHelper mvh=new MajorVersionHelper(library.getProject().getTLProject());
  TLLibrary tlMajor=null;
  LibraryNode newLib=null;
  LibraryChainNode lcn=null;
  ProjectNode thisProject=library.getProject();
  try {
    tlMajor=mvh.createNewMajorVersion(library.getTLLibrary());
  }
 catch (  VersionSchemeException e) {
    postRepoException(e);
  }
catch (  ValidationException e) {
    postRepoException(e);
  }
catch (  LibrarySaveException e) {
    postRepoException(e);
  }
catch (  IllegalArgumentException e) {
    postRepoException(e);
  }
  if (tlMajor != null) {
    newLib=new LibraryNode(tlMajor,library.getProject());
    List<LibraryChainNode> chains=manage(rn,Collections.singletonList(newLib));
    lcn=findLibrary(chains,newLib.getLibrary().getName());
    if (lcn != null) {
      LibraryModelManager libMrg=Node.getLibraryModelManager();
      ProjectController pc=mc.getProjectController();
      List<ProjectNode> pList=libMrg.findProjects(library);
      for (      ProjectNode pn : libMrg.findProjects(library)) {
        pc.remove(library,pn);
        if (pn != thisProject)         new LibraryNavNode(lcn,pn);
      }
      lock(newLib);
    }
    sync(rn);
  }
  return newLib;
}

Fixed version (ground truth):
/** 
 * {@link org.opentravel.schemas.actions.VersionMajorAction#run()}
 */
@Override public LibraryNode createMajorVersion(LibraryNode library){
}
Program: 136183
Project: 136183
Buggy source:
/** 
 * Model should be reset using   {@link ProjectController#closeAll()} not this since project controller has access toTLProjects.
 */
public void close(boolean includeBuiltins){
  List<ProjectNode> projects=getUserProjects();
  if (includeBuiltins)   projects=getAllProjects();
  for (  ProjectNode project : projects) {
    project.close();
    getChildrenHandler().clear(project);
  }
  libMgr.clear(includeBuiltins);
  undefinedNode.initialize(this);
  indicatorNode.initialize(this);
  unassignedNode.initialize(this);
  defaultStringNode.initialize(this);
}

Fixed version (ground truth):
/** 
 * Model should be reset using   {@link ProjectController#closeAll()} not this method since project controller hasaccess to TLProjects.
 */
public void close(boolean includeBuiltins){
  List<ProjectNode> projects=getUserProjects();
  if (includeBuiltins)   projects=getAllProjects();
  for (  ProjectNode project : projects) {
    project.close();
    getChildrenHandler().clear(project);
  }
  libMgr.clear(includeBuiltins);
  undefinedNode.initialize(this);
  indicatorNode.initialize(this);
  unassignedNode.initialize(this);
  defaultStringNode.initialize(this);
}
Program: 136184
Project: 136184
Buggy source:
public void remove(LibraryNavNode l){
  getChildrenHandler().clear(l);
}

Fixed version (ground truth):
/** 
 * Remove LibraryNavNode from children handler.
 * @param l
 */
public void remove(LibraryNavNode l){
  getChildrenHandler().clear(l);
}
Program: 136185
Project: 136185
Buggy source:
/** 
 * Try to find the project item for the library. If not found, try to add it to the project.
 * @return the project item associated with this library
 */
public ProjectItem addToTL(AbstractLibrary tlLib){
}

Fixed version (ground truth):
/** 
 * Try to find the project item for the library. If not found, try to add it to the project.
 * @return the project item associated with this library
 */
public ProjectItem addToTL(AbstractLibrary tlLib){
  if (getTLProject() == null || getTLProject().getProjectManager() == null)   return null;
  ProjectItem pi=getProjectItem(tlLib);
  if (pi == null)   try {
    pi=getTLProject().getProjectManager().addUnmanagedProjectItem(tlLib,getTLProject());
  }
 catch (  RepositoryException e1) {
    e1.printStackTrace();
    LOGGER.error("String_Node_Str" + tlLib.getName() + "String_Node_Str"+ e1.getLocalizedMessage());
  }
catch (  IllegalArgumentException e) {
    e.printStackTrace();
    LOGGER.error("String_Node_Str" + tlLib.getName() + "String_Node_Str"+ e.getLocalizedMessage());
  }
  return pi;
}
Program: 136186
Project: 136186
Buggy source:
/** 
 * Use the libraryModelManager to close the library in this project. Remove this libraryNavNode from its project.
 */
@Override public void close(){
  getModelNode().getLibraryManager().close(getThisLib(),getProject());
  deleted=true;
  getChildrenHandler().clear((Node)getThisLib());
}

Fixed version (ground truth):
/** 
 * Use the libraryModelManager to close the library in this project. Remove this libraryNavNode from its project.
 */
@Override public void close(){
  getModelNode().getLibraryManager().close(getThisLib(),getProject());
  deleted=true;
  getChildrenHandler().clear((Node)getThisLib());
  getParent().remove(this);
}
Program: 136187
Project: 136187
Buggy source:
@Override public boolean unlock(LibraryNode ln){
  if (!post16UpgradeConfirmation())   return false;
  SetDocumentationWizard wizard=new SetDocumentationWizard(ln);
  wizard.run(OtmRegistry.getActiveShell());
  if (!wizard.wasCanceled()) {
    String remark=wizard.getDocText();
    UnlockThread ut=new UnlockThread(ln,mc,remark);
    BusyIndicator.showWhile(mc.getMainWindow().getDisplay(),ut);
    refreshAll(ln);
    mc.postStatus("String_Node_Str" + ln + "String_Node_Str");
    return ut.getResult();
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean unlock(LibraryNode ln){
  if (!post16UpgradeConfirmation())   return false;
  SetDocumentationWizard wizard=new SetDocumentationWizard(ln);
  wizard.run(OtmRegistry.getActiveShell());
  if (!wizard.wasCanceled()) {
    String remark=wizard.getDocText();
    UnlockThread ut=new UnlockThread(ln,mc,remark);
    BusyIndicator.showWhile(mc.getMainWindow().getDisplay(),ut);
    refreshAll(ln);
    LOGGER.debug("String_Node_Str" + this);
    mc.postStatus("String_Node_Str" + ln + "String_Node_Str");
    return ut.getResult();
  }
  return false;
}
Program: 136188
Project: 136188
Buggy source:
@Override public void processOwnershipEvent(OwnershipEvent<?,?> event){
  LOGGER.debug("String_Node_Str" + event);
  super.processOwnershipEvent(event);
}

Fixed version (ground truth):
@Override public void processOwnershipEvent(OwnershipEvent<?,?> event){
  super.processOwnershipEvent(event);
}
Program: 136189
Project: 136189
Buggy source:
@Override public void processValueChangeEvent(ValueChangeEvent<?,?> event){
  LOGGER.debug("String_Node_Str" + event.getType());
  super.processValueChangeEvent(event);
switch (event.getType()) {
case LOCATION_MODIFIED:
case PARAM_GROUP_ADDED:
case PARAM_GROUP_MODIFIED:
case PARAM_GROUP_REMOVED:
case PAYLOAD_TYPE_MODIFIED:
case FACET_REF_MODIFIED:
    if (thisNode instanceof ActionRequest)     ((ActionRequest)thisNode).setPathTemplate();
  break;
case BASE_PATH_MODIFIED:
default :
}
}

Fixed version (ground truth):
@Override public void processValueChangeEvent(ValueChangeEvent<?,?> event){
  super.processValueChangeEvent(event);
switch (event.getType()) {
case LOCATION_MODIFIED:
case PARAM_GROUP_ADDED:
case PARAM_GROUP_MODIFIED:
case PARAM_GROUP_REMOVED:
case PAYLOAD_TYPE_MODIFIED:
case FACET_REF_MODIFIED:
    if (thisNode instanceof ActionRequest)     ((ActionRequest)thisNode).setPathTemplate();
  break;
case BASE_PATH_MODIFIED:
default :
}
}
Program: 136190
Project: 136190
Buggy source:
/** 
 * Resource members should call this <b>after</b> doing member specific deletes.
 */
@Override public void delete(){
  clearListeners();
  if (getParent() instanceof ResourceBase) {
    if (getParent().getChildrenHandler() != null)     getParent().getChildrenHandler().clear(this);
    ((ResourceBase<?>)getParent()).rChildren.remove(this);
  }
  deleted=true;
}

Fixed version (ground truth):
/** 
 * Resource members should call this <b>after</b> doing member specific deletes.
 */
@Override public void delete(){
  clearListeners();
  if (getParent() != null)   if (getParent().getChildrenHandler() != null)   getParent().getChildrenHandler().clear(this);
  if (getParent() instanceof ResourceBase) {
    ((ResourceBase<?>)getParent()).rChildren.remove(this);
  }
  deleted=true;
}
Program: 136191
Project: 136191
Buggy source:
/** 
 * Run the wizard AND do assign the type.
 * @param assign - if true assign the type to the node on finish
 * @return
 */
public boolean run(final Shell shell,boolean assign){
  if (curNode == null && curNodeList == null) {
    LOGGER.warn("String_Node_Str");
    return false;
  }
  dontFinish=true;
  if (assign)   dontFinish=false;
  dialog=new WizardDialog(shell,this);
  dialog.setPageSize(700,600);
  dialog.create();
  dialog.open();
  return true;
}

Fixed version (ground truth):
/** 
 * Run the wizard AND do assign the type.
 * @param assign - if true assign the type to the node on finish
 * @return
 */
@Deprecated public boolean run(final Shell shell,boolean assign){
  if (curNode == null && curNodeList == null) {
    LOGGER.warn("String_Node_Str");
    return false;
  }
  dontFinish=true;
  if (assign)   dontFinish=false;
  dialog=new WizardDialog(shell,this);
  dialog.setPageSize(700,600);
  dialog.create();
  dialog.open();
  return true;
}
Program: 136192
Project: 136192
Buggy source:
public static EditPart getEditPartToSelect(EditPart ep){
  SelectionRequest req=new SelectionRequest();
  req.setType(RequestConstants.REQ_SELECTION);
  return ep.getTargetEditPart(req);
}

Fixed version (ground truth):
public static EditPart getEditPartToSelect(EditPart ep){
  SelectionRequest req=new SelectionRequest();
  req.setType(RequestConstants.REQ_SELECTION);
  return ep != null ? ep.getTargetEditPart(req) : null;
}
Program: 136193
Project: 136193
Buggy source:
private void addToMap(ProjectItem pi,LibraryInterface li){
  String cn=getCanonicalName(pi);
  LibraryInterface entry=libMap.get(cn);
  if (!libMap.containsKey(getCanonicalName(pi)))   libMap.put(getCanonicalName(pi),li);
 else   LOGGER.warn("String_Node_Str" + getCanonicalName(pi));
}

Fixed version (ground truth):
private void addToMap(ProjectItem pi,LibraryInterface li){
  String cn=getCanonicalName(pi);
  LibraryInterface entry=libMap.get(cn);
  if (!libMap.containsKey(getCanonicalName(pi)))   libMap.put(getCanonicalName(pi),li);
}
Program: 136194
Project: 136194
Buggy source:
/** 
 * Adds node to the aggregate node's children list if appropriate. This only does the aggregate structure, not library or parent links.
 * @param nodeToAdd
 * @return
 */
public void add(ComponentNode nodeToAdd){
  if (nodeToAdd instanceof ServiceNode) {
    getChildren().add(nodeToAdd);
    return;
  }
  VersionNode vn=null;
  if (nodeToAdd.getVersionNode() != null)   if (getChildren().contains(nodeToAdd.getVersionNode()))   return;
  if (nodeToAdd instanceof ContextualFacetNode) {
    getChildrenHandler().add(new VersionNode(nodeToAdd));
    return;
  }
  final List<Node> duplicates=findExactMatches(getChildren(),nodeToAdd);
  if (duplicates.isEmpty())   getChildrenHandler().add(new VersionNode(nodeToAdd));
 else {
    vn=duplicates.get(0).getVersionNode();
    vn.add(nodeToAdd);
  }
  return;
}

Fixed version (ground truth):
/** 
 * Adds node to the aggregate node's children list if appropriate. This only does the aggregate structure, not library or parent links.
 * @param nodeToAdd
 * @return
 */
public void add(ComponentNode nodeToAdd){
  if (nodeToAdd instanceof ServiceNode) {
    getChildrenHandler().add(nodeToAdd);
    return;
  }
  VersionNode vn=null;
  if (nodeToAdd.getVersionNode() != null)   if (getChildren().contains(nodeToAdd.getVersionNode()))   return;
  if (nodeToAdd instanceof ContextualFacetNode) {
    getChildrenHandler().add(new VersionNode(nodeToAdd));
    return;
  }
  final List<Node> duplicates=findExactMatches(getChildren(),nodeToAdd);
  if (duplicates.isEmpty())   getChildrenHandler().add(new VersionNode(nodeToAdd));
 else {
    vn=duplicates.get(0).getVersionNode();
    vn.add(nodeToAdd);
  }
  return;
}
Program: 136195
Project: 136195
Buggy source:
/** 
 * Remove the version node or version node associated with the passed node from the aggregate child list.
 */
public void remove(Node node){
  if (!(node instanceof VersionNode))   node=node.getVersionNode();
  getChildrenHandler().remove(node);
}

Fixed version (ground truth):
/** 
 * Remove the version node or version node associated with the passed node from the aggregate child list.
 */
public void remove(Node node){
  if (!(node instanceof ServiceNode) && (!(node instanceof VersionNode)))   node=node.getVersionNode();
  getChildrenHandler().remove(node);
}
Program: 136196
Project: 136196
Buggy source:
public void add(LibraryMemberInterface lm){
  if (childrenHandler instanceof NavNodeChildrenHandler)   getChildrenHandler().add((Node)lm);
}

Fixed version (ground truth):
public void add(LibraryMemberInterface lm){
  getChildrenHandler().add((Node)lm);
}
Program: 136198
Project: 136198
Buggy source:
public LibraryNavNode load(final List<ProjectItem> piList){
  LibraryModelManager manager=getParent().getLibraryManager();
  LibraryNavNode lnn=null;
  if (piList.isEmpty())   LOGGER.warn(this + "String_Node_Str");
  for (  ProjectItem pi : piList) {
    LOGGER.debug("String_Node_Str" + pi.getLibraryName() + "String_Node_Str"+ this);
    lnn=manager.add(pi,this);
    if (lnn != null) {
      add(lnn);
    }
  }
  return lnn;
}

Fixed version (ground truth):
public LibraryNavNode load(final List<ProjectItem> piList){
  LibraryModelManager manager=getParent().getLibraryManager();
  LibraryNavNode lnn=null;
  for (  ProjectItem pi : piList) {
    lnn=manager.add(pi,this);
    if (lnn != null) {
      add(lnn);
    }
  }
  return lnn;
}
Program: 136199
Project: 136199
Buggy source:
public void add(Node child){
  if (!(child instanceof LibraryNavNode))   LOGGER.debug("String_Node_Str");
  getChildrenHandler().add(child);
  child.setParent(this);
}

Fixed version (ground truth):
public void add(Node child){
  getChildrenHandler().add(child);
  child.setParent(this);
}
Program: 136200
Project: 136200
Buggy source:
/** 
 * Try to find the project item for the library. If not found, try to add it to the project.
 * @return the project item associated with this library
 */
public ProjectItem addToTL(AbstractLibrary tlLib){
  if (getTLProject() == null)   return null;
  ProjectItem pi=getProjectItem(tlLib);
  if (pi == null)   try {
    pi=getTLProject().getProjectManager().addUnmanagedProjectItem(tlLib,getTLProject());
  }
 catch (  RepositoryException e1) {
    LOGGER.error("String_Node_Str" + tlLib.getName() + "String_Node_Str"+ e1.getLocalizedMessage());
  }
catch (  IllegalArgumentException e) {
    LOGGER.error("String_Node_Str" + tlLib.getName() + "String_Node_Str"+ e.getLocalizedMessage());
  }
  return pi;
}

Fixed version (ground truth):
/** 
 * Try to find the project item for the library. If not found, try to add it to the project.
 * @return the project item associated with this library
 */
public ProjectItem addToTL(AbstractLibrary tlLib){
}
Program: 136201
Project: 136201
Buggy source:
/** 
 * Service created from TL Service already in a library.
 * @param tlSvc
 * @param ln
 */
public ServiceNode(final TLService tlSvc,LibraryNode ln){
  super(tlSvc);
  owningLibrary=ln;
  childrenHandler=new ServiceChildrenHandler(this);
  if (ln != null)   ln.setServiceNode(this);
}

Fixed version (ground truth):
/** 
 * Service constructor used in tests created from TL Service already in a library.
 * @param tlSvc
 * @param ln
 */
public ServiceNode(final TLService tlSvc,LibraryNode ln){
  this(tlSvc);
  owningLibrary=ln;
  if (ln != null)   ln.setServiceNode(this);
}
Program: 136202
Project: 136202
Buggy source:
@Override public String getLabel(){
  return getName() + "String_Node_Str" + getLibrary().getVersion()+ "String_Node_Str";
}

Fixed version (ground truth):
@Override public String getLabel(){
  return getLibrary() != null ? getName() + "String_Node_Str" + getLibrary().getVersion()+ "String_Node_Str" : "String_Node_Str";
}
Program: 136203
Project: 136203
Buggy source:
@Override public void add(Node item){
  if (!children.contains(item))   children.add(item);
  item.setParent(owner);
  if (item instanceof LibraryMemberInterface)   ((LibraryMemberInterface)item).setLibrary(owner.getLibrary());
}

Fixed version (ground truth):
@Override public void add(Node item){
  if (!children.contains(item))   children.add(item);
  if (owner instanceof AggregateNode && item instanceof ServiceNode)   return;
  item.setParent(owner);
  if (item instanceof LibraryMemberInterface)   ((LibraryMemberInterface)item).setLibrary(owner.getLibrary());
}
Program: 136205
Project: 136205
Buggy source:
@Override protected void removeFromTLParent(){
  if (getTLModelObject().getOwningEntity() instanceof TLChoiceObject)   ((TLChoiceObject)getTLModelObject().getOwningEntity()).removeChoiceFacet(getTLModelObject());
 else   if (getTLModelObject().getOwningEntity() instanceof TLContextualFacet)   ((TLContextualFacet)getTLModelObject().getOwningEntity()).removeChildFacet(getTLModelObject());
  if (getParent() != null)   getParent().getChildrenHandler().clear();
}

Fixed version (ground truth):
@Override protected void removeFromTLParent(){
  if (getTLModelObject() == null)   return;
  if (getTLModelObject().getOwningEntity() instanceof TLChoiceObject)   ((TLChoiceObject)getTLModelObject().getOwningEntity()).removeChoiceFacet(getTLModelObject());
 else   if (getTLModelObject().getOwningEntity() instanceof TLContextualFacet)   ((TLContextualFacet)getTLModelObject().getOwningEntity()).removeChildFacet(getTLModelObject());
  if (getParent() != null)   getParent().getChildrenHandler().clear();
  getTLModelObject().setOwningEntityName("String_Node_Str");
}
Program: 136206
Project: 136206
Buggy source:
/** 
 * Add this contextual facet to the owner. <p> Create contributed facet. Remove existing contributed facet if it existed.
 * @param owner
 * @param newFacet
 */
@Override public void add(ContextualFacetOwnerInterface owner){
  removeFromTLParent();
  addToTLParent(owner);
  if (getWhereContributed() != null)   getWhereContributed().clearContributor();
  if (getLibrary() == null)   owner.getLibrary().addMember(this);
  new ContributedFacetNode(this.getTLModelObject(),owner);
  if (owner != null && ((LibraryMemberInterface)owner).getChildrenHandler() != null)   ((Node)owner).getChildrenHandler().clear();
}

Fixed version (ground truth):
/** 
 * Add this contextual facet to the owner. <p> Create contributed facet. Remove existing contributed facet if it existed.
 * @param owner
 * @param newFacet
 */
@Override public void add(ContextualFacetOwnerInterface owner){
}
Program: 136207
Project: 136207
Buggy source:
@Override protected void removeFromTLParent(){
  if (getTLModelObject() == null)   return;
  if (getTLModelObject().getOwningEntity() instanceof TLBusinessObject)   ((TLBusinessObject)getTLModelObject().getOwningEntity()).removeCustomFacet(getTLModelObject());
 else   if (getTLModelObject().getOwningEntity() instanceof TLContextualFacet)   ((TLContextualFacet)getTLModelObject().getOwningEntity()).removeChildFacet(getTLModelObject());
}

Fixed version (ground truth):
@Override protected void removeFromTLParent(){
  if (getTLModelObject() == null)   return;
  if (getTLModelObject().getOwningEntity() instanceof TLBusinessObject)   ((TLBusinessObject)getTLModelObject().getOwningEntity()).removeCustomFacet(getTLModelObject());
 else   if (getTLModelObject().getOwningEntity() instanceof TLContextualFacet)   ((TLContextualFacet)getTLModelObject().getOwningEntity()).removeChildFacet(getTLModelObject());
  getTLModelObject().setOwningEntityName("String_Node_Str");
}
Program: 136208
Project: 136208
Buggy source:
@Override protected void addToTLParent(ContextualFacetOwnerInterface owner){
  if (owner == null || owner.getTLModelObject() == null)   return;
  TLFacetOwner tlOwner=owner.getTLModelObject();
  if (getTLModelObject() == null)   return;
  if (tlOwner instanceof TLBusinessObject)   ((TLBusinessObject)tlOwner).addCustomFacet(getTLModelObject());
 else   if (tlOwner instanceof TLContextualFacet)   ((TLContextualFacet)tlOwner).addChildFacet(getTLModelObject());
  if (owner.getChildrenHandler() != null)   owner.getChildrenHandler().clear();
}

Fixed version (ground truth):
@Override protected void addToTLParent(ContextualFacetOwnerInterface owner){
}
Program: 136209
Project: 136209
Buggy source:
@Override protected void removeFromTLParent(){
  if (getTLModelObject().getOwningEntity() instanceof TLBusinessObject)   ((TLBusinessObject)getTLModelObject().getOwningEntity()).removeQueryFacet(getTLModelObject());
 else   if (getTLModelObject().getOwningEntity() instanceof TLContextualFacet)   ((TLContextualFacet)getTLModelObject().getOwningEntity()).removeChildFacet(getTLModelObject());
}

Fixed version (ground truth):
@Override protected void removeFromTLParent(){
}
Program: 136210
Project: 136210
Buggy source:
@Override protected void removeFromTLParent(){
  if (getTLModelObject().getOwningEntity() instanceof TLBusinessObject)   ((TLBusinessObject)getTLModelObject().getOwningEntity()).removeUpdateFacet(getTLModelObject());
 else   if (getTLModelObject().getOwningEntity() instanceof TLContextualFacet)   ((TLContextualFacet)getTLModelObject().getOwningEntity()).removeChildFacet(getTLModelObject());
}

Fixed version (ground truth):
@Override protected void removeFromTLParent(){
  if (getTLModelObject() == null)   return;
  if (getTLModelObject().getOwningEntity() instanceof TLBusinessObject)   ((TLBusinessObject)getTLModelObject().getOwningEntity()).removeUpdateFacet(getTLModelObject());
 else   if (getTLModelObject().getOwningEntity() instanceof TLContextualFacet)   ((TLContextualFacet)getTLModelObject().getOwningEntity()).removeChildFacet(getTLModelObject());
  getTLModelObject().setOwningEntityName("String_Node_Str");
}
Program: 136211
Project: 136211
Buggy source:
/** 
 * @param node
 * @return true if given node should be displayed from "Show used type" action
 */
public static boolean showAsUsedType(Node node){
  boolean ret=node instanceof VWA_Node;
  ret=ret || node instanceof BusinessObjectNode;
  ret=ret || node instanceof CoreObjectNode;
  if (node instanceof SimpleComponentNode) {
    return isShowingSimpleObjectsAsUsedType();
  }
  return ret;
}

Fixed version (ground truth):
/** 
 * @param node
 * @return true if given node should be displayed from "Show used type" action
 */
public static boolean showAsUsedType(Node node){
  boolean ret=node instanceof VWA_Node;
  ret=ret || node instanceof BusinessObjectNode;
  ret=ret || node instanceof CoreObjectNode;
  if (node instanceof SimpleTypeNode) {
    return isShowingSimpleObjectsAsUsedType();
  }
  return ret;
}
Program: 136212
Project: 136212
Buggy source:
@Override public EditPart createEditPart(EditPart context,Object element){
  if (element instanceof Diagram) {
    return new DiagramEditPart((Diagram)element);
  }
  if (element instanceof Connection) {
    return new ConnectionEditPart((Connection)element);
  }
  UINode uiNode=(UINode)element;
  Node node=uiNode.getNode();
  if (node instanceof LibraryNode) {
    return new LibraryEditPart(uiNode);
  }
 else   if (node instanceof PropertyNode) {
    return new PropertyNodeEditPart(uiNode);
  }
 else   if (node instanceof SimpleComponentNode) {
    return new PropertyNodeEditPart(uiNode);
  }
 else   if (node instanceof ComponentNode) {
    return new ComponentNodeEditPart(uiNode);
  }
 else   if (node instanceof Node) {
    return new UnsupportedNodeEditPart(uiNode);
  }
  return null;
}

Fixed version (ground truth):
@Override public EditPart createEditPart(EditPart context,Object element){
  if (element instanceof Diagram) {
    return new DiagramEditPart((Diagram)element);
  }
  if (element instanceof Connection) {
    return new ConnectionEditPart((Connection)element);
  }
  UINode uiNode=(UINode)element;
  Node node=uiNode.getNode();
  if (node instanceof LibraryNode) {
    return new LibraryEditPart(uiNode);
  }
 else   if (node instanceof PropertyNode) {
    return new PropertyNodeEditPart(uiNode);
  }
 else   if (node instanceof SimpleTypeNode) {
    return new PropertyNodeEditPart(uiNode);
  }
 else   if (node instanceof ComponentNode) {
    return new ComponentNodeEditPart(uiNode);
  }
 else   if (node instanceof Node) {
    return new UnsupportedNodeEditPart(uiNode);
  }
  return null;
}
Program: 136213
Project: 136213
Buggy source:
private void saveDoc(Node n,SetDocumentationWizard.DocTypes type,String text){
  if (n == null || type == null || text.isEmpty())   return;
  DocumentationHandler dh=n.getDocHander();
  if (dh == null)   return;
switch (type) {
case Description:
    dh.addDescription(text);
  break;
case Deprecation:
dh.addDeprecation(text);
break;
case MoreInformation:
dh.addMoreInfo(text);
break;
case ReferenceLink:
dh.addReference(text);
break;
case Implementer:
dh.addImplementer(text);
break;
}
}

Fixed version (ground truth):
private void saveDoc(Node n,SetDocumentationWizard.DocTypes type,String text){
  if (n == null || type == null || text.isEmpty())   return;
  DocumentationHandler dh=n.getDocHandler();
  if (dh == null)   return;
switch (type) {
case Description:
    dh.addDescription(text);
  break;
case Deprecation:
dh.addDeprecation(text);
break;
case MoreInformation:
dh.addMoreInfo(text);
break;
case ReferenceLink:
dh.addReference(text);
break;
case Implementer:
dh.addImplementer(text);
break;
}
}
Program: 136214
Project: 136214
Buggy source:
@Override public boolean setAssignedType(TLModelElement simpleType){
  if (simpleType == getTLModelObject().getSimpleType())   return false;
  NamedEntity ne=null;
  if (simpleType == null || !(simpleType instanceof NamedEntity))   ne=(NamedEntity)emptyNode.getTLModelObject();
 else   ne=(NamedEntity)simpleType;
  getTLModelObject().setSimpleType(ne);
  return getTLModelObject().getSimpleType() == ne;
}

Fixed version (ground truth):
@Override public boolean setAssignedType(TLModelElement simpleType){
  if (simpleType == getTLModelObject().getSimpleType())   return false;
  NamedEntity ne=null;
  if (simpleType == null || !(simpleType instanceof NamedEntity))   ne=(NamedEntity)getEmptyNode().getTLModelObject();
 else   ne=(NamedEntity)simpleType;
  getTLModelObject().setSimpleType(ne);
  return getTLModelObject().getSimpleType() == ne;
}
Program: 136215
Project: 136215
Buggy source:
@Override public boolean setAssignedType(TLModelElement tla){
  if (tla == getTLModelObject().getType())   return false;
  if (tla instanceof TLPropertyType)   getTLModelObject().setType((TLPropertyType)tla);
  setName(getName());
  return getTLModelObject().getType() == tla;
}

Fixed version (ground truth):
@Override public boolean setAssignedType(TLModelElement tla){
  if (tla == null)   return false;
  if (tla == getTLModelObject().getType())   return false;
  if (tla instanceof TLPropertyType)   getTLModelObject().setType((TLPropertyType)tla);
  setName(getName());
  return getTLModelObject().getType() == tla;
}
Program: 136216
Project: 136216
Buggy source:
@Override public boolean setAssignedType(TLModelElement tla){
  if (tla == getTLModelObject().getType())   return false;
  if (canAssign(GetNode(tla)))   if (tla instanceof TLPropertyType)   getTLModelObject().setType((TLPropertyType)tla);
  return getTLModelObject().getType() == tla;
}

Fixed version (ground truth):
@Override public boolean setAssignedType(TLModelElement tla){
  if (tla == null)   return false;
  if (tla == getTLModelObject().getType())   return false;
  if (canAssign(GetNode(tla)))   if (tla instanceof TLPropertyType)   getTLModelObject().setType((TLPropertyType)tla);
  return getTLModelObject().getType() == tla;
}
Program: 136217
Project: 136217
Buggy source:
@Override public TLLibraryMember getTLModelObject(){
  return (TLLibraryMember)tlObj;
}

Fixed version (ground truth):
@Override public TLLibraryMember getTLModelObject(){
  if (impliedType != null && impliedType.equals(ImpliedNodeType.UnassignedType))   return null;
  return (TLLibraryMember)tlObj;
}