nus-yam/ex-repair huggingface dataset:
Program: 119837
Project: 119837
Buggy source:
@Override protected void okPressed(){
  String eleName=this.getValue();
  super.okPressed();
}

Fixed version (ground truth):
@Override protected void okPressed(){
  super.okPressed();
}
Program: 119841
Project: 119841
Buggy source:
@Override public void run(IProgressMonitor monitor){
  TreeItem root=xmlViewer.getTree().getItem(0);
  if (getManager().getHl7Component().isHL7Output()) {
    if (getManager() instanceof HL7OutputManager) {
      List<HL7TreeNode> treeData=((HL7OutputManager)getManager()).getTreeData("String_Node_Str");
      createLoopLinks(treeData);
      getBackgroundRefresher().refreshBackground();
    }
  }
 else {
    List<TreeItem> allItems=TreeUtils.collectAllItems(root);
    monitorWrap=new EventLoopProgressMonitor(monitor);
    String taskName=Messages.getString("String_Node_Str");
    int totalWork=allItems.size();
    monitorWrap.beginTask(taskName,totalWork);
    for (int i=0; i < totalWork; i++) {
      if (monitorWrap.isCanceled()) {
        return;
      }
      TreeItem treeItem=allItems.get(i);
      HL7TreeNode node=(HL7TreeNode)treeItem.getData();
      if (node.getColumn() == null) {
        continue;
      }
      createLoopLinks(node.getColumn().getLabel(),treeItem,monitorWrap,i == totalWork - 1);
      monitorWrap.worked(1);
    }
    monitorWrap.done();
  }
}

Fixed version (ground truth):
@Override public void run(IProgressMonitor monitor){
  TreeItem root=xmlViewer.getTree().getItem(0);
  if (getManager().getHl7Component().isHL7Output()) {
    if (getManager() instanceof HL7OutputManager) {
      List<HL7TreeNode> mappableNodes=new ArrayList<HL7TreeNode>();
      IElementParameter param=getManager().getHl7Component().getElementParameterFromField(EParameterFieldType.PROPERTY_TYPE);
      String value=(String)param.getChildParameters().get(EParameterName.PROPERTY_TYPE.getName()).getValue();
      if (value.equals(EmfComponent.BUILTIN)) {
        List<HL7TreeNode> treeData=((HL7OutputManager)getManager()).getTreeData(((HL7OutputManager)getManager()).getCurrentSchema(false));
        for (        HL7TreeNode data : treeData) {
          if (data.isMain()) {
            if (data.hasChildren()) {
              mappableNodes.addAll(data.getChildren());
            }
          }
 else {
            mappableNodes.add(data);
          }
        }
      }
 else {
        mappableNodes=((HL7OutputManager)getManager()).getTreeData("String_Node_Str");
      }
      createLoopLinks(mappableNodes);
      xmlViewer.refresh();
      getBackgroundRefresher().refreshBackground();
    }
  }
 else {
    List<TreeItem> allItems=TreeUtils.collectAllItems(root);
    monitorWrap=new EventLoopProgressMonitor(monitor);
    String taskName=Messages.getString("String_Node_Str");
    int totalWork=allItems.size();
    monitorWrap.beginTask(taskName,totalWork);
    for (int i=0; i < totalWork; i++) {
      if (monitorWrap.isCanceled()) {
        return;
      }
      TreeItem treeItem=allItems.get(i);
      HL7TreeNode node=(HL7TreeNode)treeItem.getData();
      if (node.getColumn() == null) {
        continue;
      }
      createLoopLinks(node.getColumn().getLabel(),treeItem,monitorWrap,i == totalWork - 1);
      monitorWrap.worked(1);
    }
    monitorWrap.done();
  }
}
Program: 119843
Project: 119843
Buggy source:
private void createLoopLinks(List<HL7TreeNode> treeData){
  for (  HL7TreeNode treeNode : treeData) {
    if (treeNode.getColumn() != null) {
      TableItem tableItem=null;
      for (      TableItem curTableItem : getSource().getItems()) {
        if (curTableItem.getText().equals(treeNode.getColumnName())) {
          tableItem=curTableItem;
          break;
        }
      }
      if (tableItem == null) {
        continue;
      }
      String path=tableItem.getText();
      if (path != null) {
        TreeItem treeItem=getTreeItem(treeNode);
        if (treeItem != null) {
          addLoopLink(tableItem,tableItem.getData(),xmlViewer.getTree(),(HL7TreeNode)treeItem.getData(),false);
        }
      }
    }
    createLoopLinks(treeNode.getChildren());
  }
}

Fixed version (ground truth):
private void createLoopLinks(List<HL7TreeNode> treeData){
  for (  HL7TreeNode treeNode : treeData) {
    if (treeNode.getColumn() != null) {
      TableItem tableItem=null;
      for (      TableItem curTableItem : getSource().getItems()) {
        if (curTableItem.getText().equals(treeNode.getColumn().getLabel())) {
          tableItem=curTableItem;
          break;
        }
      }
      if (tableItem == null) {
        continue;
      }
      String path=tableItem.getText();
      if (path != null) {
        TreeItem treeItem=getTreeItem(treeNode);
        if (treeItem != null) {
          addLoopLink(tableItem,tableItem.getData(),xmlViewer.getTree(),(HL7TreeNode)treeItem.getData(),false);
        }
      }
    }
    createLoopLinks(treeNode.getChildren());
  }
}
Program: 119845
Project: 119845
Buggy source:
public ConnectionLabel getConnectionLabel(){
  return label;
}

Fixed version (ground truth):
public ConnectionLabel getConnectionLabel(){
  if (label.equals("String_Node_Str") || label.equals("String_Node_Str")) {
    System.out.println("String_Node_Str");
  }
  return label;
}
Program: 119850
Project: 119850
Buggy source:
/** 
 * Create the child node of the input node
 * @param node
 */
private boolean createChildNode(HL7TreeNode node){
  if (node.getColumn() != null) {
    if (!MessageDialog.openConfirm(xmlViewer.getControl().getShell(),"String_Node_Str","String_Node_Str" + node.getLabel() + "String_Node_Str")) {
      return false;
    }
    node.setColumn(null);
  }
  String label="String_Node_Str";
  final String nodeLabel=node.getLabel() + "String_Node_Str";
  while (!StringUtil.validateLabelForXML(label)) {
    InputDialog dialog=new InputDialog(null,"String_Node_Str","String_Node_Str",nodeLabel,null){
      @Override protected void okPressed(){
        String eleName=this.getValue();
        super.okPressed();
      }
    }
;
    dialog.setErrorMessage("String_Node_Str");
    int status=dialog.open();
    if (status == InputDialog.OK) {
      label=dialog.getValue().trim();
    }
    if (status == InputDialog.CANCEL) {
      return false;
    }
  }
  HL7TreeNode child=new Element(label);
  child.setRow(node.getRow());
  node.addChild(child);
  this.xmlViewer.refresh();
  this.xmlViewer.expandAll();
  return true;
}

Fixed version (ground truth):
/** 
 * Create the child node of the input node
 * @param node
 */
private boolean createChildNode(HL7TreeNode node){
  if (node.getColumn() != null) {
    if (!MessageDialog.openConfirm(xmlViewer.getControl().getShell(),"String_Node_Str","String_Node_Str" + node.getLabel() + "String_Node_Str")) {
      return false;
    }
    node.setColumn(null);
  }
  String label="String_Node_Str";
  final String nodeLabel=node.getLabel() + "String_Node_Str";
  while (!StringUtil.validateLabelForXML(label)) {
    InputDialog dialog=new InputDialog(null,"String_Node_Str","String_Node_Str",nodeLabel,null){
      @Override protected void okPressed(){
        String eleName=this.getValue();
        super.okPressed();
      }
    }
;
    dialog.setErrorMessage("String_Node_Str");
    int status=dialog.open();
    if (status == InputDialog.OK) {
      label=dialog.getValue().trim();
    }
    if (status == InputDialog.CANCEL) {
      return false;
    }
  }
  HL7TreeNode child=new Element(label);
  if (node.getRow() == null || node.getRow().equals("String_Node_Str")) {
    if (hl7ui != null && hl7ui.gethl7Manager() instanceof HL7OutputManager) {
      child.setRow(((HL7OutputManager)hl7ui.gethl7Manager()).getCurrentSchema(false));
    }
  }
 else {
    child.setRow(node.getRow());
  }
  node.addChild(child);
  this.xmlViewer.refresh();
  this.xmlViewer.expandAll();
  return true;
}
Program: 119852
Project: 119852
Buggy source:
public boolean isEnabled(DropTargetEvent event){
  HL7Manager manager=getManager();
  if (manager != null && manager instanceof HL7OutputManager) {
    String currentSchema=((HL7OutputManager)manager).getCurrentSchema(true);
    if (currentSchema != null) {
      Item targetItem=(Item)event.item;
      if (targetItem != null) {
        Object data=targetItem.getData();
        if (data instanceof HL7TreeNode) {
          HL7TreeNode rootElement=getRootElement((HL7TreeNode)data);
          if (rootElement != null) {
            return currentSchema.equals(rootElement.getRow());
          }
        }
      }
    }
  }
  return true;
}

Fixed version (ground truth):
public boolean isEnabled(DropTargetEvent event){
  HL7Manager manager=getManager();
  if (manager != null && manager instanceof HL7OutputManager) {
    String currentSchema=((HL7OutputManager)manager).getCurrentSchema(true);
    if (currentSchema != null) {
      Item targetItem=(Item)event.item;
      if (targetItem != null) {
        Object data=targetItem.getData();
        if (data != null && data instanceof HL7TreeNode) {
          HL7TreeNode treeNode=((HL7TreeNode)data);
          if (treeNode.getParent() == null) {
            MessageDialog.openConfirm(event.display.getActiveShell(),"String_Node_Str","String_Node_Str" + treeNode.getLabel() + "String_Node_Str"+ "String_Node_Str");
            return false;
          }
          String columnLabel=treeNode.getRow();
          return columnLabel != null ? columnLabel.startsWith(currentSchema) : false;
        }
      }
    }
  }
  return true;
}
Program: 119853
Project: 119853
Buggy source:
private void loadProjectParameters(ProcessType processType){
  ParametersType parameters=processType.getParameters();
  if (parameters != null) {
    loadElementParameters(this,parameters.getElementParameter());
    loadRoutinesParameters(processType);
  }
}

Fixed version (ground truth):
private void loadProjectParameters(ProcessType processType){
  ParametersType parameters=processType.getParameters();
  if (parameters != null) {
    loadElementParameters(this,parameters.getElementParameter());
    updateProSetingParameters(parameters.getElementParameter());
    loadRoutinesParameters(processType);
  }
}
Program: 119855
Project: 119855
Buggy source:
public void mouseDown(MouseEvent e){
  if (inUseProjectSettingMode(elem,section,EParameterName.STATANDLOG_USE_PROJECT_SETTINGS) || inUseProjectSettingMode(elem,section,EParameterName.IMPLICITCONTEXT_USE_PROJECT_SETTINGS)) {
    UseProjectSettingDialog modelSelect=new UseProjectSettingDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
    if (modelSelect.open() == UseProjectSettingDialog.OK) {
      if (modelSelect.getOptionValue().equals("String_Node_Str")) {
        useProjectSetting.setSelection(false);
        useProjectSettingButtonClick();
      }
      if (modelSelect.getOptionValue().equals("String_Node_Str")) {
        useProjectSetting.setSelection(true);
        useProjectSettingButtonClick();
        ProjectSettingDialog dialog=new ProjectSettingDialog();
        dialog.open();
      }
    }
  }
}

Fixed version (ground truth):
@Override public void mouseDown(MouseEvent e){
  if (inUseProjectSettingMode(elem,section,EParameterName.STATANDLOG_USE_PROJECT_SETTINGS) || inUseProjectSettingMode(elem,section,EParameterName.IMPLICITCONTEXT_USE_PROJECT_SETTINGS)) {
    UseProjectSettingDialog modelSelect=new UseProjectSettingDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
    if (modelSelect.open() == UseProjectSettingDialog.OK) {
      if (modelSelect.getOptionValue().equals("String_Node_Str")) {
        useProjectSetting.setSelection(false);
        useProjectSettingButtonClick();
      }
      if (modelSelect.getOptionValue().equals("String_Node_Str")) {
        useProjectSetting.setSelection(true);
        useProjectSettingButtonClick();
        ProjectSettingDialog dialog=new ProjectSettingDialog();
        dialog.open();
      }
    }
  }
}
Program: 119857
Project: 119857
Buggy source:
public void widgetDefaultSelected(SelectionEvent e){
}

Fixed version (ground truth):
@Override public void widgetDefaultSelected(SelectionEvent e){
}
Program: 119860
Project: 119860
Buggy source:
/** 
 * DOC aimingchen Comment method "setMainCompositeEnable".
 * @param enabled
 */
protected void setMainCompositeEnable(boolean enabled){
  Control[] controls=getComposite().getChildren();
  for (int i=0; i < controls.length; i++) {
    Control control=controls[i];
    if (control != topComposite) {
      if (control instanceof Composite) {
        if (control instanceof CCombo) {
          setTextEnable(control,enabled,enabled);
        }
        setEditable((Composite)control,enabled);
      }
 else {
        setTextEnable(control,enabled,enabled);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * DOC aimingchen Comment method "setMainCompositeEnable".
 * @param enabled
 */
protected void setMainCompositeEnable(boolean enabled){
  Control[] controls=getComposite().getChildren();
  for (  Control control : controls) {
    if (control != topComposite) {
      if (control instanceof Composite) {
        if (control instanceof CCombo) {
          setTextEnable(control,enabled,enabled);
        }
        setEditable((Composite)control,enabled);
      }
 else {
        setTextEnable(control,enabled,enabled);
      }
    }
  }
}
Program: 119861
Project: 119861
Buggy source:
@Override protected void okPressed(){
  if (noUseProjectSettingsButton.getSelection())   setOptionValue("String_Node_Str");
  if (updateProjectSettingsButton.getSelection())   setOptionValue("String_Node_Str");
  super.okPressed();
}

Fixed version (ground truth):
@Override protected void okPressed(){
  if (noUseProjectSettingsButton.getSelection()) {
    setOptionValue("String_Node_Str");
  }
  if (updateProjectSettingsButton.getSelection()) {
    setOptionValue("String_Node_Str");
  }
  super.okPressed();
}
Program: 119862
Project: 119862
Buggy source:
private void setEditable(Composite parent,boolean editable){
  Control[] children=parent.getChildren();
  for (int i=0; i < children.length; i++) {
    if (children[i] instanceof Composite) {
      if (children[i] instanceof CCombo) {
        setTextEnable(children[i],editable,editable);
      }
      setEditable((Composite)children[i],editable);
    }
 else     if (children[i] instanceof Button) {
      setTextEnable(children[i],editable,editable);
    }
 else {
      setTextEnable(children[i],editable,true);
    }
  }
}

Fixed version (ground truth):
private void setEditable(Composite parent,boolean editable){
  Control[] children=parent.getChildren();
  for (  Control element : children) {
    if (element instanceof Composite) {
      if (element instanceof CCombo) {
        setTextEnable(element,editable,editable);
      }
      setEditable((Composite)element,editable);
    }
 else     if (element instanceof Button) {
      setTextEnable(element,editable,editable);
    }
 else {
      setTextEnable(element,editable,true);
    }
  }
}
Program: 119863
Project: 119863
Buggy source:
@Override public void addComponents(boolean forceRedraw,boolean reInitialize,int height){
  super.addComponents(forceRedraw,reInitialize,height);
  Object value=ElementParameter2ParameterType.getParameterValue(elem,EParameterName.STATANDLOG_USE_PROJECT_SETTINGS.getName());
  if (value != null && value instanceof Boolean) {
    Boolean v=(Boolean)value;
    useProjectSetting.setSelection(v.booleanValue());
    setMainCompositeEnable(!v.booleanValue());
    topComposite.setEnabled(true);
    if (v.booleanValue()) {
      if (elem == null) {
        return;
      }
      ProjectSettingManager.reloadStatsAndLogFromProjectSettings(elem,ProjectManager.getInstance().getCurrentProject(),StatsAndLogsComposite.this);
      refresh();
    }
  }
  if (useProjectSetting != null) {
    useProjectSetting.removeSelectionListener(selectionListener);
    useProjectSetting.addSelectionListener(selectionListener);
  }
}

Fixed version (ground truth):
@Override public void addComponents(boolean forceRedraw,boolean reInitialize,int height){
  super.addComponents(forceRedraw,reInitialize,height);
  Object value=ElementParameter2ParameterType.getParameterValue(elem,EParameterName.STATANDLOG_USE_PROJECT_SETTINGS.getName());
  if (value != null && value instanceof Boolean) {
    Boolean v=(Boolean)value;
    setMainCompositeEnable(!v.booleanValue());
  }
}
Program: 119865
Project: 119865
Buggy source:
/** 
 * Create the child node of the input node
 * @param node
 */
private boolean createChildNode(HL7TreeNode node){
  if (node.getColumn() != null) {
    if (!MessageDialog.openConfirm(xmlViewer.getControl().getShell(),"String_Node_Str","String_Node_Str" + node.getLabel() + "String_Node_Str")) {
      return false;
    }
    node.setColumn(null);
  }
  String label="String_Node_Str";
  final String nodeLabel=node.getLabel() + "String_Node_Str";
  while (!StringUtil.validateLabelForXML(label)) {
    InputDialog dialog=new InputDialog(null,"String_Node_Str","String_Node_Str",nodeLabel,null){
      @Override protected void okPressed(){
        String eleName=this.getValue();
        super.okPressed();
      }
    }
;
    dialog.setErrorMessage("String_Node_Str");
    int status=dialog.open();
    if (status == InputDialog.OK) {
      label=dialog.getValue().trim();
    }
    if (status == InputDialog.CANCEL) {
      return false;
    }
  }
  HL7TreeNode child=new Element(label);
  child.setRow(node.getRow());
  node.addChild(child);
  this.xmlViewer.refresh();
  this.xmlViewer.expandAll();
  return true;
}

Fixed version (ground truth):
/** 
 * Create the child node of the input node
 * @param node
 */
private boolean createChildNode(HL7TreeNode node){
  if (node.getColumn() != null) {
    if (!MessageDialog.openConfirm(xmlViewer.getControl().getShell(),"String_Node_Str","String_Node_Str" + node.getLabel() + "String_Node_Str")) {
      return false;
    }
    node.setColumn(null);
  }
  String label="String_Node_Str";
  final String nodeLabel=node.getLabel() + "String_Node_Str";
  while (!StringUtil.validateLabelForXML(label)) {
    InputDialog dialog=new InputDialog(null,"String_Node_Str","String_Node_Str",nodeLabel,null){
      @Override protected void okPressed(){
        String eleName=this.getValue();
        super.okPressed();
      }
    }
;
    dialog.setErrorMessage("String_Node_Str");
    int status=dialog.open();
    if (status == InputDialog.OK) {
      label=dialog.getValue().trim();
    }
    if (status == InputDialog.CANCEL) {
      return false;
    }
  }
  HL7TreeNode child=new Element(label);
  if (node.getRow() == null || node.getRow().equals("String_Node_Str")) {
    if (hl7ui != null && hl7ui.gethl7Manager() instanceof HL7OutputManager) {
      child.setRow(((HL7OutputManager)hl7ui.gethl7Manager()).getCurrentSchema(false));
    }
  }
 else {
    child.setRow(node.getRow());
  }
  node.addChild(child);
  this.xmlViewer.refresh();
  this.xmlViewer.expandAll();
  return true;
}
Program: 119867
Project: 119867
Buggy source:
public boolean isEnabled(DropTargetEvent event){
  HL7Manager manager=getManager();
  if (manager != null && manager instanceof HL7OutputManager) {
    String currentSchema=((HL7OutputManager)manager).getCurrentSchema(true);
    if (currentSchema != null) {
      Item targetItem=(Item)event.item;
      if (targetItem != null) {
        Object data=targetItem.getData();
        if (data instanceof HL7TreeNode) {
          HL7TreeNode rootElement=getRootElement((HL7TreeNode)data);
          if (rootElement != null) {
            return currentSchema.equals(rootElement.getRow());
          }
        }
      }
    }
  }
  return true;
}

Fixed version (ground truth):
public boolean isEnabled(DropTargetEvent event){
  HL7Manager manager=getManager();
  if (manager != null && manager instanceof HL7OutputManager) {
    String currentSchema=((HL7OutputManager)manager).getCurrentSchema(true);
    if (currentSchema != null) {
      Item targetItem=(Item)event.item;
      if (targetItem != null) {
        Object data=targetItem.getData();
        if (data != null && data instanceof HL7TreeNode) {
          HL7TreeNode treeNode=((HL7TreeNode)data);
          if (treeNode.getParent() == null) {
            MessageDialog.openConfirm(event.display.getActiveShell(),"String_Node_Str","String_Node_Str" + treeNode.getLabel() + "String_Node_Str"+ "String_Node_Str");
            return false;
          }
          String columnLabel=treeNode.getRow();
          return columnLabel != null ? columnLabel.startsWith(currentSchema) : false;
        }
      }
    }
  }
  return true;
}
Program: 119868
Project: 119868
Buggy source:
private void setTreeNodeRow(HL7TreeNode root,String row){
  if (root == null)   return;
  root.setRow(row);
  if (root instanceof Element) {
    Element element=(Element)root;
    List<HL7TreeNode> children=element.getElementChildren();
    for (    HL7TreeNode child : children) {
      setTreeNodeRow(child,row);
    }
    children=element.getNameSpaceChildren();
    for (    HL7TreeNode child : children) {
      setTreeNodeRow(child,row);
    }
  }
  List<HL7TreeNode> children=root.getChildren();
  for (  HL7TreeNode child : children) {
    setTreeNodeRow(child,row);
  }
}

Fixed version (ground truth):
private void setTreeNodeRow(HL7TreeNode root,String row){
  if (root == null) {
    return;
  }
  root.setRow(row);
  if (root instanceof Element) {
    Element element=(Element)root;
    List<HL7TreeNode> children=element.getElementChildren();
    for (    HL7TreeNode child : children) {
      setTreeNodeRow(child,row);
    }
    children=element.getNameSpaceChildren();
    for (    HL7TreeNode child : children) {
      setTreeNodeRow(child,row);
    }
  }
  List<HL7TreeNode> children=root.getChildren();
  for (  HL7TreeNode child : children) {
    setTreeNodeRow(child,row);
  }
}
Program: 119872
Project: 119872
Buggy source:
private void loadProjectParameters(ProcessType processType){
  ParametersType parameters=processType.getParameters();
  if (parameters != null) {
    loadElementParameters(this,parameters.getElementParameter());
    loadRoutinesParameters(processType);
  }
}

Fixed version (ground truth):
private void loadProjectParameters(ProcessType processType){
  ParametersType parameters=processType.getParameters();
  if (parameters != null) {
    loadElementParameters(this,parameters.getElementParameter());
    updateProSetingParameters(parameters.getElementParameter());
    loadRoutinesParameters(processType);
  }
}
Program: 119874
Project: 119874
Buggy source:
@Override public void addComponents(boolean forceRedraw,boolean reInitialize,int height){
  super.addComponents(forceRedraw,reInitialize,height);
  Object value=ElementParameter2ParameterType.getParameterValue(elem,EParameterName.STATANDLOG_USE_PROJECT_SETTINGS.getName());
  if (value != null && value instanceof Boolean) {
    Boolean v=(Boolean)value;
    useProjectSetting.setSelection(v.booleanValue());
    setMainCompositeEnable(!v.booleanValue());
    topComposite.setEnabled(true);
    if (v.booleanValue()) {
      if (elem == null) {
        return;
      }
      ProjectSettingManager.reloadStatsAndLogFromProjectSettings(elem,ProjectManager.getInstance().getCurrentProject(),StatsAndLogsComposite.this);
      refresh();
    }
  }
  if (useProjectSetting != null) {
    useProjectSetting.removeSelectionListener(selectionListener);
    useProjectSetting.addSelectionListener(selectionListener);
  }
}

Fixed version (ground truth):
@Override public void addComponents(boolean forceRedraw,boolean reInitialize,int height){
  super.addComponents(forceRedraw,reInitialize,height);
  Object value=ElementParameter2ParameterType.getParameterValue(elem,EParameterName.STATANDLOG_USE_PROJECT_SETTINGS.getName());
  if (value != null && value instanceof Boolean) {
    Boolean v=(Boolean)value;
    setMainCompositeEnable(!v.booleanValue());
  }
}
Program: 119879
Project: 119879
Buggy source:
@Override public boolean performCancel(){
  resetCustomComponentSetting();
  refreshViewer();
  return super.performCancel();
}

Fixed version (ground truth):
@Override public boolean performCancel(){
  if (componentViewer != null) {
    resetCustomComponentSetting();
  }
  return super.performCancel();
}
Program: 119884
Project: 119884
Buggy source:
private void generateDriverName(){
  if (EDatabaseTypeName.HIVE.getDisplayName().equals(dbType)) {
    if (url.startsWith(DatabaseConnConstants.HIVE_2_URL_FORMAT)) {
      driverClassName=EDatabase4DriverClassName.HIVE2.getDriverClass();
    }
 else {
      driverClassName=EDatabase4DriverClassName.HIVE.getDriverClass();
    }
  }
  driverClassName=ExtractMetaDataUtils.getInstance().getDriverClassByDbType(dbType);
}

Fixed version (ground truth):
private void generateDriverName(){
  if (EDatabaseTypeName.HIVE.getDisplayName().equals(dbType)) {
    if (url.startsWith(DatabaseConnConstants.HIVE_2_URL_FORMAT)) {
      driverClassName=EDatabase4DriverClassName.HIVE2.getDriverClass();
    }
 else {
      driverClassName=EDatabase4DriverClassName.HIVE.getDriverClass();
    }
  }
  driverClassName=ExtractMetaDataUtils.getInstance().getDriverClassByDbType(dbType);
  if (dbType.equals(EDatabaseTypeName.VERTICA.getXmlName())) {
    if (EDatabaseVersion4Drivers.VERTICA_6.getVersionValue().equals(dbVersion) || EDatabaseVersion4Drivers.VERTICA_5_1.getVersionValue().equals(dbVersion) || EDatabaseVersion4Drivers.VERTICA_6_1_X.getVersionValue().equals(dbVersion)) {
      driverClassName=EDatabase4DriverClassName.VERTICA2.getDriverClass();
    }
  }
}
Program: 119886
Project: 119886
Buggy source:
@Override public PastePushButton createPastePushButton(){
  PastePushButton pastePushButton=new PastePushButtonForExtendedTable(toolbar,extendedTableViewer){
    @Override public boolean getEnabledState(){
      return super.getEnabledState() && (model == null || !model.getElemParameter().isBasedOnSubjobStarts());
    }
    @Override protected Command getCommandToExecute(    ExtendedTableModel extendedTableModel,    Integer indexWhereInsert){
      return new PropertyTablePasteCommand<Map<String,Object>>(extendedTableModel,indexWhereInsert);
    }
  }
;
  pastePushButton.addListener(getPropertyChangeListener(),false);
  return pastePushButton;
}

Fixed version (ground truth):
@Override public PastePushButton createPastePushButton(){
  PastePushButton pastePushButton=new PastePushButtonForExtendedTable(toolbar,extendedTableViewer){
    @Override public boolean getEnabledState(){
      Object data=SimpleClipboard.getInstance().getData();
      if (data == null || !(data instanceof List)) {
        return false;
      }
      @SuppressWarnings("String_Node_Str") List dataList=(List)data;
      boolean sameNumberOfParamAssSourceTable=true;
      if ((!dataList.isEmpty()) && (dataList.get(0) instanceof IMetadataColumn)) {
        return false;
      }
      int a=dataList.size();
      int colNum=getExtendedTableViewer().getTableViewerCreator().getTable().getColumnCount() - 1;
      if (data != null) {
        if (colNum == a) {
          sameNumberOfParamAssSourceTable=true;
        }
 else {
          sameNumberOfParamAssSourceTable=false;
        }
      }
      return super.getEnabledState() && (model == null || !model.getElemParameter().isBasedOnSubjobStarts()) && sameNumberOfParamAssSourceTable;
    }
    @Override protected Command getCommandToExecute(    ExtendedTableModel extendedTableModel,    Integer indexWhereInsert){
      return new PropertyTablePasteCommand<Map<String,Object>>(extendedTableModel,indexWhereInsert);
    }
  }
;
  pastePushButton.addListener(getPropertyChangeListener(),false);
  return pastePushButton;
}
Program: 119887
Project: 119887
Buggy source:
@Override public boolean performCancel(){
  resetCustomComponentSetting();
  refreshViewer();
  return super.performCancel();
}

Fixed version (ground truth):
@Override public boolean performCancel(){
  if (componentViewer != null) {
    resetCustomComponentSetting();
  }
  return super.performCancel();
}
Program: 119888
Project: 119888
Buggy source:
@Override public void run(){
  IStructuredSelection selection=(IStructuredSelection)selectionProvider.getSelection();
  RepositoryNode firstNode=(RepositoryNode)selection.getFirstElement();
  if (firstNode.getProperties(EProperties.CONTENT_TYPE) == RepositoryNodeType.FOLDER) {
    firstNode=repositoryNodeManager.getRepositoryNodebyName(connParam.getRepositoryName());
  }
  List<String> repositoryNames=repositoryNodeManager.getALLReposotoryNodeNames();
  IRepositoryViewObject object=SQLBuilderRepositoryNodeManager.getRoot(firstNode).getObject();
  connParam.setRepositoryName(object.getLabel());
  connParam.setRepositoryId(object.getId());
  if (!connParam.isFirstOpenSqlBuilder()) {
    connParam.setQuery("String_Node_Str");
  }
  connParam.setFirstOpenSqlBuilder(false);
  if (isQuery) {
    DBTreeProvider provider=(DBTreeProvider)selectionProvider.getContentProvider();
    selectReveal(provider.getSelectedExtReposiotryNode());
    isQuery=false;
  }
 else {
    connParam.setEditorTitle(TextUtil.getNewQueryLabel());
  }
  dialog.openEditor(firstNode,repositoryNames,connParam,false);
}

Fixed version (ground truth):
@Override public void run(){
  IStructuredSelection selection=(IStructuredSelection)selectionProvider.getSelection();
  RepositoryNode firstNode=(RepositoryNode)selection.getFirstElement();
  if (firstNode.getProperties(EProperties.CONTENT_TYPE) == RepositoryNodeType.FOLDER) {
    firstNode=repositoryNodeManager.getRepositoryNodebyName(connParam.getRepositoryName());
  }
  List<String> repositoryNames=repositoryNodeManager.getALLReposotoryNodeNames();
  IRepositoryViewObject object=SQLBuilderRepositoryNodeManager.getRoot(firstNode).getObject();
  connParam.setRepositoryName(object.getLabel());
  connParam.setRepositoryId(object.getId());
  connParam.setFirstOpenSqlBuilder(false);
  if (isQuery) {
    DBTreeProvider provider=(DBTreeProvider)selectionProvider.getContentProvider();
    selectReveal(provider.getSelectedExtReposiotryNode());
    isQuery=false;
  }
 else {
    connParam.setEditorTitle(TextUtil.getNewQueryLabel());
  }
  dialog.openEditor(firstNode,repositoryNames,connParam,false);
}
Program: 119889
Project: 119889
Buggy source:
@Override public void run(){
  IStructuredSelection selection=(IStructuredSelection)selectionProvider.getSelection();
  RepositoryNode firstNode=(RepositoryNode)selection.getFirstElement();
  if (firstNode.getProperties(EProperties.CONTENT_TYPE) == RepositoryNodeType.FOLDER) {
    firstNode=repositoryNodeManager.getRepositoryNodebyName(connParam.getRepositoryName());
  }
  List<String> repositoryNames=repositoryNodeManager.getALLReposotoryNodeNames();
  IRepositoryViewObject object=SQLBuilderRepositoryNodeManager.getRoot(firstNode).getObject();
  connParam.setRepositoryName(object.getLabel());
  connParam.setRepositoryId(object.getId());
  if (!connParam.isFirstOpenSqlBuilder()) {
    connParam.setQuery("String_Node_Str");
  }
  connParam.setFirstOpenSqlBuilder(false);
  if (isQuery) {
    DBTreeProvider provider=(DBTreeProvider)selectionProvider.getContentProvider();
    selectReveal(provider.getSelectedExtReposiotryNode());
    isQuery=false;
  }
 else {
    connParam.setEditorTitle(TextUtil.getNewQueryLabel());
  }
  dialog.openEditor(firstNode,repositoryNames,connParam,false);
}

Fixed version (ground truth):
@Override public void run(){
  IStructuredSelection selection=(IStructuredSelection)selectionProvider.getSelection();
  RepositoryNode firstNode=(RepositoryNode)selection.getFirstElement();
  if (firstNode.getProperties(EProperties.CONTENT_TYPE) == RepositoryNodeType.FOLDER) {
    firstNode=repositoryNodeManager.getRepositoryNodebyName(connParam.getRepositoryName());
  }
  List<String> repositoryNames=repositoryNodeManager.getALLReposotoryNodeNames();
  IRepositoryViewObject object=SQLBuilderRepositoryNodeManager.getRoot(firstNode).getObject();
  connParam.setRepositoryName(object.getLabel());
  connParam.setRepositoryId(object.getId());
  connParam.setFirstOpenSqlBuilder(false);
  if (isQuery) {
    DBTreeProvider provider=(DBTreeProvider)selectionProvider.getContentProvider();
    selectReveal(provider.getSelectedExtReposiotryNode());
    isQuery=false;
  }
 else {
    connParam.setEditorTitle(TextUtil.getNewQueryLabel());
  }
  dialog.openEditor(firstNode,repositoryNames,connParam,false);
}
Program: 119890
Project: 119890
Buggy source:
@Override public void run(){
  IStructuredSelection selection=(IStructuredSelection)selectionProvider.getSelection();
  RepositoryNode firstNode=(RepositoryNode)selection.getFirstElement();
  if (firstNode.getProperties(EProperties.CONTENT_TYPE) == RepositoryNodeType.FOLDER) {
    firstNode=repositoryNodeManager.getRepositoryNodebyName(connParam.getRepositoryName());
  }
  List<String> repositoryNames=repositoryNodeManager.getALLReposotoryNodeNames();
  IRepositoryViewObject object=SQLBuilderRepositoryNodeManager.getRoot(firstNode).getObject();
  connParam.setRepositoryName(object.getLabel());
  connParam.setRepositoryId(object.getId());
  if (!connParam.isFirstOpenSqlBuilder()) {
    connParam.setQuery("String_Node_Str");
  }
  connParam.setFirstOpenSqlBuilder(false);
  if (isQuery) {
    DBTreeProvider provider=(DBTreeProvider)selectionProvider.getContentProvider();
    selectReveal(provider.getSelectedExtReposiotryNode());
    isQuery=false;
  }
 else {
    connParam.setEditorTitle(TextUtil.getNewQueryLabel());
  }
  dialog.openEditor(firstNode,repositoryNames,connParam,false);
}

Fixed version (ground truth):
@Override public void run(){
  IStructuredSelection selection=(IStructuredSelection)selectionProvider.getSelection();
  RepositoryNode firstNode=(RepositoryNode)selection.getFirstElement();
  if (firstNode.getProperties(EProperties.CONTENT_TYPE) == RepositoryNodeType.FOLDER) {
    firstNode=repositoryNodeManager.getRepositoryNodebyName(connParam.getRepositoryName());
  }
  List<String> repositoryNames=repositoryNodeManager.getALLReposotoryNodeNames();
  IRepositoryViewObject object=SQLBuilderRepositoryNodeManager.getRoot(firstNode).getObject();
  connParam.setRepositoryName(object.getLabel());
  connParam.setRepositoryId(object.getId());
  connParam.setFirstOpenSqlBuilder(false);
  if (isQuery) {
    DBTreeProvider provider=(DBTreeProvider)selectionProvider.getContentProvider();
    selectReveal(provider.getSelectedExtReposiotryNode());
    isQuery=false;
  }
 else {
    connParam.setEditorTitle(TextUtil.getNewQueryLabel());
  }
  dialog.openEditor(firstNode,repositoryNames,connParam,false);
}
Program: 119893
Project: 119893
Buggy source:
private void generateDriverName(){
  if (EDatabaseTypeName.HIVE.getDisplayName().equals(dbType)) {
    if (url.startsWith(DatabaseConnConstants.HIVE_2_URL_FORMAT)) {
      driverClassName=EDatabase4DriverClassName.HIVE2.getDriverClass();
    }
 else {
      driverClassName=EDatabase4DriverClassName.HIVE.getDriverClass();
    }
  }
  driverClassName=ExtractMetaDataUtils.getInstance().getDriverClassByDbType(dbType);
}

Fixed version (ground truth):
private void generateDriverName(){
  if (EDatabaseTypeName.HIVE.getDisplayName().equals(dbType)) {
    if (url.startsWith(DatabaseConnConstants.HIVE_2_URL_FORMAT)) {
      driverClassName=EDatabase4DriverClassName.HIVE2.getDriverClass();
    }
 else {
      driverClassName=EDatabase4DriverClassName.HIVE.getDriverClass();
    }
  }
  driverClassName=ExtractMetaDataUtils.getInstance().getDriverClassByDbType(dbType);
  if (dbType.equals(EDatabaseTypeName.VERTICA.getXmlName())) {
    if (EDatabaseVersion4Drivers.VERTICA_6.getVersionValue().equals(dbVersion) || EDatabaseVersion4Drivers.VERTICA_5_1.getVersionValue().equals(dbVersion) || EDatabaseVersion4Drivers.VERTICA_6_1_X.getVersionValue().equals(dbVersion)) {
      driverClassName=EDatabase4DriverClassName.VERTICA2.getDriverClass();
    }
  }
}
Program: 119895
Project: 119895
Buggy source:
public SaveAsProcessWizard(EditorPart editorPart){
  this.jobEditorInput=(JobEditorInput)editorPart.getEditorInput();
  RepositoryNode repositoryNode=jobEditorInput.getRepositoryNode();
  if (repositoryNode == null) {
    repositoryNode=(RepositoryNode)CorePlugin.getDefault().getRepositoryService().getRepositoryNode(jobEditorInput.getItem().getProperty().getId(),false);
  }
  IRepositoryService service=DesignerPlugin.getDefault().getRepositoryService();
  this.path=service.getRepositoryPath((RepositoryNode)repositoryNode);
  this.oldProcessItem=(ProcessItem)jobEditorInput.getItem();
  oldProperty=this.oldProcessItem.getProperty();
  this.property=PropertiesFactory.eINSTANCE.createProperty();
  assginVlaues(this.property,oldProperty);
  processItem=PropertiesFactory.eINSTANCE.createProcessItem();
  processItem.setProperty(property);
  repositoryFactory=service.getProxyRepositoryFactory();
  setDefaultPageImageDescriptor(ImageProvider.getImageDesc(ECoreImage.PROCESS_WIZ));
}

Fixed version (ground truth):
public SaveAsProcessWizard(EditorPart editorPart){
  this.jobEditorInput=(JobEditorInput)editorPart.getEditorInput();
  RepositoryNode repositoryNode=jobEditorInput.getRepositoryNode();
  if (repositoryNode == null) {
    repositoryNode=(RepositoryNode)CorePlugin.getDefault().getRepositoryService().getRepositoryNode(jobEditorInput.getItem().getProperty().getId(),false);
  }
  IRepositoryService service=DesignerPlugin.getDefault().getRepositoryService();
  this.path=service.getRepositoryPath(repositoryNode);
  this.oldProcessItem=(ProcessItem)jobEditorInput.getItem();
  oldProperty=this.oldProcessItem.getProperty();
  this.property=PropertiesFactory.eINSTANCE.createProperty();
  assginVlaues(this.property,oldProperty);
  processItem=PropertiesFactory.eINSTANCE.createProcessItem();
  processItem.setProperty(property);
  repositoryFactory=service.getProxyRepositoryFactory();
  setDefaultPageImageDescriptor(ImageProvider.getImageDesc(ECoreImage.PROCESS_WIZ));
}
Program: 119896
Project: 119896
Buggy source:
public void addPages(){
  mainPage=new NewProcessWizardPage(property,path);
  mainPage.initializeSaveAs(oldProperty.getLabel(),oldProperty.getVersion(),true);
  mainPage.setTitle("String_Node_Str");
  mainPage.setDescription("String_Node_Str");
  addPage(mainPage);
  setWindowTitle("String_Node_Str");
}

Fixed version (ground truth):
@Override public void addPages(){
  mainPage=new NewProcessWizardPage(property,path);
  mainPage.initializeSaveAs(oldProperty.getLabel(),oldProperty.getVersion(),true);
  mainPage.setTitle("String_Node_Str");
  mainPage.setDescription("String_Node_Str");
  addPage(mainPage);
  setWindowTitle("String_Node_Str");
}
Program: 119897
Project: 119897
Buggy source:
private void update(final ProcessType processType){
  IWorkspaceRunnable runnable=new IWorkspaceRunnable(){
    @Override public void run(    final IProgressMonitor monitor) throws CoreException {
      try {
        oldProcessItem.setProcess(processType);
        assginVlaues(oldProperty,property);
        repositoryFactory.save(oldProcessItem);
        processItem=oldProcessItem;
      }
 catch (      PersistenceException pe) {
        throw new CoreException(new Status(IStatus.ERROR,FrameworkUtil.getBundle(this.getClass()).getSymbolicName(),"String_Node_Str",pe));
      }
    }
  }
;
  IWorkspace workspace=ResourcesPlugin.getWorkspace();
  try {
    ISchedulingRule schedulingRule=workspace.getRoot();
    workspace.run(runnable,schedulingRule,IWorkspace.AVOID_UPDATE,null);
  }
 catch (  CoreException e) {
    MessageBoxExceptionHandler.process(e.getCause());
  }
}

Fixed version (ground truth):
private void update(final ProcessType processType){
  RepositoryWorkUnit<Object> rwu=new RepositoryWorkUnit<Object>("String_Node_Str"){
    @Override protected void run() throws LoginException, PersistenceException {
      IWorkspaceRunnable runnable=new IWorkspaceRunnable(){
        @Override public void run(        final IProgressMonitor monitor) throws CoreException {
          try {
            oldProcessItem.setProcess(processType);
            assginVlaues(oldProperty,property);
            repositoryFactory.save(oldProcessItem);
            processItem=oldProcessItem;
          }
 catch (          PersistenceException pe) {
            throw new CoreException(new Status(IStatus.ERROR,FrameworkUtil.getBundle(this.getClass()).getSymbolicName(),"String_Node_Str",pe));
          }
        }
      }
;
      IWorkspace workspace=ResourcesPlugin.getWorkspace();
      try {
        ISchedulingRule schedulingRule=workspace.getRoot();
        workspace.run(runnable,schedulingRule,IWorkspace.AVOID_UPDATE,null);
      }
 catch (      CoreException e) {
        MessageBoxExceptionHandler.process(e.getCause());
      }
    }
  }
;
  rwu.setAvoidUnloadResources(true);
  rwu.setAvoidSvnUpdate(true);
  repositoryFactory.executeRepositoryWorkUnit(rwu);
}
Program: 119898
Project: 119898
Buggy source:
public boolean performFinish(){
  boolean ok=false;
  try {
    IProcess2 loadedProcess=jobEditorInput.getLoadedProcess();
    ProcessType processType=loadedProcess.saveXmlFile();
    isUpdate=isUpdate();
    if (isUpdate) {
      update(processType);
    }
 else {
      processItem.setProcess(processType);
      property.setId(repositoryFactory.getNextId());
      repositoryFactory.create(processItem,mainPage.getDestinationPath());
    }
    ok=true;
  }
 catch (  Exception e) {
    MessageDialog.openError(getShell(),"String_Node_Str","String_Node_Str" + "String_Node_Str" + e.getMessage());
    ExceptionHandler.process(e);
  }
  return ok;
}

Fixed version (ground truth):
@Override public boolean performFinish(){
  boolean ok=false;
  try {
    IProcess2 loadedProcess=jobEditorInput.getLoadedProcess();
    ProcessType processType=loadedProcess.saveXmlFile();
    isUpdate=isUpdate();
    if (isUpdate) {
      update(processType);
    }
 else {
      processItem.setProcess(processType);
      property.setId(repositoryFactory.getNextId());
      repositoryFactory.create(processItem,mainPage.getDestinationPath());
    }
    ok=true;
  }
 catch (  Exception e) {
    MessageDialog.openError(getShell(),"String_Node_Str","String_Node_Str" + "String_Node_Str" + e.getMessage());
    ExceptionHandler.process(e);
  }
  return ok;
}
Program: 119901
Project: 119901
Buggy source:
private void generateDriverName(){
  if (EDatabaseTypeName.HIVE.getDisplayName().equals(dbType)) {
    if (url.startsWith(DatabaseConnConstants.HIVE_2_URL_FORMAT)) {
      driverClassName=EDatabase4DriverClassName.HIVE2.getDriverClass();
    }
 else {
      driverClassName=EDatabase4DriverClassName.HIVE.getDriverClass();
    }
  }
  driverClassName=ExtractMetaDataUtils.getDriverClassByDbType(dbType);
}

Fixed version (ground truth):
private void generateDriverName(){
  if (EDatabaseTypeName.HIVE.getDisplayName().equals(dbType)) {
    if (url.startsWith(DatabaseConnConstants.HIVE_2_URL_FORMAT)) {
      driverClassName=EDatabase4DriverClassName.HIVE2.getDriverClass();
    }
 else {
      driverClassName=EDatabase4DriverClassName.HIVE.getDriverClass();
    }
  }
  driverClassName=ExtractMetaDataUtils.getDriverClassByDbType(dbType);
  if (dbType.equals(EDatabaseTypeName.VERTICA.getXmlName())) {
    if (EDatabaseVersion4Drivers.VERTICA_6.getVersionValue().equals(dbVersion)) {
      driverClassName=EDatabase4DriverClassName.VERTICA2.getDriverClass();
    }
  }
}
Program: 119905
Project: 119905
Buggy source:
protected HL7TreeNode addElement(HL7TreeNode current,String currentPath,String newPath,String defaultValue){
  String name=newPath.substring(newPath.lastIndexOf("String_Node_Str") + 1);
  String parentPath=newPath.substring(0,newPath.lastIndexOf("String_Node_Str"));
  HL7TreeNode temp=new Element(name,defaultValue);
  if (current == null) {
    return temp;
  }
  if (currentPath.equals(parentPath)) {
    current.addChild(temp);
  }
 else {
    String[] nods=currentPath.split("String_Node_Str");
    String[] newNods=parentPath.split("String_Node_Str");
    int parentLevel=0;
    int checkLength=nods.length < newNods.length ? nods.length : newNods.length;
    for (int i=1; i < checkLength; i++) {
      if (nods[i].equals(newNods[i])) {
        parentLevel=i;
      }
    }
    HL7TreeNode parent=current;
    for (int i=0; i < nods.length - (parentLevel + 1); i++) {
      HL7TreeNode tmpParent=parent.getParent();
      if (tmpParent == null) {
        break;
      }
      parent=tmpParent;
    }
    if (parent != null)     parent.addChild(temp);
  }
  return temp;
}

Fixed version (ground truth):
protected HL7TreeNode addElement(HL7TreeNode current,String currentPath,String newPath,String defaultValue,Map<String,HL7TreeNode> mapNodes){
  HL7TreeNode temp=mapNodes.get(newPath);
  if (temp == null) {
    String name=newPath.substring(newPath.lastIndexOf("String_Node_Str") + 1);
    temp=new Element(name,defaultValue);
    if (current == null) {
      mapNodes.put(newPath,temp);
      return temp;
    }
    mapNodes.put(newPath,temp);
    String parentPath=newPath.substring(0,newPath.lastIndexOf("String_Node_Str"));
    HL7TreeNode parentNode=mapNodes.get(parentPath);
    if (parentNode != null) {
      parentNode.addChild(temp);
    }
 else {
      ExceptionHandler.log("String_Node_Str" + parentPath);
    }
  }
  return temp;
}
Program: 119906
Project: 119906
Buggy source:
@Override public void run(){
  OutputTreeNode model=(OutputTreeNode)nodePart.getModel();
  OutputTreeNode outputDocumentRoot=(OutputTreeNode)XmlMapUtil.getTreeNodeRoot(model);
  if (outputDocumentRoot != null) {
    XmlMapUtil.cleanSubGroup(outputDocumentRoot);
  }
  if (!isRemove) {
    model.setGroup(true);
    if (!subGroupTraceNames.isEmpty()) {
      for (      TreeNode groupNode : subGroupTraceNames) {
        groupNode.setGroup(true);
      }
    }
  }
 else {
    model.setGroup(false);
    if (!subGroupTraceNames.isEmpty()) {
      for (      TreeNode groupNode : subGroupTraceNames) {
        groupNode.setGroup(false);
      }
    }
  }
}

Fixed version (ground truth):
@Override public void run(){
  OutputTreeNode model=(OutputTreeNode)nodePart.getModel();
  OutputTreeNode outputDocumentRoot=(OutputTreeNode)XmlMapUtil.getTreeNodeRoot(model);
  if (outputDocumentRoot != null) {
    XmlMapUtil.cleanSubGroup(outputDocumentRoot);
  }
  if (!isRemove) {
    model.setGroup(true);
    if (!subGroupTraceNames.isEmpty()) {
      for (      TreeNode groupNode : subGroupTraceNames) {
        if (groupNode.isChoice() || groupNode.isSubstitution()) {
          groupNode.setGroup(false);
        }
 else {
          groupNode.setGroup(true);
        }
      }
    }
  }
 else {
    model.setGroup(false);
    if (!subGroupTraceNames.isEmpty()) {
      for (      TreeNode groupNode : subGroupTraceNames) {
        groupNode.setGroup(false);
      }
    }
  }
}
Program: 119907
Project: 119907
Buggy source:
private void upsetGroup(TreeNode node,TreeNode rootGroup){
  if (node.eContainer() instanceof TreeNode && rootGroup != node.eContainer()) {
    TreeNode parent=(TreeNode)node.eContainer();
    if (!parent.isGroup()) {
      parent.setGroup(true);
    }
  }
}

Fixed version (ground truth):
private void upsetGroup(TreeNode node,TreeNode rootGroup){
  if (node.eContainer() instanceof TreeNode && rootGroup != node.eContainer()) {
    TreeNode parent=(TreeNode)node.eContainer();
    if (!parent.isGroup()) {
      if (parent.isChoice() || parent.isSubstitution()) {
        parent.setGroup(false);
      }
 else {
        parent.setGroup(true);
      }
    }
  }
}