nus-yam/ex-repair huggingface dataset:
Program: 136263
Project: 136263
Buggy source:
protected ComponentNode createMinorVersionComponent(ComponentNode newNode){
  if (newNode.getModelObject() instanceof EmptyMO) {
    return null;
  }
  Node owner=this.getOwningComponent();
  if (owner.isInHead())   return null;
  if (newNode instanceof ExtensionOwner)   ((ExtensionOwner)newNode).setExtension(owner);
  if (newNode.getName() == null || newNode.getName().isEmpty())   newNode.setName(owner.getName());
  owner.getChain().getHead().addMember(newNode);
  LibraryChainNode chain=owner.getChain();
  chain.getComplexAggregate().getChildren().remove(owner);
  return newNode;
}

Fixed version (ground truth):
protected ComponentNode createMinorVersionComponent(ComponentNode newNode){
  if (newNode.getModelObject() instanceof EmptyMO) {
    return null;
  }
  Node owner=this.getOwningComponent();
  if (owner.isInHead())   return null;
  if (newNode instanceof ExtensionOwner)   ((ExtensionOwner)newNode).setExtension(owner);
  if (newNode.getName() == null || newNode.getName().isEmpty())   newNode.setName(owner.getName());
  LibraryChainNode chain=owner.getChain();
  chain.getHead().addMember(newNode);
  chain.getComplexAggregate().getChildren().remove(owner);
  owner.getLibrary().checkExtension(owner);
  return newNode;
}
Program: 136264
Project: 136264
Buggy source:
@Override public void setExtension(final Node base){
  if (extensionHandler == null)   extensionHandler=new ExtensionHandler(this);
  extensionHandler.set(base);
}

Fixed version (ground truth):
@Override public void setExtension(final Node base){
}
Program: 136265
Project: 136265
Buggy source:
public String getDecoration(){
  String decoration="String_Node_Str";
  if (this instanceof TypeProvider && !(this instanceof ImpliedNode))   decoration+="String_Node_Str" + ((TypeProvider)this).getWhereUsedAndDescendantsCount() + "String_Node_Str";
  if (isDeleted())   decoration+="String_Node_Str";
  if (isDeprecated())   decoration+="String_Node_Str";
  if (this instanceof ExtensionOwner) {
    String extensionTxt="String_Node_Str";
    ComponentNode exBase=(ComponentNode)((ExtensionOwner)this).getExtensionBase();
    if (exBase != null)     extensionTxt+="String_Node_Str" + exBase.getNameWithPrefix() + "String_Node_Str";
    if (isEditable_isNewOrAsMinor()) {
      if (getLibrary().isInHead2() && !getLibrary().isMinorVersion())       extensionTxt+="String_Node_Str";
 else       if (isInHead2())       if (getLibrary().isNewToChain())       extensionTxt+="String_Node_Str";
 else       extensionTxt+="String_Node_Str";
 else       extensionTxt+="String_Node_Str" + getTlVersion() + "String_Node_Str";
    }
    decoration+="String_Node_Str" + extensionTxt;
  }
  return decoration;
}

Fixed version (ground truth):
public String getDecoration(){
  String decoration="String_Node_Str";
  if (this instanceof TypeProvider && !(this instanceof ImpliedNode))   decoration+="String_Node_Str" + ((TypeProvider)this).getWhereUsedAndDescendantsCount() + "String_Node_Str";
  if (isDeleted())   decoration+="String_Node_Str";
  if (isDeprecated())   decoration+="String_Node_Str";
  if (this instanceof ExtensionOwner) {
    String extensionTxt="String_Node_Str";
    ComponentNode exBase=null;
    if (!isVersioned())     exBase=(ComponentNode)((ExtensionOwner)this).getExtensionBase();
    if (getLibrary() != null)     getLibrary().checkExtension(this);
    if (exBase != null) {
      extensionTxt+="String_Node_Str" + exBase.getNameWithPrefix() + "String_Node_Str";
      if (getChain() != null)       extensionTxt+="String_Node_Str";
    }
    if (getChain() != null) {
      if (isInHead())       extensionTxt+="String_Node_Str";
 else       extensionTxt+="String_Node_Str" + getTlVersion();
      if (isEditable())       extensionTxt+="String_Node_Str";
    }
    if (isEditable()) {
      if (getChain() == null)       extensionTxt+="String_Node_Str";
 else       if (isInHead())       if (isNewToChain())       extensionTxt+="String_Node_Str";
 else       extensionTxt+="String_Node_Str";
 else       if (this instanceof VersionedObjectInterface)       extensionTxt+="String_Node_Str";
    }
    decoration+=surround(extensionTxt);
  }
  return decoration;
}
Program: 136266
Project: 136266
Buggy source:
/** 
 * Sets the library field in this node and all of its kids.
 * @param ln
 */
public void setLibrary(final LibraryNode ln){
  library=ln;
  if (!(this instanceof LibraryChainNode))   setKidsLibrary();
}

Fixed version (ground truth):
/** 
 * Sets the library field in this node and all of its kids.
 * @param ln
 */
public void setLibrary(final LibraryNode ln){
  library=ln;
  setKidsLibrary();
}
Program: 136267
Project: 136267
Buggy source:
/** 
 * @return true only if this object is in the version head library. false if not, false if owner is a service, orunmanaged. See also: isInHead2()
 */
public boolean isInHead(){
  Node owner=getOwningComponent();
  if (owner instanceof OperationNode)   owner=owner.getOwningComponent();
  if (owner instanceof ServiceNode)   return true;
  if (owner == null || owner.versionNode == null)   return false;
  if (getChain() == null || getChain().getHead() == null)   return false;
  return getChain().getHead().getDescendants_LibraryMembers().contains(owner);
}

Fixed version (ground truth):
/** 
 * @return true only if this object is in the version head library. false if not, false if owner is a service, orunmanaged. See also: isInHead2()
 */
public boolean isInHead(){
  Node owner=getOwningComponent();
  if (owner instanceof OperationNode)   owner=owner.getOwningComponent();
  if (owner instanceof ServiceNode)   return true;
  if (owner == null || owner.versionNode == null)   return false;
  if (getChain() == null || getChain().getHead() == null)   return false;
  List<Node> members=getChain().getHead().getDescendants_LibraryMembers();
  return getChain().getHead().getDescendants_LibraryMembers().contains(owner);
}
Program: 136268
Project: 136268
Buggy source:
/** 
 * New ComponentNode methods that also create new objects in underlying model
 * @return newly created node or null
 */
public static ComponentNode newComponent_UnTyped(final TLLibraryMember mbr){
  ComponentNode cn=null;
  if (mbr == null)   return cn;
  if (mbr instanceof TLValueWithAttributes)   cn=new VWA_Node((TLValueWithAttributes)mbr);
 else   if (mbr instanceof TLBusinessObject)   cn=new BusinessObjectNode(mbr);
 else   if (mbr instanceof TLCoreObject)   cn=new CoreObjectNode((TLCoreObject)mbr);
 else   if (mbr instanceof TLChoiceObject)   cn=new ChoiceObjectNode((TLChoiceObject)mbr);
 else   if (mbr instanceof TLSimple)   cn=new SimpleTypeNode((TLSimple)mbr);
 else   if (mbr instanceof TLOpenEnumeration)   cn=new EnumerationOpenNode(mbr);
 else   if (mbr instanceof TLClosedEnumeration)   cn=new EnumerationClosedNode(mbr);
 else   if (mbr instanceof TLExtensionPointFacet)   cn=new ExtensionPointNode((TLExtensionPointFacet)mbr);
 else   if (mbr instanceof TLResource)   cn=new ResourceNode(mbr);
 else   if (mbr instanceof XSDSimpleType)   cn=new SimpleTypeNode((TLSimple)Node.GetNode(mbr).getTLModelObject());
 else {
    assert(false);
  }
  return cn;
}

Fixed version (ground truth):
/** 
 * New ComponentNode methods that also create new objects in underlying model
 * @return newly created node or null
 */
public static ComponentNode newComponent_UnTyped(final TLLibraryMember mbr){
  ComponentNode cn=null;
  if (mbr == null)   return cn;
  LOGGER.debug("String_Node_Str" + mbr.getLocalName());
  if (mbr instanceof TLValueWithAttributes)   cn=new VWA_Node((TLValueWithAttributes)mbr);
 else   if (mbr instanceof TLBusinessObject)   cn=new BusinessObjectNode(mbr);
 else   if (mbr instanceof TLCoreObject)   cn=new CoreObjectNode((TLCoreObject)mbr);
 else   if (mbr instanceof TLChoiceObject)   cn=new ChoiceObjectNode((TLChoiceObject)mbr);
 else   if (mbr instanceof TLSimple)   cn=new SimpleTypeNode((TLSimple)mbr);
 else   if (mbr instanceof TLOpenEnumeration)   cn=new EnumerationOpenNode(mbr);
 else   if (mbr instanceof TLClosedEnumeration)   cn=new EnumerationClosedNode(mbr);
 else   if (mbr instanceof TLExtensionPointFacet)   cn=new ExtensionPointNode((TLExtensionPointFacet)mbr);
 else   if (mbr instanceof TLResource)   cn=new ResourceNode(mbr);
 else   if (mbr instanceof XSDSimpleType)   cn=new SimpleTypeNode((TLSimple)Node.GetNode(mbr).getTLModelObject());
 else {
    assert(false);
  }
  LOGGER.debug("String_Node_Str" + cn);
  return cn;
}
Program: 136269
Project: 136269
Buggy source:
public FacetNode(final TLFacet obj){
  super(obj);
  assert(modelObject instanceof FacetMO);
}

Fixed version (ground truth):
public FacetNode(final TLFacet obj){
  super(obj);
  addMOChildren();
  assert(modelObject instanceof FacetMO);
}
Program: 136270
Project: 136270
Buggy source:
@Override public void runWithEvent(Event event){
  Node owner;
  String value;
  if (event.data instanceof SetDescriptionEvent) {
    owner=((SetDescriptionEvent)event.data).owner;
    value=((SetDescriptionEvent)event.data).value;
    AddNodeHandler2 handler=new AddNodeHandler2();
    if (!owner.isEditable_newToChain()) {
      if (owner.getChain() != null) {
        DialogUserNotifier.openWarning("String_Node_Str","String_Node_Str" + owner + "String_Node_Str");
        return;
      }
    }
switch (((SetDescriptionEvent)event.data).type) {
case DESCRIPTION:
      owner.setDescription(value);
    break;
case EXAMPLE:
  if (owner.getExampleHandler() != null)   owner.getExampleHandler().set(value,null);
break;
case EQUIVALENT:
if (owner.getEquivalentHandler() != null) owner.getEquivalentHandler().set(value,null);
break;
default :
break;
}
}
}

Fixed version (ground truth):
@Override public void runWithEvent(Event event){
  Node owner;
  String value;
  if (event.data instanceof SetDescriptionEvent) {
    owner=((SetDescriptionEvent)event.data).owner;
    value=((SetDescriptionEvent)event.data).value;
    if (!owner.isEditable()) {
      if (owner.getChain() != null) {
        DialogUserNotifier.openWarning("String_Node_Str","String_Node_Str" + owner + "String_Node_Str");
        return;
      }
    }
switch (((SetDescriptionEvent)event.data).type) {
case DESCRIPTION:
      owner.setDescription(value);
    break;
case EXAMPLE:
  if (owner.getExampleHandler() != null)   owner.getExampleHandler().set(value,null);
break;
case EQUIVALENT:
if (owner.getEquivalentHandler() != null) owner.getEquivalentHandler().set(value,null);
break;
default :
break;
}
}
}
Program: 136273
Project: 136273
Buggy source:
protected ComponentNode createMinorVersionComponent(ComponentNode newNode){
  if (newNode.getModelObject() instanceof EmptyMO) {
    return null;
  }
  Node owner=this.getOwningComponent();
  owner.getLibrary().checkExtension(owner);
  if (owner.isInHead())   return null;
  if (newNode instanceof ExtensionOwner)   ((ExtensionOwner)newNode).setExtension(owner);
  if (newNode.getName() == null || newNode.getName().isEmpty())   newNode.setName(owner.getName());
  LibraryChainNode chain=owner.getChain();
  chain.getHead().addMember(newNode);
  chain.getComplexAggregate().getChildren().remove(owner);
  owner.getLibrary().checkExtension(owner);
  return newNode;
}

Fixed version (ground truth):
protected ComponentNode createMinorVersionComponent(ComponentNode newNode){
}
Program: 136274
Project: 136274
Buggy source:
/** 
 * Return the actual node wrapped by this version node.
 * @return node or null
 */
public Node get(){
  return head;
}

Fixed version (ground truth):
/** 
 * Return the actual node wrapped by this version node.
 * @return node or null
 */
public Node get(){
  return getChildren().isEmpty() ? null : getChildren().get(0);
}
Program: 136275
Project: 136275
Buggy source:
public String getComments(){
  String comments="String_Node_Str";
  if (absTLLibrary instanceof TLLibrary) {
    comments=((TLLibrary)absTLLibrary).getComments();
  }
  return emptyIfNull(comments);
}

Fixed version (ground truth):
public String getComments(){
  String comments="String_Node_Str";
  if (absTLLibrary instanceof TLLibrary)   comments=((TLLibrary)absTLLibrary).getComments();
  return emptyIfNull(comments);
}
Program: 136277
Project: 136277
Buggy source:
/** 
 * Runs new component wizard and creates new node with TL type. Used by New Complex Type Action handler.
 */
public void newToLibrary(){
  MainController mc=OtmRegistry.getMainController();
  final Node selected=mc.getSelectedNode_NavigatorView();
  if (selected == null) {
    DialogUserNotifier.openInformation("String_Node_Str","String_Node_Str");
    return;
  }
  if (!selected.isInTLLibrary()) {
    DialogUserNotifier.openInformation("String_Node_Str","String_Node_Str");
    return;
  }
  if (selected.getLibrary() == null) {
    DialogUserNotifier.openInformation("String_Node_Str","String_Node_Str");
    return;
  }
  if (!selected.isEditable()) {
    DialogUserNotifier.openInformation("String_Node_Str","String_Node_Str");
    return;
  }
  final NewComponentWizard wizard=new NewComponentWizard(selected);
  EditNode editNode=null;
  editNode=wizard.postNewComponentWizard(OtmRegistry.getActiveShell());
  if (editNode != null) {
    ComponentNodeType type=ComponentNodeType.fromString(editNode.getUseType());
    Node newOne=new NodeFactory().newComponent(editNode,type);
    newOne.setName(NodeNameUtils.fixComplexTypeName(newOne.getName()));
    Assert.notNull(newOne.getLibrary());
    if (editNode.getTLType() != null && newOne instanceof ServiceNode)     ((ServiceNode)newOne).addCRUDQ_Operations(editNode.getTLType());
    mc.selectNavigatorNodeAndRefresh(newOne);
  }
}

Fixed version (ground truth):
/** 
 * Runs new component wizard and creates new node with TL type. Used by New Complex Type Action handler.
 */
public void newToLibrary(){
  MainController mc=OtmRegistry.getMainController();
  final Node selected=mc.getSelectedNode_NavigatorView();
  if (selected == null) {
    DialogUserNotifier.openInformation("String_Node_Str","String_Node_Str");
    return;
  }
  if (!selected.isInTLLibrary()) {
    DialogUserNotifier.openInformation("String_Node_Str","String_Node_Str");
    return;
  }
  if (selected.getLibrary() == null) {
    DialogUserNotifier.openInformation("String_Node_Str","String_Node_Str");
    return;
  }
  if (!selected.isEditable()) {
    DialogUserNotifier.openInformation("String_Node_Str","String_Node_Str");
    return;
  }
  final NewComponentWizard wizard=new NewComponentWizard(selected);
  EditNode editNode=null;
  editNode=wizard.postNewComponentWizard(OtmRegistry.getActiveShell());
  if (editNode != null) {
    ComponentNodeType type=ComponentNodeType.fromString(editNode.getUseType());
    Node newOne=new NodeFactory().newComponent(editNode,type);
    newOne.setName(NodeNameUtils.fixComplexTypeName(newOne.getName()));
    Assert.notNull(newOne.getLibrary());
    if (editNode.getTLType() != null && newOne instanceof ServiceNode)     ((ServiceNode)newOne).addCRUDQ_Operations(editNode.getTLType());
    mc.selectNavigatorNodeAndRefresh(newOne);
    assert(!editNode.getLibrary().contains(editNode));
  }
}
Program: 136278
Project: 136278
Buggy source:
/** 
 * @return the version node representing this node in the specific library in a chain.
 */
public VersionNode getVersionNode(){
  return versionNode;
}

Fixed version (ground truth):
/** 
 * Simple getter of the versionNode field.
 * @return the version node representing this node in the specific library in a chain.
 */
public VersionNode getVersionNode(){
  return versionNode;
}
Program: 136279
Project: 136279
Buggy source:
/** 
 * @return the newest version of the object (version head).
 */
public Node getNewestVersion(){
  return head;
}

Fixed version (ground truth):
/** 
 * Simple getter of the head field.
 * @return the newest version of the object (version head).
 */
public Node getNewestVersion(){
  return head;
}
Program: 136280
Project: 136280
Buggy source:
/** 
 * Create a node by reading data from the wizard pages.
 * @return
 */
private EditNode createNode(){
  if (ncPage1.getComponentType().equals(ComponentNodeType.EXTENSION_POINT.getDescription())) {
    editNode.setName("String_Node_Str");
  }
 else {
    editNode.setName(ncPage1.getName());
  }
  editNode.setDescription(ncPage1.getDescription());
  editNode.setUseType(ncPage1.getComponentType());
  editNode.setLibrary(targetNode.getLibrary());
  editNode.setParent(targetNode);
  editNode.setTLType(serviceSubjectSelectionPage.getSelectedNode());
  return editNode;
}

Fixed version (ground truth):
/** 
 * Create a node by reading data from the wizard pages.
 * @return
 */
private EditNode createNode(){
  if (ncPage1.getComponentType().equals(ComponentNodeType.EXTENSION_POINT.getDescription())) {
    editNode.setName("String_Node_Str");
  }
 else {
    editNode.setName(ncPage1.getName());
  }
  editNode.setDescription(ncPage1.getDescription());
  editNode.setUseType(ncPage1.getComponentType());
  editNode.setLibrary(targetNode.getLibrary().getHead());
  editNode.setParent(targetNode);
  editNode.setTLType(serviceSubjectSelectionPage.getSelectedNode());
  return editNode;
}
Program: 136281
Project: 136281
Buggy source:
private void postCombo(final String label){
  Label cl=new Label(container,SWT.NONE);
  cl.setText(label);
  combo=WidgetFactory.createCombo(container,SWT.BORDER | SWT.READ_ONLY);
  combo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  ComponentNodeType targetType=contextGuess(targetNode);
  ComponentNodeType[] list=componentList;
  String tooltip=Messages.getString("String_Node_Str");
  LibraryNode lib=targetNode.getChain() == null ? targetNode.getLibrary() : targetNode.getChain().getHead();
  if (lib.getEditStatus().equals(NodeEditStatus.PATCH)) {
    list=PatchComponentList;
    tooltip=Messages.getString("String_Node_Str");
    targetType=ComponentNodeType.EXTENSION_POINT;
  }
  int index=0;
  for (  ComponentNodeType item : list) {
    combo.add(item.getDescription());
    if (item == targetType)     combo.select(index);
    index++;
  }
  boolean hasService=false;
  if (targetNode.getChain() != null)   hasService=targetNode.getChain().hasService();
 else   hasService=targetNode.getLibrary().hasService();
  if (!hasService && !targetNode.getEditStatus().equals(NodeEditStatus.PATCH)) {
    combo.add(ComponentNodeType.SERVICE.getDescription());
    tooltip=Messages.getString("String_Node_Str");
  }
  cl.setToolTipText(tooltip);
  combo.setToolTipText(tooltip);
  combo.addKeyListener(new FacetKeyListener());
  combo.addModifyListener(new TextModifyListener());
  combo.addTraverseListener(new TextTraverseListener());
}

Fixed version (ground truth):
private void postCombo(final String label){
  Label cl=new Label(container,SWT.NONE);
  cl.setText(label);
  combo=WidgetFactory.createCombo(container,SWT.BORDER | SWT.READ_ONLY);
  combo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  ComponentNodeType targetType=contextGuess(targetNode);
  ComponentNodeType[] list=componentList;
  String tooltip=Messages.getString("String_Node_Str");
  LibraryNode lib=targetNode.getLibrary().getHead();
  if (lib.getEditStatus().equals(NodeEditStatus.PATCH)) {
    list=PatchComponentList;
    tooltip=Messages.getString("String_Node_Str");
    targetType=ComponentNodeType.EXTENSION_POINT;
  }
  int index=0;
  for (  ComponentNodeType item : list) {
    combo.add(item.getDescription());
    if (item == targetType)     combo.select(index);
    index++;
  }
  boolean hasService=false;
  if (targetNode.getChain() != null)   hasService=targetNode.getChain().hasService();
 else   hasService=targetNode.getLibrary().hasService();
  if (!hasService && !targetNode.getEditStatus().equals(NodeEditStatus.PATCH)) {
    combo.add(ComponentNodeType.SERVICE.getDescription());
    tooltip=Messages.getString("String_Node_Str");
  }
  cl.setToolTipText(tooltip);
  combo.setToolTipText(tooltip);
  combo.addKeyListener(new FacetKeyListener());
  combo.addModifyListener(new TextModifyListener());
  combo.addTraverseListener(new TextTraverseListener());
}
Program: 136282
Project: 136282
Buggy source:
private Composite createObjectTypeRadios(final Composite c){
  final GridLayout gl=new GridLayout();
  gl.numColumns=2;
  container.setLayout(gl);
  objectTypeButtons=new EnumMap<ComponentNodeType,Button>(ComponentNodeType.class);
  ArrayList<ComponentNodeType> list=new ArrayList<ComponentNodeType>();
  String tooltip=Messages.getString("String_Node_Str");
  if (!targetNode.getLibrary().hasService())   tooltip=Messages.getString("String_Node_Str");
  if (targetNode.getLibrary().getEditStatus().equals(NodeEditStatus.PATCH))   postButtons(PatchComponentList,tooltip,container);
 else {
    if (targetNode.getLibrary().hasService())     postButtons(serviceComponentList,tooltip,container);
 else     postButtons(noServiceComponentList,tooltip,container);
    postButtons(complexComponentList,tooltip,container);
    postButtons(simpleComponentList,tooltip,container);
  }
  return container;
}

Fixed version (ground truth):
private Composite createObjectTypeRadios(final Composite c){
  final GridLayout gl=new GridLayout();
  gl.numColumns=2;
  container.setLayout(gl);
  objectTypeButtons=new EnumMap<ComponentNodeType,Button>(ComponentNodeType.class);
  ArrayList<ComponentNodeType> list=new ArrayList<ComponentNodeType>();
  String tooltip=Messages.getString("String_Node_Str");
  if (!targetNode.getLibrary().hasService())   tooltip=Messages.getString("String_Node_Str");
  if (targetNode.getLibrary().getHead().getEditStatus().equals(NodeEditStatus.PATCH))   postButtons(PatchComponentList,tooltip,container);
 else {
    if (targetNode.getLibrary().hasService())     postButtons(serviceComponentList,tooltip,container);
 else     postButtons(noServiceComponentList,tooltip,container);
    postButtons(complexComponentList,tooltip,container);
    postButtons(simpleComponentList,tooltip,container);
  }
  return container;
}
Program: 136283
Project: 136283
Buggy source:
@Override public void createControl(final Composite parent){
  container=new Composite(parent,SWT.NULL);
  final GridLayout layout=new GridLayout();
  container.setLayout(layout);
  nCols=2;
  layout.numColumns=nCols;
  final Label label1=new Label(container,SWT.NULL);
  if (!targetNode.isEditable())   label1.setText(Messages.getString("String_Node_Str"));
 else   label1.setText(Messages.getString("String_Node_Str"));
  label1.setToolTipText(Messages.getString("String_Node_Str"));
  final Label libraryField=new Label(container,SWT.NULL | SWT.READ_ONLY);
  libraryField.setText(targetNode.getLibrary().getLabel() + "String_Node_Str" + targetNode.getLibrary().getVersion()+ "String_Node_Str");
  libraryField.setToolTipText(Messages.getString("String_Node_Str"));
  if (targetNode.getLibrary().getEditStatus().equals(NodeEditStatus.PATCH)) {
    label1.setText(Messages.getString("String_Node_Str"));
    libraryField.setToolTipText(Messages.getString("String_Node_Str"));
  }
  postCombo(Messages.getString("String_Node_Str"));
  postCommonFields();
  final GridData gd=new GridData(GridData.FILL_HORIZONTAL);
  name.setLayoutData(gd);
  setControl(container);
  setPageComplete(false);
}

Fixed version (ground truth):
@Override public void createControl(final Composite parent){
  container=new Composite(parent,SWT.NULL);
  final GridLayout layout=new GridLayout();
  container.setLayout(layout);
  nCols=2;
  layout.numColumns=nCols;
  final Label label1=new Label(container,SWT.NULL);
  LibraryNode targetLib=targetNode.getLibrary().getHead();
  if (!targetNode.isEditable())   label1.setText(Messages.getString("String_Node_Str"));
 else   label1.setText(Messages.getString("String_Node_Str"));
  label1.setToolTipText(Messages.getString("String_Node_Str"));
  final Label libraryField=new Label(container,SWT.NULL | SWT.READ_ONLY);
  libraryField.setText(targetLib.getLabel() + "String_Node_Str" + targetLib.getVersion()+ "String_Node_Str");
  libraryField.setToolTipText(Messages.getString("String_Node_Str"));
  if (targetLib.getEditStatus().equals(NodeEditStatus.PATCH)) {
    label1.setText(Messages.getString("String_Node_Str"));
    libraryField.setToolTipText(Messages.getString("String_Node_Str"));
  }
  postCombo(Messages.getString("String_Node_Str"));
  postCommonFields();
  final GridData gd=new GridData(GridData.FILL_HORIZONTAL);
  name.setLayoutData(gd);
  setControl(container);
  setPageComplete(false);
}
Program: 136284
Project: 136284
Buggy source:
@After public void afterEachTest() throws RepositoryException, IOException {
  pc.getDefaultProject().removeAllFromTLProject();
  pc.closeAll();
  for (  ProjectNode pn : projectsToClean) {
    RepositoryTestUtils.deleteContents(pn.getTLProject().getProjectFile().getParentFile());
  }
  projectsToClean.clear();
  assert(Node.getModelNode().getManagedLibraries().size() == pc.getBuiltInProject().getChildren().size());
}

Fixed version (ground truth):
@After public void afterEachTest() throws RepositoryException, IOException {
  pc.getDefaultProject().removeAllFromTLProject();
  pc.closeAll();
  for (  ProjectNode pn : projectsToClean) {
    System.out.println("String_Node_Str" + pn);
    RepositoryTestUtils.deleteContents(pn.getTLProject().getProjectFile().getParentFile());
  }
  projectsToClean.clear();
  assert(Node.getModelNode().getManagedLibraries().size() == pc.getBuiltInProject().getChildren().size());
}
Program: 136285
Project: 136285
Buggy source:
/** 
 * @return new business object with properties or null if library is not editable
 */
public BusinessObjectNode addBusinessObjectToLibrary(LibraryNode ln,String name){
  for (  Node n : ln.getDescendants_LibraryMembers())   if (n.getName().equals(name)) {
    LOGGER.warn("String_Node_Str" + name);
    return (BusinessObjectNode)n;
  }
  BusinessObjectNode newNode=addBusinessObjectToLibrary_Empty(ln,name);
  if (newNode == null)   return null;
  TypeProvider string=(TypeProvider)NodeFinders.findNodeByName("String_Node_Str",ModelNode.XSD_NAMESPACE);
  new ElementNode(newNode.getIDFacet(),"String_Node_Str" + name,string);
  new IdNode(newNode.getIDFacet(),"String_Node_Str" + name);
  new ElementNode(newNode.getSummaryFacet(),"String_Node_Str" + name,string);
  new AttributeNode(newNode.getSummaryFacet(),"String_Node_Str" + name,string);
  new IndicatorElementNode(newNode.getSummaryFacet(),"String_Node_Str" + name);
  new IndicatorNode(newNode.getSummaryFacet(),"String_Node_Str" + name);
  new ElementReferenceNode(newNode.addFacet("String_Node_Str" + name,TLFacetType.CUSTOM),"String_Node_Str" + name,newNode);
  new AttributeNode(newNode.addFacet("String_Node_Str" + name,TLFacetType.QUERY),"String_Node_Str" + name,string);
  if (!ln.isValid()) {
    printValidationFindings(ln);
    assertTrue("String_Node_Str",ln.isValid());
  }
  LOGGER.debug("String_Node_Str" + name);
  return ln.isEditable() ? newNode : null;
}

Fixed version (ground truth):
public BusinessObjectNode addBusinessObjectToLibrary(LibraryNode ln,String name,boolean addID){
  for (  Node n : ln.getDescendants_LibraryMembers())   if (n.getName().equals(name)) {
    LOGGER.warn("String_Node_Str" + name);
    return (BusinessObjectNode)n;
  }
  BusinessObjectNode newNode=addBusinessObjectToLibrary_Empty(ln,name);
  if (newNode == null)   return null;
  TypeProvider string=(TypeProvider)NodeFinders.findNodeByName("String_Node_Str",ModelNode.XSD_NAMESPACE);
  new ElementNode(newNode.getIDFacet(),"String_Node_Str" + name,string);
  IdNode idNode=new IdNode(newNode.getIDFacet(),"String_Node_Str" + name);
  new ElementNode(newNode.getSummaryFacet(),"String_Node_Str" + name,string);
  new AttributeNode(newNode.getSummaryFacet(),"String_Node_Str" + name,string);
  new IndicatorElementNode(newNode.getSummaryFacet(),"String_Node_Str" + name);
  new IndicatorNode(newNode.getSummaryFacet(),"String_Node_Str" + name);
  new ElementReferenceNode(newNode.addFacet("String_Node_Str" + name,TLFacetType.CUSTOM),"String_Node_Str" + name,newNode);
  new AttributeNode(newNode.addFacet("String_Node_Str" + name,TLFacetType.QUERY),"String_Node_Str" + name,string);
  if (!ln.isValid()) {
    printValidationFindings(ln);
    assertTrue("String_Node_Str",ln.isValid());
  }
  if (!addID)   idNode.delete();
  LOGGER.debug("String_Node_Str" + name);
  return ln.isEditable() ? newNode : null;
}
Program: 136286
Project: 136286
Buggy source:
public CoreObjectNode addCoreObjectToLibrary(LibraryNode ln,String name){
  TypeProvider type=((TypeProvider)NodeFinders.findNodeByName("String_Node_Str",ModelNode.XSD_NAMESPACE));
  CoreObjectNode newNode=addCoreObjectToLibrary_Empty(ln,name);
  TypeUser newProp=new ElementNode(newNode.getSummaryFacet(),"String_Node_Str",type);
  newNode.getRoleFacet().addRole(name + "String_Node_Str");
  return newNode;
}

Fixed version (ground truth):
public CoreObjectNode addCoreObjectToLibrary(LibraryNode ln,String name){
  TypeProvider type=((TypeProvider)NodeFinders.findNodeByName("String_Node_Str",ModelNode.XSD_NAMESPACE));
  CoreObjectNode newNode=addCoreObjectToLibrary_Empty(ln,name);
  TypeUser newProp=new ElementNode(newNode.getSummaryFacet(),"String_Node_Str" + name,type);
  newNode.getRoleFacet().addRole(name + "String_Node_Str");
  return newNode;
}
Program: 136287
Project: 136287
Buggy source:
/** 
 * Create a choice object with an alias, summary and two choice facets all with properties.
 */
public ChoiceObjectNode addChoice(LibraryNode ln,String name){
  if (name.isEmpty())   name="String_Node_Str";
  TypeProvider string=(TypeProvider)NodeFinders.findNodeByName("String_Node_Str",ModelNode.XSD_NAMESPACE);
  ChoiceObjectNode choice=new ChoiceObjectNode(new TLChoiceObject());
  if (!ln.isEditable())   return choice;
  choice.setName(name);
  if (ln != null)   ln.addMember(choice);
  PropertyOwnerInterface shared=choice.getSharedFacet();
  new ElementNode(shared,"String_Node_Str");
  FacetNode f1=choice.addFacet("String_Node_Str");
  new ElementNode(f1,"String_Node_Str",string);
  new AttributeNode(f1,"String_Node_Str");
  new IndicatorNode(f1,"String_Node_Str");
  FacetNode f2=choice.addFacet("String_Node_Str");
  new ElementNode(f2,"String_Node_Str");
  new AttributeNode(f2,"String_Node_Str");
  new IndicatorNode(f2,"String_Node_Str");
  return choice;
}

Fixed version (ground truth):
/** 
 * Create a choice object with an alias, summary and two choice facets all with properties.
 */
public ChoiceObjectNode addChoice(LibraryNode ln,String name){
  if (name.isEmpty())   name="String_Node_Str";
  TypeProvider string=(TypeProvider)NodeFinders.findNodeByName("String_Node_Str",ModelNode.XSD_NAMESPACE);
  ChoiceObjectNode choice=new ChoiceObjectNode(new TLChoiceObject());
  if (!ln.isEditable())   return choice;
  choice.setName(name);
  if (ln != null)   ln.addMember(choice);
  PropertyOwnerInterface shared=choice.getSharedFacet();
  new ElementNode(shared,"String_Node_Str" + name);
  FacetNode f1=choice.addFacet("String_Node_Str");
  new ElementNode(f1,"String_Node_Str" + name,string);
  new AttributeNode(f1,"String_Node_Str" + name);
  new IndicatorNode(f1,"String_Node_Str" + name);
  FacetNode f2=choice.addFacet("String_Node_Str");
  new ElementNode(f2,"String_Node_Str" + name);
  new AttributeNode(f2,"String_Node_Str" + name);
  new IndicatorNode(f2,"String_Node_Str" + name);
  return choice;
}
Program: 136290
Project: 136290
Buggy source:
private void runCommand(PropertyNodeType actionType){
  INode.CommandType type=selectedNode.getAddCommand();
  if (selectedNode instanceof CoreObjectNode && actionType == PropertyNodeType.ROLE)   type=INode.CommandType.ROLE;
 else   if (selectedNode instanceof ServiceNode)   type=INode.CommandType.OPERATION;
switch (type) {
case ROLE:
    addRoleToNode();
  break;
case PROPERTY:
addProperty();
break;
case ENUMERATION:
addEnumValue();
break;
case OPERATION:
addOperation();
break;
case NONE:
default :
DialogUserNotifier.openWarning("String_Node_Str","String_Node_Str");
}
}

Fixed version (ground truth):
private void runCommand(PropertyNodeType actionType){
  INode.CommandType type=selectedNode.getAddCommand();
  if (selectedNode instanceof CoreObjectNode && actionType == PropertyNodeType.ROLE)   type=INode.CommandType.ROLE;
switch (type) {
case ROLE:
    addRoleToNode();
  break;
case PROPERTY:
addProperty();
break;
case ENUMERATION:
addEnumValue();
break;
case OPERATION:
addOperation();
break;
case NONE:
default :
DialogUserNotifier.openWarning("String_Node_Str","String_Node_Str");
}
}
Program: 136291
Project: 136291
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;
  boolean result=false;
  if (selectedNode.getChain() == null)   return null;
  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;
}

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() == null)   return null;
  if (selectedNode.isInHead())   LOGGER.warn("String_Node_Str" + selectedNode + "String_Node_Str");
  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: 136292
Project: 136292
Buggy source:
private void setOrNewPropertyType(final OtmEventData ed){
  final TableItem ti=(TableItem)ed.getWidget();
  if ((ti == null) || (ti.getData() == null) || (!(ti.getData() instanceof ComponentNode))) {
    LOGGER.warn("String_Node_Str");
    showInvalidTargetWarning();
    return;
  }
  ComponentNode tableNode=(ComponentNode)ti.getData();
  final Node sourceNode=NodeFinders.findNodeByID(ed.getText());
  if (sourceNode == null) {
    LOGGER.warn("String_Node_Str");
    showInvalidTargetWarning();
    return;
  }
  Node ownNode=getOwningNodeForDrop(tableNode);
  Node newNode=tableNode.addPropertyFromDND(sourceNode,ed.isDragCopy());
  if (newNode == null)   PostTypeChange.notyfications(tableNode,sourceNode);
 else {
    ownNode=getOwningNodeForDrop(newNode);
    if (tableNode.getLibrary() != ownNode.getLibrary())     DialogUserNotifier.openInformation("String_Node_Str",Messages.getString("String_Node_Str"));
  }
  mc.refresh(ownNode);
}

Fixed version (ground truth):
private void setOrNewPropertyType(final OtmEventData ed){
  final TableItem ti=(TableItem)ed.getWidget();
  if ((ti == null) || (ti.getData() == null) || (!(ti.getData() instanceof ComponentNode))) {
    LOGGER.warn("String_Node_Str");
    showInvalidTargetWarning();
    return;
  }
  ComponentNode tableNode=(ComponentNode)ti.getData();
  final Node sourceNode=NodeFinders.findNodeByID(ed.getText());
  if (sourceNode == null) {
    LOGGER.warn("String_Node_Str");
    showInvalidTargetWarning();
    return;
  }
  if (ed.isDragCopy() || tableNode.isUnAssigned()) {
    if (tableNode instanceof TypeUser && sourceNode instanceof TypeProvider)     ((TypeUser)tableNode).setAssignedType((TypeProvider)sourceNode);
  }
 else {
    Event event=new Event();
    event.data=tableNode;
    new AddNodeHandler2().execute(event);
  }
}
Program: 136293
Project: 136293
Buggy source:
/** 
 * Add a new property from a Drag-and-Drop action. If version rules require, a new component is created.
 * @param isCopy - force a copy even if this node does not have assigned type
 * @return the new node or null if the type was only assigned.
 */
public Node addPropertyFromDND(Node sourceNode,boolean isCopy){
  if (sourceNode.isXsdType())   sourceNode=sourceNode.getOwningComponent();
  ComponentNode newNode=null;
  if (isCopy || !isUnAssigned()) {
    if (getChain() != null) {
      if (getChain().isPatch())       newNode=createPatchVersionComponent();
 else       if (getChain().isMinor() && this instanceof VersionedObjectInterface)       newNode=((VersionedObjectInterface)this).createMinorVersionComponent();
    }
    if (newNode != null)     newNode=(ComponentNode)newNode.createProperty(sourceNode);
 else     newNode=(ComponentNode)createProperty(sourceNode);
    if (this instanceof FacetNode && ((FacetNode)this).isSummaryFacet())     if (!getLibrary().isMinorVersion())     newNode.setMandatory(true);
  }
 else {
    if (this instanceof TypeUser && sourceNode instanceof TypeProvider)     ((TypeUser)this).setAssignedType((TypeProvider)sourceNode);
  }
  return newNode;
}

Fixed version (ground truth):
/** 
 * Add a new property from a Drag-and-Drop action. If version rules require, a new component is created.
 * @param isCopy - force a copy even if this node does not have assigned type
 * @return the new node or null if the type was only assigned.
 */
@Deprecated public Node addPropertyFromDND(Node sourceNode,boolean isCopy){
  if (sourceNode.isXsdType())   sourceNode=sourceNode.getOwningComponent();
  ComponentNode newNode=null;
  if (isCopy || !isUnAssigned()) {
    if (getChain() != null) {
      if (getChain().isPatch())       newNode=createPatchVersionComponent();
 else       if (getChain().isMinor() && this instanceof VersionedObjectInterface)       newNode=((VersionedObjectInterface)this).createMinorVersionComponent();
    }
    if (newNode != null)     newNode=(ComponentNode)newNode.createProperty(sourceNode);
 else     newNode=(ComponentNode)createProperty(sourceNode);
    if (this instanceof FacetNode && ((FacetNode)this).isSummaryFacet())     if (!getLibrary().isMinorVersion())     newNode.setMandatory(true);
  }
 else {
    if (this instanceof TypeUser && sourceNode instanceof TypeProvider)     ((TypeUser)this).setAssignedType((TypeProvider)sourceNode);
  }
  return newNode;
}
Program: 136294
Project: 136294
Buggy source:
private void generateLibrary(final TLLibrary tlLib){
  for (  final LibraryMember mbr : tlLib.getNamedMembers()) {
    ComponentNode n=(ComponentNode)GetNode(mbr);
    if (mbr instanceof TLContextualFacet) {
      LOGGER.debug("String_Node_Str" + mbr.getLocalName());
    }
 else     if (mbr instanceof TLService) {
      if (n instanceof ServiceNode)       ((ServiceNode)n).link((TLService)mbr,this);
 else       new ServiceNode((TLService)mbr,this);
    }
 else     if (mbr instanceof TLResource)     if (n instanceof ResourceNode) {
      n.getLibrary().remove(n);
      this.linkMember(n);
    }
 else     new ResourceNode((TLResource)mbr,this);
 else {
      if (n == null)       n=NodeFactory.newComponent_UnTyped((TLLibraryMember)mbr);
      linkMember(n);
    }
  }
  new TypeResolver().resolveTypes();
}

Fixed version (ground truth):
private void generateLibrary(final TLLibrary tlLib){
  for (  final LibraryMember mbr : tlLib.getNamedMembers()) {
    ComponentNode n=(ComponentNode)GetNode(mbr);
    if (mbr instanceof TLContextualFacet) {
      LOGGER.debug("String_Node_Str" + mbr.getLocalName() + ((TLContextualFacet)mbr).isLocalFacet());
    }
 else     if (mbr instanceof TLService) {
      if (n instanceof ServiceNode)       ((ServiceNode)n).link((TLService)mbr,this);
 else       new ServiceNode((TLService)mbr,this);
    }
 else     if (mbr instanceof TLResource)     if (n instanceof ResourceNode) {
      n.getLibrary().remove(n);
      this.linkMember(n);
    }
 else     new ResourceNode((TLResource)mbr,this);
 else {
      if (n == null)       n=NodeFactory.newComponent_UnTyped((TLLibraryMember)mbr);
      linkMember(n);
    }
  }
  new TypeResolver().resolveTypes();
}
Program: 136295
Project: 136295
Buggy source:
/** 
 * getChildren is used when a node that hasChildren() is selected
 */
@Override public Object[] getChildren(final Object element){
  if (element instanceof Node) {
    Node node=(Node)element;
    List<Node> navChildren=new ArrayList<Node>();
    navChildren.addAll(node.getNavChildren());
    if (node instanceof TypeProvider)     navChildren.add(((TypeProvider)node).getWhereUsedNode());
    if (node instanceof LibraryNode) {
      navChildren.add(((LibraryNode)node).getWhereUsedHandler().getWhereUsedNode());
      navChildren.add(((LibraryNode)node).getWhereUsedHandler().getUsedByNode());
    }
    if (node instanceof LibraryChainNode) {
      navChildren.add(((LibraryChainNode)node).getHead().getWhereUsedHandler().getWhereUsedNode());
      navChildren.add(((LibraryChainNode)node).getHead().getWhereUsedHandler().getUsedByNode());
    }
    navChildren.addAll(node.getInheritedChildren());
    return navChildren != null ? navChildren.toArray() : null;
  }
 else   throw new IllegalArgumentException("String_Node_Str" + element);
}

Fixed version (ground truth):
/** 
 * getChildren is used when a node that hasChildren() is selected
 */
@Override public Object[] getChildren(final Object element){
  if (element instanceof Node) {
    Node node=(Node)element;
    List<Node> navChildren=new ArrayList<Node>();
    if (node.isDeleted()) {
      LOGGER.debug("String_Node_Str" + node);
      return null;
    }
    navChildren.addAll(node.getNavChildren());
    if (node instanceof TypeProvider)     navChildren.add(((TypeProvider)node).getWhereUsedNode());
    if (node instanceof LibraryNode) {
      navChildren.add(((LibraryNode)node).getWhereUsedHandler().getWhereUsedNode());
      navChildren.add(((LibraryNode)node).getWhereUsedHandler().getUsedByNode());
    }
    if (node instanceof LibraryChainNode) {
      navChildren.add(((LibraryChainNode)node).getHead().getWhereUsedHandler().getWhereUsedNode());
      navChildren.add(((LibraryChainNode)node).getHead().getWhereUsedHandler().getUsedByNode());
    }
    navChildren.addAll(node.getInheritedChildren());
    return navChildren != null ? navChildren.toArray() : null;
  }
 else   throw new IllegalArgumentException("String_Node_Str" + element);
}
Program: 136296
Project: 136296
Buggy source:
@Override public StyledString getStyledText(Object element){
  return new StyledString(getText(element));
}

Fixed version (ground truth):
@Override public StyledString getStyledText(Object element){
  if (element instanceof INode) {
    if (!((INode)element).isDeleted())     return new StyledString(getText(element));
  }
  return new StyledString("String_Node_Str");
}
Program: 136297
Project: 136297
Buggy source:
@Override public String getText(final Object element){
  String label="String_Node_Str";
  if (element instanceof INode) {
    final Node n=(Node)element;
    label=n.getLabel();
    if (n.isDeleted())     label+="String_Node_Str";
    if (n.isLocal())     label=n.getName() + "String_Node_Str";
  }
  return label;
}

Fixed version (ground truth):
@Override public String getText(final Object element){
  String label="String_Node_Str";
  if (element instanceof INode) {
    final Node n=(Node)element;
    if (n.isDeleted()) {
      LOGGER.debug("String_Node_Str");
      return null;
    }
    label=n.getLabel();
    if (n.isLocal())     label=n.getName() + "String_Node_Str";
  }
  return label;
}
Program: 136298
Project: 136298
Buggy source:
@Test public void addPropertyFromDND_Tests(){
  ln.setEditable(true);
  BusinessObjectNode bo=mockLibrary.addBusinessObjectToLibrary(ln,"String_Node_Str");
  PropertyOwnerInterface summary=bo.getSummaryFacet();
  Node aType=NodeFinders.findNodeByName("String_Node_Str",ModelNode.XSD_NAMESPACE);
  ComponentNode cn=(ComponentNode)summary;
  Node result=cn.addPropertyFromDND(aType,false);
  assertNotNull(result);
  assertTrue(bo.getSummaryFacet().getChildren().contains(result));
  result=cn.addPropertyFromDND(aType,true);
  assertNotNull(result);
  assertEquals(aType,result.getType());
  assertTrue(bo.getSummaryFacet().getChildren().contains(result));
  result=((ComponentNode)result).addPropertyFromDND(aType,false);
  assertNotNull(result);
  assertTrue(bo.getSummaryFacet().getChildren().contains(result));
  ((PropertyNode)result).setAssignedType();
  result=((ComponentNode)result).addPropertyFromDND(aType,false);
  assertNull(result);
}

Fixed version (ground truth):
@Test public void addPropertyFromDND_Tests(){
  ln.setEditable(true);
  BusinessObjectNode bo=mockLibrary.addBusinessObjectToLibrary(ln,"String_Node_Str");
  PropertyOwnerInterface summary=bo.getSummaryFacet();
  Node aType=NodeFinders.findNodeByName("String_Node_Str",ModelNode.XSD_NAMESPACE);
  ComponentNode cn=(ComponentNode)summary;
}
Program: 136299
Project: 136299
Buggy source:
private void typeSelector(){
  List<Node> users=new ArrayList<Node>();
  List<Node> selections=getMainController().getSelectedNodes_NavigatorView();
  if (selections != null)   for (  Node s : selections) {
    if (s instanceof TypeNode)     addTypeUsers(s,users);
 else     users.add(s);
  }
  OtmAbstractHandler handler=new OtmAbstractHandler(){
    @Override public Object execute(    ExecutionEvent event) throws ExecutionException {
      return null;
    }
  }
;
  Node n=users.get(0);
  if (n.getChain() != null && !n.isInHead2())   n=handler.createVersionExtension(n);
  if (n == null)   return;
  final TypeSelectionWizard wizard=new TypeSelectionWizard(new ArrayList<Node>(users));
  if (wizard.run(OtmRegistry.getActiveShell())) {
    execute(wizard.getList(),wizard.getSelection());
  }
  mc.refresh(users.get(0));
}

Fixed version (ground truth):
private void typeSelector(){
  List<Node> users=new ArrayList<Node>();
  List<Node> selections=getMainController().getSelectedNodes_NavigatorView();
  if (selections != null)   for (  Node s : selections) {
    if (s instanceof TypeNode)     addTypeUsers((TypeNode)s,users);
 else     users.add(s);
  }
  OtmAbstractHandler handler=new OtmAbstractHandler(){
    @Override public Object execute(    ExecutionEvent event) throws ExecutionException {
      return null;
    }
  }
;
  if (users == null || users.isEmpty())   return;
  Node n=users.get(0);
  if (n.getChain() != null && !n.isInHead2())   n=handler.createVersionExtension(n);
  if (n == null)   return;
  final TypeSelectionWizard wizard=new TypeSelectionWizard(new ArrayList<Node>(users));
  if (wizard.run(OtmRegistry.getActiveShell())) {
    execute(wizard.getList(),wizard.getSelection());
  }
  mc.refresh(users.get(0));
}
Program: 136300
Project: 136300
Buggy source:
private void addTypeUsers(INode n,List<Node> users){
  throw new IllegalStateException("String_Node_Str");
}

Fixed version (ground truth):
private void addTypeUsers(TypeNode tn,List<Node> users){
  if (tn.isUser()) {
    users.add(tn.getParent());
  }
}
Program: 136301
Project: 136301
Buggy source:
@Override public boolean isEnabled(){
  Node n=getMainController().getCurrentNode_NavigatorView();
  return n.getChain() == null ? n.isEditable() : n.getChain().isMajor();
}

Fixed version (ground truth):
@Override public boolean isEnabled(){
  Node n=getMainController().getCurrentNode_NavigatorView();
  if (n == null || !(n instanceof TypeNode) || !((TypeNode)n).isUser())   return false;
  return n.getChain() == null ? n.isEditable() : n.getChain().isMajor();
}