nus-yam/ex-repair huggingface dataset:
Program: 96241
Project: 96241
Buggy source:
/** 
 * Tries to select the given node in the given TreeViewer.
 * @param po The po to select
 * @param tv the TreeViewer
 */
public static void selectNodeInTree(IPersistentObject po,TreeViewer tv){
  ISelection oldSelection=tv.getSelection();
  if (po != null) {
    tv.refresh();
    tv.expandToLevel(po,0);
    tv.reveal(po);
    StructuredSelection newSelection=new StructuredSelection(po);
    tv.setSelection(newSelection);
    InteractionEventDispatcher.getDefault().fireProgammableSelectionEvent(newSelection);
  }
 else {
    tv.setSelection(oldSelection);
  }
}

Fixed version (ground truth):
/** 
 * Tries to select the given node in the given TreeViewer.
 * @param o The Object to select
 * @param tv the TreeViewer
 */
public static void selectNodeInTree(Object o,AbstractTreeViewer tv){
  ISelection oldSelection=tv.getSelection();
  if (o != null) {
    tv.refresh();
    tv.expandToLevel(o,0);
    tv.reveal(o);
    StructuredSelection newSelection=new StructuredSelection(o);
    tv.setSelection(newSelection);
    InteractionEventDispatcher.getDefault().fireProgammableSelectionEvent(newSelection);
  }
 else {
    tv.setSelection(oldSelection);
  }
}
Program: 96242
Project: 96242
Buggy source:
public void run(){
  TreeViewer tv=getActiveTreeViewer();
  tv.expandToLevel(node,0);
  tv.expandToLevel(node,0);
  StructuredSelection newSel=new StructuredSelection(node);
  tv.setSelection(newSel,true);
}

Fixed version (ground truth):
public void run(){
  UINodeBP.selectNodeInTree(node,getActiveTreeViewer());
}
Program: 96243
Project: 96243
Buggy source:
/** 
 * @param queryString queryString
 * @param caseSensitive caseSensitive
 * @param useRegex useRegex
 * @param wrapSearch wrapSearch
 * @param forward forward
 * @param nodeToStart the node to start the search; may be null --> root is used as search start point
 * @param monitor the progress monitor to use to communicate progress
 * @return boolean
 */
private boolean find(String queryString,boolean caseSensitive,boolean useRegex,boolean wrapSearch,boolean forward,Object nodeToStart,IProgressMonitor monitor){
  final Object node=findGuiNode(queryString,caseSensitive,useRegex,wrapSearch,forward,nodeToStart,monitor);
  if (node != null) {
    Plugin.getDisplay().syncExec(new Runnable(){
      public void run(){
        TreeViewer tv=getActiveTreeViewer();
        tv.expandToLevel(node,0);
        tv.expandToLevel(node,0);
        StructuredSelection newSel=new StructuredSelection(node);
        tv.setSelection(newSel,true);
      }
    }
);
    return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * @param queryString queryString
 * @param caseSensitive caseSensitive
 * @param useRegex useRegex
 * @param wrapSearch wrapSearch
 * @param forward forward
 * @param nodeToStart the node to start the search; may be null --> root is used as search start point
 * @param monitor the progress monitor to use to communicate progress
 * @return boolean
 */
private boolean find(String queryString,boolean caseSensitive,boolean useRegex,boolean wrapSearch,boolean forward,Object nodeToStart,IProgressMonitor monitor){
  final Object node=findGuiNode(queryString,caseSensitive,useRegex,wrapSearch,forward,nodeToStart,monitor);
  if (node != null) {
    Plugin.getDisplay().syncExec(new Runnable(){
      public void run(){
        UINodeBP.selectNodeInTree(node,getActiveTreeViewer());
      }
    }
);
    return true;
  }
  return false;
}
Program: 96245
Project: 96245
Buggy source:
/** 
 * {@inheritDoc}
 */
public Object[] getChildren(Object parentElement){
  if (parentElement instanceof ICategoryPO) {
    return ((ICategoryPO)parentElement).getUnmodifiableNodeList().toArray();
  }
  if (parentElement instanceof IReusedProjectPO) {
    try {
      IProjectPO reusedProject=ProjectPM.loadReusedProjectInMasterSession((IReusedProjectPO)parentElement);
      if (reusedProject != null) {
        return reusedProject.getSpecObjCont().getSpecObjList().toArray();
      }
      return ArrayUtils.EMPTY_OBJECT_ARRAY;
    }
 catch (    JBException e) {
      Utils.createMessageDialog(e,null,null);
      return ArrayUtils.EMPTY_OBJECT_ARRAY;
    }
  }
  return ArrayUtils.EMPTY_OBJECT_ARRAY;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public Object[] getChildren(Object parentElement){
  if (parentElement instanceof IProjectPO) {
    IProjectPO project=(IProjectPO)parentElement;
    List<Object> elements=new ArrayList<Object>();
    elements.addAll(project.getSpecObjCont().getSpecObjList());
    elements.addAll(project.getUsedProjects());
    return elements.toArray();
  }
  if (parentElement instanceof ICategoryPO) {
    return ((ICategoryPO)parentElement).getUnmodifiableNodeList().toArray();
  }
  if (parentElement instanceof IReusedProjectPO) {
    try {
      IProjectPO reusedProject=ProjectPM.loadReusedProjectInMasterSession((IReusedProjectPO)parentElement);
      if (reusedProject != null) {
        return reusedProject.getSpecObjCont().getSpecObjList().toArray();
      }
      return ArrayUtils.EMPTY_OBJECT_ARRAY;
    }
 catch (    JBException e) {
      Utils.createMessageDialog(e,null,null);
      return ArrayUtils.EMPTY_OBJECT_ARRAY;
    }
  }
  return ArrayUtils.EMPTY_OBJECT_ARRAY;
}
Program: 96246
Project: 96246
Buggy source:
/** 
 * Renames a guiNode.
 * @param po The corresponding NodePO.
 */
protected void renameGUINode(IPersistentObject po){
  getMainTreeViewer().update(po,null);
  createPartName();
}

Fixed version (ground truth):
/** 
 * Renames a guiNode.
 * @param po The corresponding NodePO.
 */
protected void renameGUINode(IPersistentObject po){
  getMainTreeViewer().refresh(true);
  createPartName();
}
Program: 96247
Project: 96247
Buggy source:
@Override protected void renameGUINode(IPersistentObject po){
  super.renameGUINode(po);
  m_eventHandlerTreeViewer.update(po,null);
}

Fixed version (ground truth):
@Override protected void renameGUINode(IPersistentObject po){
  super.renameGUINode(po);
  m_eventHandlerTreeViewer.refresh(true);
}
Program: 96248
Project: 96248
Buggy source:
/** 
 * @param po The persistent object that was renamed
 */
private void handleDataRenamed(final IPersistentObject po){
  if ((po instanceof ISpecTestCasePO || po instanceof ICategoryPO || po instanceof IExecTestCasePO)) {
    getTreeViewer().update(po,null);
  }
}

Fixed version (ground truth):
/** 
 * @param po The persistent object that was renamed
 */
private void handleDataRenamed(final IPersistentObject po){
  if ((po instanceof ISpecTestCasePO || po instanceof ICategoryPO || po instanceof IExecTestCasePO)) {
    getTreeViewer().refresh(true);
  }
}
Program: 96249
Project: 96249
Buggy source:
/** 
 * @param po the PO
 * @param dataState the data state
 * @param updateState the update state
 */
private void handleDataChangedImpl(final IPersistentObject po,final DataState dataState,final UpdateState updateState){
  if (po instanceof IAUTMainPO) {
    getTreeViewer().refresh();
    return;
  }
  if (updateState == UpdateState.onlyInEditor) {
    return;
  }
switch (dataState) {
case Added:
    handleDataAdded(po);
  break;
case Deleted:
handleDataDeleted(po);
break;
case Renamed:
if (po instanceof IProjectPO || po instanceof ITestSuitePO || po instanceof ITestJobPO|| po instanceof ITestCasePO) {
getTreeViewer().update(po,null);
}
break;
case StructureModified:
if (po instanceof IProjectPO) {
handleProjectLoaded();
}
if ((po instanceof ISpecTestCasePO) || (po instanceof ITestSuitePO) || (po instanceof ITestJobPO)) {
Object[] expandedElements=getTreeViewer().getExpandedElements();
ISelection selection=getTreeViewer().getSelection();
getTreeViewer().refresh();
getTreeViewer().setExpandedElements(expandedElements);
getTreeViewer().setSelection(selection);
}
if (po instanceof IObjectMappingPO) {
getTreeViewer().refresh();
}
break;
default :
break;
}
}

Fixed version (ground truth):
/** 
 * @param po the PO
 * @param dataState the data state
 * @param updateState the update state
 */
private void handleDataChangedImpl(final IPersistentObject po,final DataState dataState,final UpdateState updateState){
  if (po instanceof IAUTMainPO) {
    getTreeViewer().refresh();
    return;
  }
  if (updateState == UpdateState.onlyInEditor) {
    return;
  }
switch (dataState) {
case Added:
    handleDataAdded(po);
  break;
case Deleted:
handleDataDeleted(po);
break;
case Renamed:
if (po instanceof IProjectPO || po instanceof ITestSuitePO || po instanceof ITestJobPO|| po instanceof ITestCasePO) {
getTreeViewer().refresh();
}
break;
case StructureModified:
if (po instanceof IProjectPO) {
handleProjectLoaded();
}
if ((po instanceof ISpecTestCasePO) || (po instanceof ITestSuitePO) || (po instanceof ITestJobPO)) {
Object[] expandedElements=getTreeViewer().getExpandedElements();
ISelection selection=getTreeViewer().getSelection();
getTreeViewer().refresh();
getTreeViewer().setExpandedElements(expandedElements);
getTreeViewer().setSelection(selection);
}
if (po instanceof IObjectMappingPO) {
getTreeViewer().refresh();
}
break;
default :
break;
}
}
Program: 96250
Project: 96250
Buggy source:
/** 
 * {@inheritDoc}
 * @param adapter the adapter to get
 * @return this TestCaseEditor instance if the adaper matches.
 */
public Object getAdapter(Class adapter){
  if (adapter == DisplayableLanguages.class) {
    return new DisplayableLanguages(GeneralStorage.getInstance().getProject().getLangHelper().getLanguageList());
  }
 else   if (adapter == this.getClass()) {
    return this;
  }
 else   if (adapter == NodeEditorInput.class) {
    return getEditorInput();
  }
  Object superAdapter=super.getAdapter(adapter);
  if (superAdapter != null) {
    return superAdapter;
  }
  return getEditorHelper().getAdapter(adapter);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 * @param adapter the adapter to get
 * @return this TestCaseEditor instance if the adaper matches.
 */
public Object getAdapter(Class adapter){
  if (adapter == this.getClass()) {
    return this;
  }
 else   if (adapter == NodeEditorInput.class) {
    return getEditorInput();
  }
  Object superAdapter=super.getAdapter(adapter);
  if (superAdapter != null) {
    return superAdapter;
  }
  return getEditorHelper().getAdapter(adapter);
}
Program: 96251
Project: 96251
Buggy source:
/** 
 * creates the TableColumns with languages
 * @param dataSetNumbers if true, the data set column is created, otherwisethe parameter column.
 */
private void initTableViewerLanguageColumns(boolean dataSetNumbers){
  if (getParamInterfaceObj() == null) {
    return;
  }
  DisplayableLanguages langs=(DisplayableLanguages)m_currentPart.getAdapter(DisplayableLanguages.class);
  if (langs == null) {
    setParamInterfaceObj(null);
    updateView();
    return;
  }
  List<Locale> locales=langs.getLocales();
  String[] columnProperties=new String[locales.size() + 1];
  final Table table=getTable();
  if (dataSetNumbers) {
    columnProperties[0]=initDataSetColumn();
  }
 else {
    columnProperties[0]=initParameterColumn();
  }
  int i=1;
  List<String> dispList=new ArrayList<String>();
  for (  Locale locale : locales) {
    dispList.add(locale.getDisplayName());
  }
  String[] dispNames=dispList.toArray(new String[dispList.size()]);
  Arrays.sort(dispNames);
  for (  String lang : dispNames) {
    TableColumn column=new TableColumn(table,SWT.NONE);
    column.setText(lang);
    column.setWidth(COLUMN_WIDTH);
    column.setData(Languages.getInstance().getLocale(lang));
    columnProperties[i++]=column.getText();
  }
  getTableViewer().setColumnProperties(columnProperties);
}

Fixed version (ground truth):
/** 
 * creates the TableColumns with languages
 * @param dataSetNumbers if true, the data set column is created, otherwisethe parameter column.
 */
private void initTableViewerLanguageColumns(boolean dataSetNumbers){
  if (getParamInterfaceObj() == null) {
    return;
  }
  List<Locale> locales=WorkingLanguageBP.getInstance().getDisplayableLanguages();
  String[] columnProperties=new String[locales.size() + 1];
  final Table table=getTable();
  if (dataSetNumbers) {
    columnProperties[0]=initDataSetColumn();
  }
 else {
    columnProperties[0]=initParameterColumn();
  }
  int i=1;
  List<String> dispList=new ArrayList<String>();
  for (  Locale locale : locales) {
    dispList.add(locale.getDisplayName());
  }
  String[] dispNames=dispList.toArray(new String[dispList.size()]);
  Arrays.sort(dispNames);
  for (  String lang : dispNames) {
    TableColumn column=new TableColumn(table,SWT.NONE);
    column.setText(lang);
    column.setWidth(COLUMN_WIDTH);
    column.setData(Languages.getInstance().getLocale(lang));
    columnProperties[i++]=column.getText();
  }
  getTableViewer().setColumnProperties(columnProperties);
}
Program: 96252
Project: 96252
Buggy source:
/** 
 * Fills the Language-Combo with its values displayed.
 */
private void fillLanguageCombo(){
  List<Locale> langList=new ArrayList<Locale>(0);
  if (getParamInterfaceObj() != null && m_currentPart != null) {
    DisplayableLanguages languages=(DisplayableLanguages)m_currentPart.getAdapter(DisplayableLanguages.class);
    if (languages != null) {
      langList=languages.getLocales();
    }
  }
  List<String> dispList=new ArrayList<String>();
  for (  Locale locale : langList) {
    dispList.add(locale.getDisplayName());
  }
  String[] dispNames=dispList.toArray(new String[dispList.size()]);
  Arrays.sort(dispNames);
  final int listSize=langList.size();
  List<String> keys=new ArrayList<String>(listSize);
  List<Locale> values=new ArrayList<Locale>(listSize);
  for (  String lang : dispNames) {
    values.add(Languages.getInstance().getLocale(lang));
    keys.add(lang);
  }
  getLanguageCombo().setItems(values,keys);
}

Fixed version (ground truth):
/** 
 * Fills the Language-Combo with its values displayed.
 */
private void fillLanguageCombo(){
  List<Locale> langList=WorkingLanguageBP.getInstance().getDisplayableLanguages();
  List<String> dispList=new ArrayList<String>();
  for (  Locale locale : langList) {
    dispList.add(locale.getDisplayName());
  }
  String[] dispNames=dispList.toArray(new String[dispList.size()]);
  Arrays.sort(dispNames);
  final int listSize=langList.size();
  List<String> keys=new ArrayList<String>(listSize);
  List<Locale> values=new ArrayList<Locale>(listSize);
  for (  String lang : dispNames) {
    values.add(Languages.getInstance().getLocale(lang));
    keys.add(lang);
  }
  getLanguageCombo().setItems(values,keys);
}
Program: 96253
Project: 96253
Buggy source:
/** 
 * @param root the root of the TreeViewer.
 */
protected void initTopTreeViewer(INodePO root){
  try {
    getMainTreeViewer().getTree().setRedraw(false);
    getMainTreeViewer().setInput(null);
    getMainTreeViewer().setInput(new INodePO[]{root});
  }
  finally {
    getMainTreeViewer().getTree().setRedraw(true);
    getMainTreeViewer().expandAll();
  }
}

Fixed version (ground truth):
/** 
 * @param root the root of the TreeViewer.
 */
protected void initTopTreeViewer(INodePO root){
  try {
    getMainTreeViewer().getTree().setRedraw(false);
    getMainTreeViewer().setInput(null);
    getMainTreeViewer().setInput(new INodePO[]{root});
  }
  finally {
    getMainTreeViewer().getTree().setRedraw(true);
    getMainTreeViewer().expandAll();
    getMainTreeViewer().setSelection(new StructuredSelection(root));
  }
}
Program: 96254
Project: 96254
Buggy source:
/** 
 * Sets the input of the tree viewer for specificaion.
 */
public void setInitialInput(){
  getMainTreeViewer().setContentProvider(new TestSuiteEditorContentProvider());
  ITestSuitePO rootPO=(ITestSuitePO)getEditorHelper().getEditSupport().getWorkVersion();
  try {
    getTreeViewer().getTree().setRedraw(false);
    getTreeViewer().setInput(new ITestSuitePO[]{rootPO});
  }
  finally {
    getTreeViewer().getTree().setRedraw(true);
    getMainTreeViewer().expandAll();
  }
}

Fixed version (ground truth):
/** 
 * Sets the input of the tree viewer for specificaion.
 */
public void setInitialInput(){
  getMainTreeViewer().setContentProvider(new TestSuiteEditorContentProvider());
  ITestSuitePO rootPO=(ITestSuitePO)getEditorHelper().getEditSupport().getWorkVersion();
  try {
    getTreeViewer().getTree().setRedraw(false);
    getTreeViewer().setInput(new ITestSuitePO[]{rootPO});
  }
  finally {
    getTreeViewer().getTree().setRedraw(true);
    getMainTreeViewer().expandAll();
    getMainTreeViewer().setSelection(new StructuredSelection(rootPO));
  }
}
Program: 96255
Project: 96255
Buggy source:
/** 
 * {@inheritDoc}
 */
public Object execute(ExecutionEvent event){
  TestCaseBrowser testSpecTreeView=(TestCaseBrowser)Plugin.getView(Constants.TC_BROWSER_ID);
  if (testSpecTreeView == null) {
    return null;
  }
  if (!(testSpecTreeView.getTreeViewer().getSelection() instanceof IStructuredSelection)) {
    return null;
  }
  IStructuredSelection selection=(IStructuredSelection)testSpecTreeView.getTreeViewer().getSelection();
  Iterator iter=selection.iterator();
  while (iter.hasNext()) {
    INodePO selectedNode=(INodePO)iter.next();
    INodePO editableNode=findEditableNode(selectedNode);
    if (editableNode == null) {
      return null;
    }
    TestCaseEditor editor=(TestCaseEditor)openEditor(editableNode);
    if (editor != null) {
      editor.setOpeningSelection(selectedNode);
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public Object execute(ExecutionEvent event){
  TestCaseBrowser testSpecTreeView=(TestCaseBrowser)Plugin.getView(Constants.TC_BROWSER_ID);
  if (testSpecTreeView == null) {
    return null;
  }
  if (!(testSpecTreeView.getTreeViewer().getSelection() instanceof IStructuredSelection)) {
    return null;
  }
  IStructuredSelection selection=(IStructuredSelection)testSpecTreeView.getTreeViewer().getSelection();
  Iterator iter=selection.iterator();
  while (iter.hasNext()) {
    INodePO selectedNode=(INodePO)iter.next();
    INodePO editableNode=findEditableNode(selectedNode);
    if (editableNode == null) {
      return null;
    }
    openEditor(editableNode);
  }
  return null;
}
Program: 96256
Project: 96256
Buggy source:
/** 
 * {@inheritDoc}
 */
public Object execute(ExecutionEvent event){
  TestSuiteBrowser testExecTreeView=(TestSuiteBrowser)Plugin.getView(Constants.TS_BROWSER_ID);
  if (testExecTreeView == null) {
    return null;
  }
  if (!(testExecTreeView.getTreeViewer().getSelection() instanceof IStructuredSelection)) {
    return null;
  }
  IStructuredSelection selection=(IStructuredSelection)testExecTreeView.getTreeViewer().getSelection();
  Iterator iter=selection.iterator();
  while (iter.hasNext()) {
    INodePO selectedNode=(INodePO)iter.next();
    INodePO editableNode=findEditableNode(selectedNode);
    if (editableNode == null) {
      return null;
    }
    TestSuiteEditor editor=(TestSuiteEditor)openEditor(editableNode);
    if (editor != null) {
      editor.setOpeningSelection(selectedNode);
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public Object execute(ExecutionEvent event){
  TestSuiteBrowser testExecTreeView=(TestSuiteBrowser)Plugin.getView(Constants.TS_BROWSER_ID);
  if (testExecTreeView == null) {
    return null;
  }
  if (!(testExecTreeView.getTreeViewer().getSelection() instanceof IStructuredSelection)) {
    return null;
  }
  IStructuredSelection selection=(IStructuredSelection)testExecTreeView.getTreeViewer().getSelection();
  Iterator iter=selection.iterator();
  while (iter.hasNext()) {
    INodePO selectedNode=(INodePO)iter.next();
    INodePO editableNode=findEditableNode(selectedNode);
    if (editableNode == null) {
      return null;
    }
    openEditor(editableNode);
  }
  return null;
}
Program: 96257
Project: 96257
Buggy source:
/** 
 * @param gdObject the SpecTestCAsePO
 * @return resolutions for use of a deprecated component or action.
 */
private IMarkerResolution[] getDeprecatedActionOrComponentResolutions(final Object gdObject){
  return new IMarkerResolution[]{new IMarkerResolution(){
    public String getLabel(){
      return Messages.GDProblemViewOpenTestCaseEditor;
    }
    public void run(    IMarker marker){
      final ITreeNodeOperation<INodePO> op=new ITreeNodeOperation<INodePO>(){
        public boolean operate(        ITreeTraverserContext<INodePO> ctx,        INodePO parent,        INodePO node,        boolean alreadyVisited){
          if (node.toString().equals(gdObject.toString())) {
            ctx.setContinued(false);
            INodePO selectedNode=node;
            INodePO editableNode=node.getParentNode();
            if (editableNode == null) {
              return true;
            }
            TestCaseEditor editor=(TestCaseEditor)AbstractOpenHandler.openEditor(editableNode);
            if (editor != null) {
              editor.setOpeningSelection(selectedNode);
            }
          }
          return true;
        }
        public void postOperate(        ITreeTraverserContext<INodePO> ctx,        INodePO parent,        INodePO node,        boolean alreadyVisited){
        }
      }
;
      TreeTraverser traverser=new SpecTreeTraverser(GeneralStorage.getInstance().getProject(),op);
      traverser.traverse();
    }
  }
};
}

Fixed version (ground truth):
/** 
 * @param gdObject the SpecTestCAsePO
 * @return resolutions for use of a deprecated component or action.
 */
private IMarkerResolution[] getDeprecatedActionOrComponentResolutions(final Object gdObject){
  return new IMarkerResolution[]{new IMarkerResolution(){
    public String getLabel(){
      return Messages.GDProblemViewOpenTestCaseEditor;
    }
    public void run(    IMarker marker){
      final ITreeNodeOperation<INodePO> op=new ITreeNodeOperation<INodePO>(){
        public boolean operate(        ITreeTraverserContext<INodePO> ctx,        INodePO parent,        INodePO node,        boolean alreadyVisited){
          if (node.toString().equals(gdObject.toString())) {
            ctx.setContinued(false);
            INodePO selectedNode=node;
            INodePO editableNode=node.getParentNode();
            if (editableNode == null) {
              return true;
            }
            AbstractOpenHandler.openEditor(editableNode);
          }
          return true;
        }
        public void postOperate(        ITreeTraverserContext<INodePO> ctx,        INodePO parent,        INodePO node,        boolean alreadyVisited){
        }
      }
;
      TreeTraverser traverser=new SpecTreeTraverser(GeneralStorage.getInstance().getProject(),op);
      traverser.traverse();
    }
  }
};
}
Program: 96258
Project: 96258
Buggy source:
public boolean operate(ITreeTraverserContext<INodePO> ctx,INodePO parent,INodePO node,boolean alreadyVisited){
  if (node.toString().equals(gdObject.toString())) {
    ctx.setContinued(false);
    INodePO selectedNode=node;
    INodePO editableNode=node.getParentNode();
    if (editableNode == null) {
      return true;
    }
    TestCaseEditor editor=(TestCaseEditor)AbstractOpenHandler.openEditor(editableNode);
    if (editor != null) {
      editor.setOpeningSelection(selectedNode);
    }
  }
  return true;
}

Fixed version (ground truth):
public boolean operate(ITreeTraverserContext<INodePO> ctx,INodePO parent,INodePO node,boolean alreadyVisited){
  if (node.toString().equals(gdObject.toString())) {
    ctx.setContinued(false);
    INodePO selectedNode=node;
    INodePO editableNode=node.getParentNode();
    if (editableNode == null) {
      return true;
    }
    AbstractOpenHandler.openEditor(editableNode);
  }
  return true;
}
Program: 96259
Project: 96259
Buggy source:
/** 
 * {@inheritDoc}
 * @param parentElement Object
 * @return object array
 */
public Object[] getChildren(Object parentElement){
  if (parentElement instanceof IExecTestCasePO) {
    ISpecTestCasePO referencedTestCase=((IExecTestCasePO)parentElement).getSpecTestCase();
    if (referencedTestCase != null) {
      return referencedTestCase.getUnmodifiableNodeList().toArray();
    }
    return ArrayUtils.EMPTY_OBJECT_ARRAY;
  }
  if (parentElement instanceof IProjectPO) {
    IProjectPO project=(IProjectPO)parentElement;
    List<Object> elements=new ArrayList<Object>();
    elements.addAll(project.getSpecObjCont().getSpecObjList());
    elements.addAll(project.getUsedProjects());
    return elements.toArray();
  }
  if (parentElement instanceof INodePO) {
    return ((INodePO)parentElement).getUnmodifiableNodeList().toArray();
  }
  if (parentElement instanceof IReusedProjectPO) {
    try {
      IProjectPO reusedProject=ProjectPM.loadReusedProjectInMasterSession((IReusedProjectPO)parentElement);
      if (reusedProject != null) {
        return reusedProject.getSpecObjCont().getSpecObjList().toArray();
      }
      return ArrayUtils.EMPTY_OBJECT_ARRAY;
    }
 catch (    JBException e) {
      Utils.createMessageDialog(e,null,null);
      return ArrayUtils.EMPTY_OBJECT_ARRAY;
    }
  }
  return ArrayUtils.EMPTY_OBJECT_ARRAY;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 * @param parentElement Object
 * @return object array
 */
public Object[] getChildren(Object parentElement){
  if (parentElement instanceof IExecTestCasePO) {
    ISpecTestCasePO referencedTestCase=((IExecTestCasePO)parentElement).getSpecTestCase();
    if (referencedTestCase != null) {
      return ArrayUtils.addAll(Collections.unmodifiableCollection(referencedTestCase.getAllEventEventExecTC()).toArray(),referencedTestCase.getUnmodifiableNodeList().toArray());
    }
    return ArrayUtils.EMPTY_OBJECT_ARRAY;
  }
  if (parentElement instanceof IProjectPO) {
    IProjectPO project=(IProjectPO)parentElement;
    List<Object> elements=new ArrayList<Object>();
    elements.addAll(project.getSpecObjCont().getSpecObjList());
    elements.addAll(project.getUsedProjects());
    return elements.toArray();
  }
  if (parentElement instanceof INodePO) {
    INodePO parentNode=((INodePO)parentElement);
    Object[] children=parentNode.getUnmodifiableNodeList().toArray();
    if (parentElement instanceof ISpecTestCasePO) {
      children=ArrayUtils.addAll(Collections.unmodifiableCollection(((ISpecTestCasePO)parentElement).getAllEventEventExecTC()).toArray(),children);
    }
    return children;
  }
  if (parentElement instanceof IReusedProjectPO) {
    try {
      IProjectPO reusedProject=ProjectPM.loadReusedProjectInMasterSession((IReusedProjectPO)parentElement);
      if (reusedProject != null) {
        return reusedProject.getSpecObjCont().getSpecObjList().toArray();
      }
      return ArrayUtils.EMPTY_OBJECT_ARRAY;
    }
 catch (    JBException e) {
      Utils.createMessageDialog(e,null,null);
      return ArrayUtils.EMPTY_OBJECT_ARRAY;
    }
  }
  return ArrayUtils.EMPTY_OBJECT_ARRAY;
}
Program: 96260
Project: 96260
Buggy source:
/** 
 * @param parentElement Object
 * @return object array
 */
public Object[] getChildren(Object parentElement){
  if (parentElement instanceof IProjectPO) {
    IProjectPO project=(IProjectPO)parentElement;
    return new Object[]{project.getTestJobCont(),project.getTestSuiteCont()};
  }
  if (parentElement instanceof IExecTestCasePO) {
    ISpecTestCasePO referencedTestCase=((IExecTestCasePO)parentElement).getSpecTestCase();
    if (referencedTestCase != null) {
      return referencedTestCase.getUnmodifiableNodeList().toArray();
    }
    return ArrayUtils.EMPTY_OBJECT_ARRAY;
  }
  if (parentElement instanceof ITestSuitePO) {
    ITestSuitePO testSuite=(ITestSuitePO)parentElement;
    Locale workLang=WorkingLanguageBP.getInstance().getWorkingLanguage();
    if (testSuite.getAut() != null && !WorkingLanguageBP.getInstance().isTestSuiteLanguage(workLang,testSuite)) {
      return new Object[0];
    }
  }
  if (parentElement instanceof INodePO) {
    return ((INodePO)parentElement).getUnmodifiableNodeList().toArray();
  }
  if (parentElement instanceof ITestSuiteContPO) {
    return ((ITestSuiteContPO)parentElement).getTestSuiteList().toArray();
  }
  if (parentElement instanceof ITestJobContPO) {
    return ((ITestJobContPO)parentElement).getTestJobList().toArray();
  }
  LOG.error("String_Node_Str" + parentElement);
  return ArrayUtils.EMPTY_OBJECT_ARRAY;
}

Fixed version (ground truth):
/** 
 * @param parentElement Object
 * @return object array
 */
public Object[] getChildren(Object parentElement){
  if (parentElement instanceof IProjectPO) {
    IProjectPO project=(IProjectPO)parentElement;
    return new Object[]{project.getTestJobCont(),project.getTestSuiteCont()};
  }
  if (parentElement instanceof IExecTestCasePO) {
    ISpecTestCasePO referencedTestCase=((IExecTestCasePO)parentElement).getSpecTestCase();
    if (referencedTestCase != null) {
      return ArrayUtils.addAll(Collections.unmodifiableCollection(referencedTestCase.getAllEventEventExecTC()).toArray(),referencedTestCase.getUnmodifiableNodeList().toArray());
    }
    return ArrayUtils.EMPTY_OBJECT_ARRAY;
  }
  if (parentElement instanceof ITestSuitePO) {
    ITestSuitePO testSuite=(ITestSuitePO)parentElement;
    Locale workLang=WorkingLanguageBP.getInstance().getWorkingLanguage();
    if (testSuite.getAut() != null && !WorkingLanguageBP.getInstance().isTestSuiteLanguage(workLang,testSuite)) {
      return new Object[0];
    }
  }
  if (parentElement instanceof INodePO) {
    return ((INodePO)parentElement).getUnmodifiableNodeList().toArray();
  }
  if (parentElement instanceof ITestSuiteContPO) {
    return ((ITestSuiteContPO)parentElement).getTestSuiteList().toArray();
  }
  if (parentElement instanceof ITestJobContPO) {
    return ((ITestJobContPO)parentElement).getTestJobList().toArray();
  }
  LOG.error("String_Node_Str" + parentElement);
  return ArrayUtils.EMPTY_OBJECT_ARRAY;
}
Program: 96261
Project: 96261
Buggy source:
/** 
 * Creates a KeyStroke of the given keyStrokeSpec
 * @param keyStrokeSpec see {@link KeyStroke#getKeyStroke(String)}
 * @return a KeyStroke.
 * @throws RobotException if no KeyStroke can be created.
 */
private KeyStroke getKeyStroke(String keyStrokeSpec) throws RobotException {
  KeyStroke keyStroke;
  if (keyStrokeSpec.length() == 1) {
    keyStroke=KeyStroke.getKeyStroke(keyStrokeSpec.charAt(0));
  }
 else {
    keyStroke=KeyStroke.getKeyStroke(keyStrokeSpec);
  }
  if (keyStroke == null) {
    final String msg="String_Node_Str" + keyStrokeSpec + "String_Node_Str";
    if (log.isWarnEnabled()) {
      log.warn(msg);
    }
    throw new RobotException(msg,EventFactory.createActionError(TestErrorEvent.INVALID_PARAM_VALUE));
  }
  return keyStroke;
}

Fixed version (ground truth):
/** 
 * Creates a KeyStroke of the given keyStrokeSpec
 * @param keyStrokeSpec see  {@link KeyStroke#getKeyStroke(String)} and{@link KeyStroke#getKeyStroke(Char)}
 * @return a KeyStroke.
 * @throws RobotException if no KeyStroke can be created.
 */
private KeyStroke getKeyStroke(String keyStrokeSpec) throws RobotException {
  KeyStroke keyStroke;
  if (keyStrokeSpec.length() == 1) {
    char singeKeyStrokeSpecChar=keyStrokeSpec.charAt(0);
    singeKeyStrokeSpecChar=getOSSspecificSpecBaseCharacter(singeKeyStrokeSpecChar);
    keyStroke=KeyStroke.getKeyStroke(singeKeyStrokeSpecChar);
  }
 else {
    int keyStrokeSpecSize=keyStrokeSpec.length();
    char keySpec=keyStrokeSpec.charAt(keyStrokeSpecSize - 1);
    if ('�' != keySpec) {
      keySpec=Character.toUpperCase(keySpec);
    }
    String modifiedKeyStrokeSpec=keyStrokeSpec.substring(0,keyStrokeSpecSize - 1) + keySpec;
    keyStroke=KeyStroke.getKeyStroke(modifiedKeyStrokeSpec);
  }
  if (keyStroke == null) {
    final String msg="String_Node_Str" + keyStrokeSpec + "String_Node_Str";
    if (log.isWarnEnabled()) {
      log.warn(msg);
    }
    throw new RobotException(msg,EventFactory.createActionError(TestErrorEvent.INVALID_PARAM_VALUE));
  }
  return keyStroke;
}
Program: 96262
Project: 96262
Buggy source:
/** 
 * @param keyStrokeSpec String representing the key for which a key typer should be returned. 
 * @return a key typer capable of generating the necessaryevent to simulate the base key of the given key stroke spec.
 */
private static AbstractKeyTyper getBaseKeyTyper(String keyStrokeSpec){
  String[] specElements=keyStrokeSpec.split("String_Node_Str");
  String baseKey=specElements[specElements.length - 1];
  int code=SwtKeyCodeConverter.getKeyCode(baseKey);
  if (code == -1) {
    return new KeyCharTyper(SwtKeyCodeConverter.getKeyChar(baseKey).charValue());
  }
  return new KeyCodeTyper(code);
}

Fixed version (ground truth):
/** 
 * @param keyStrokeSpec String representing the key for which a key typer should be returned. 
 * @return a key typer capable of generating the necessaryevent to simulate the base key of the given key stroke spec.
 */
private static AbstractKeyTyper getBaseKeyTyper(String keyStrokeSpec){
  String[] specElements=keyStrokeSpec.split("String_Node_Str");
  String baseKey=specElements[specElements.length - 1];
  int code=SwtKeyCodeConverter.getKeyCode(baseKey);
  if (code == -1) {
    return new KeyCharTyper(getOSSspecificSpecBaseCharacter(SwtKeyCodeConverter.getKeyChar(baseKey).charValue()));
  }
  return new KeyCodeTyper(code);
}
Program: 96263
Project: 96263
Buggy source:
/** 
 * perform a keystroke
 * @param modifierSpec the string representation of the modifiers
 * @param keySpec the string representation of the key
 */
public void gdKeyStroke(String modifierSpec,String keySpec){
  if (keySpec == null || keySpec.trim().length() == 0) {
    throw new StepExecutionException("String_Node_Str",EventFactory.createActionError(TestErrorEvent.INVALID_PARAM_VALUE));
  }
  String key=StringConstants.EMPTY;
  if ("String_Node_Str".equals(keySpec)) {
    key=keySpec;
  }
 else {
    key=keySpec.trim().toUpperCase();
  }
  String keyStrokeSpec=key;
  String mod=KeyStrokeUtil.getModifierString(modifierSpec);
  if (mod.length() > 0) {
    keyStrokeSpec=mod + "String_Node_Str" + keyStrokeSpec;
  }
  getRobot().keyStroke(keyStrokeSpec);
}

Fixed version (ground truth):
/** 
 * perform a keystroke
 * @param modifierSpec the string representation of the modifiers
 * @param keySpec the string representation of the key
 */
public void gdKeyStroke(String modifierSpec,String keySpec){
  if (keySpec == null || keySpec.trim().length() == 0) {
    throw new StepExecutionException("String_Node_Str",EventFactory.createActionError(TestErrorEvent.INVALID_PARAM_VALUE));
  }
  String keyStrokeSpec=keySpec.trim();
  String mod=KeyStrokeUtil.getModifierString(modifierSpec);
  if (mod.length() > 0) {
    keyStrokeSpec=mod + "String_Node_Str" + keyStrokeSpec;
  }
  getRobot().keyStroke(keyStrokeSpec);
}
Program: 96264
Project: 96264
Buggy source:
/** 
 * @param provider the provider
 */
protected void setImageProvider(ImageProvider provider){
  if (provider == null) {
    return;
  }
  final Image image=provider.getImage(m_viewer.getDisplay());
  Plugin.getDisplay().syncExec(new Runnable(){
    public void run(){
      if (image != null) {
        m_viewer.setImage(image);
      }
      disposeImage();
    }
  }
);
  this.m_provider=provider;
  this.m_image=image;
}

Fixed version (ground truth):
/** 
 * @param provider the provider
 */
protected void setImageProvider(ImageProvider provider){
  final Image image=provider.getImage(m_viewer.getDisplay());
  Plugin.getDisplay().syncExec(new Runnable(){
    public void run(){
      if (image != null) {
        m_viewer.setImage(image);
      }
 else {
        clear();
      }
    }
  }
);
  this.m_provider=provider;
  this.m_image=image;
}
Program: 96265
Project: 96265
Buggy source:
public void selectionChanged(IWorkbenchPart part,ISelection selection){
  disposeImage();
  m_viewer.redraw();
  handleSelection(selection);
}

Fixed version (ground truth):
public void selectionChanged(IWorkbenchPart part,ISelection selection){
  handleSelection(selection);
}
Program: 96266
Project: 96266
Buggy source:
/** 
 * @param provider the provider
 */
private void handleSelection(final ImageProvider provider){
  if (provider == null) {
    return;
  }
  final String jobName=Messages.UIJobLoadingImage;
  Job job=new Job(jobName){
    public IStatus run(    IProgressMonitor monitor){
      monitor.beginTask(jobName,IProgressMonitor.UNKNOWN);
      setImageProvider(provider);
      monitor.done();
      return Status.OK_STATUS;
    }
  }
;
  JobUtils.executeJob(job,null);
}

Fixed version (ground truth):
/** 
 * @param provider the provider
 */
private void handleSelection(final ImageProvider provider){
  final String jobName=Messages.UIJobLoadingImage;
  Job job=new Job(jobName){
    public IStatus run(    IProgressMonitor monitor){
      monitor.beginTask(jobName,IProgressMonitor.UNKNOWN);
      setImageProvider(provider);
      monitor.done();
      return Status.OK_STATUS;
    }
  }
;
  JobUtils.executeJob(job,null);
}
Program: 96267
Project: 96267
Buggy source:
public void run(){
  if (image != null) {
    m_viewer.setImage(image);
  }
  disposeImage();
}

Fixed version (ground truth):
public void run(){
  if (image != null) {
    m_viewer.setImage(image);
  }
 else {
    clear();
  }
}
Program: 96268
Project: 96268
Buggy source:
/** 
 * {@inheritDoc}
 */
public void createPartControl(Composite parent){
  parent.setLayout(new FillLayout());
  m_viewer=new ImageViewer(parent,SWT.NONE);
  getSelectionService().addSelectionListener(m_selectionListener);
  handleSelection(getSelectionService().getSelection());
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public void createPartControl(Composite parent){
  parent.setLayout(new FillLayout());
  m_viewer=new ImageViewer(parent,SWT.NONE);
  getSelectionService().addSelectionListener(m_selectionListener);
  handleSelection(getSelectionService().getSelection());
  getSite().setSelectionProvider(this);
}
Program: 96269
Project: 96269
Buggy source:
@Override protected void handleNodeAdded(INodePO addedNode){
  super.handleNodeAdded(addedNode);
  if (addedNode instanceof IEventExecTestCasePO) {
    GuiNodeBP.setSelectionAndFocusToNode(addedNode,m_eventHandlerTreeViewer);
  }
}

Fixed version (ground truth):
@Override protected void handleNodeAdded(INodePO addedNode){
  super.handleNodeAdded(addedNode);
  if (addedNode instanceof IEventExecTestCasePO) {
    UINodeBP.setSelectionAndFocusToNode(addedNode,m_eventHandlerTreeViewer);
  }
}
Program: 96270
Project: 96270
Buggy source:
/** 
 * {@inheritDoc}
 */
public void handleDataChanged(IPersistentObject po,DataState dataState,UpdateState updateState){
  if (po instanceof INodePO) {
    TreeViewer tv=getTreeViewer();
switch (dataState) {
case Added:
      INodePO addedNode=(INodePO)po;
    INodePO editorNode=(INodePO)getEditorHelper().getEditSupport().getWorkVersion();
  if (editorNode.indexOf(addedNode) > -1) {
    getTreeViewer().refresh();
    getTreeViewer().expandAll();
    GuiNodeBP.setSelectionAndFocusToNode(addedNode,tv);
  }
break;
case Deleted:
if (!(po instanceof IProjectPO)) {
getTreeViewer().refresh();
setFocus();
}
break;
case Renamed:
renameGUINode(po);
break;
case StructureModified:
if (!handleStructureModified(po)) {
return;
}
break;
case ReuseChanged:
break;
default :
Assert.notReached();
}
getEditorHelper().handleDataChanged(po,dataState,updateState);
}
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public void handleDataChanged(IPersistentObject po,DataState dataState,UpdateState updateState){
  if (po instanceof INodePO) {
    TreeViewer tv=getTreeViewer();
switch (dataState) {
case Added:
      INodePO addedNode=(INodePO)po;
    INodePO editorNode=(INodePO)getEditorHelper().getEditSupport().getWorkVersion();
  if (editorNode.indexOf(addedNode) > -1) {
    getTreeViewer().refresh();
    getTreeViewer().expandAll();
    UINodeBP.setSelectionAndFocusToNode(addedNode,tv);
  }
break;
case Deleted:
if (!(po instanceof IProjectPO)) {
getTreeViewer().refresh();
setFocus();
}
break;
case Renamed:
renameGUINode(po);
break;
case StructureModified:
if (!handleStructureModified(po)) {
return;
}
break;
case ReuseChanged:
break;
default :
Assert.notReached();
}
getEditorHelper().handleDataChanged(po,dataState,updateState);
}
}
Program: 96271
Project: 96271
Buggy source:
/** 
 * Creates a new TestSuite.
 */
public void newTestSuite(){
  InputDialog dialog=newTestSuitePopUp();
  if (dialog.getReturnCode() == Window.CANCEL) {
    return;
  }
  IProjectPO project=GeneralStorage.getInstance().getProject();
  try {
    ITestSuitePO testSuite=NodeMaker.createTestSuitePO(dialog.getName());
    setDefaultValuesToTestSuite(testSuite,project);
    AbstractCmdHandleChild cmd=NodePM.getCmdHandleChild(project,testSuite);
    NodePM.addAndPersistChildNode(project,testSuite,null,cmd);
    DataEventDispatcher.getInstance().fireDataChangedListener(testSuite,DataState.Added,UpdateState.all);
    InteractionEventDispatcher.getDefault().fireProgammableSelectionEvent(new StructuredSelection(testSuite));
  }
 catch (  PMException e) {
    PMExceptionHandler.handlePMExceptionForMasterSession(e);
  }
catch (  ProjectDeletedException e) {
    PMExceptionHandler.handleGDProjectDeletedException();
  }
}

Fixed version (ground truth):
/** 
 * Creates a new TestSuite.
 */
public void newTestSuite(){
  InputDialog dialog=newTestSuitePopUp();
  if (dialog.getReturnCode() == Window.CANCEL) {
    return;
  }
  IProjectPO project=GeneralStorage.getInstance().getProject();
  try {
    ITestSuitePO testSuite=NodeMaker.createTestSuitePO(dialog.getName());
    setDefaultValuesToTestSuite(testSuite,project);
    AbstractCmdHandleChild cmd=NodePM.getCmdHandleChild(project,testSuite);
    NodePM.addAndPersistChildNode(project,testSuite,null,cmd);
    DataEventDispatcher.getInstance().fireDataChangedListener(testSuite,DataState.Added,UpdateState.all);
  }
 catch (  PMException e) {
    PMExceptionHandler.handlePMExceptionForMasterSession(e);
  }
catch (  ProjectDeletedException e) {
    PMExceptionHandler.handleGDProjectDeletedException();
  }
}
Program: 96272
Project: 96272
Buggy source:
/** 
 * {@inheritDoc}
 */
public Object execute(ExecutionEvent event){
  ISelection sel=HandlerUtil.getCurrentSelection(event);
  if (sel instanceof IStructuredSelection) {
    ISpecTestCasePO specTc=GuiNodeBP.getSpecTC((IStructuredSelection)sel);
    if (specTc != null) {
      showSpecGUINode(specTc,Constants.TC_BROWSER_ID);
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public Object execute(ExecutionEvent event){
  ISelection sel=HandlerUtil.getCurrentSelection(event);
  if (sel instanceof IStructuredSelection) {
    ISpecTestCasePO specTc=UINodeBP.getSpecTC((IStructuredSelection)sel);
    if (specTc != null) {
      showSpecUINode(specTc,Constants.TC_BROWSER_ID);
    }
  }
  return null;
}
Program: 96273
Project: 96273
Buggy source:
/** 
 * {@inheritDoc}
 */
public Object execute(ExecutionEvent event){
  ISelection sel=HandlerUtil.getCurrentSelection(event);
  if (sel instanceof IStructuredSelection) {
    IStructuredSelection iss=(IStructuredSelection)sel;
    Object firstElement=iss.getFirstElement();
    if (firstElement instanceof IRefTestSuitePO) {
      IRefTestSuitePO refTS=(IRefTestSuitePO)firstElement;
      String tsGUID=refTS.getTestSuiteGuid();
      ITestSuitePO testSuite=NodePM.getTestSuite(tsGUID);
      IViewPart activatedView=Plugin.showView(Constants.TS_BROWSER_ID);
      if (activatedView instanceof TestSuiteBrowser) {
        ((TestSuiteBrowser)activatedView).setSelection(testSuite);
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public Object execute(ExecutionEvent event){
  ISelection sel=HandlerUtil.getCurrentSelection(event);
  if (sel instanceof IStructuredSelection) {
    IStructuredSelection iss=(IStructuredSelection)sel;
    Object firstElement=iss.getFirstElement();
    if (firstElement instanceof IRefTestSuitePO) {
      IRefTestSuitePO refTS=(IRefTestSuitePO)firstElement;
      String tsGUID=refTS.getTestSuiteGuid();
      ITestSuitePO testSuite=NodePM.getTestSuite(tsGUID);
      IViewPart activatedView=Plugin.showView(Constants.TS_BROWSER_ID);
      if (activatedView instanceof TestSuiteBrowser) {
        AbstractJBTreeView jbtv=(TestSuiteBrowser)activatedView;
        UINodeBP.selectNodeInTree(testSuite.getId(),jbtv.getTreeViewer(),jbtv.getEntityManager());
      }
    }
  }
  return null;
}
Program: 96274
Project: 96274
Buggy source:
/** 
 * Search for the SpecTC of an ExecTC and opens the corresponding editor if possible.
 * @param structuredSel the current selection
 */
private void openSpecNode(IStructuredSelection structuredSel){
  ISpecTestCasePO specTc=GuiNodeBP.getSpecTC(structuredSel);
  openEditorForSpecTC(specTc);
  InteractionEventDispatcher.getDefault().fireProgammableSelectionEvent(new StructuredSelection(specTc));
}

Fixed version (ground truth):
/** 
 * Search for the SpecTC of an ExecTC and opens the corresponding editor if possible.
 * @param structuredSel the current selection
 */
private void openSpecNode(IStructuredSelection structuredSel){
  ISpecTestCasePO specTc=UINodeBP.getSpecTC(structuredSel);
  openEditorForSpecTC(specTc);
  InteractionEventDispatcher.getDefault().fireProgammableSelectionEvent(new StructuredSelection(specTc));
}
Program: 96275
Project: 96275
Buggy source:
/** 
 * {@inheritDoc} 
 */
public Object getParent(Object element){
  if (element instanceof INodePO) {
    INodePO parent=((INodePO)element).getParentNode();
    IProjectPO activeProject=GeneralStorage.getInstance().getProject();
    if (parent instanceof IProjectPO && !parent.equals(activeProject)) {
      String parentGuid=parent.getGuid();
      if (activeProject != null && parentGuid != null) {
        for (        IReusedProjectPO reusedProject : activeProject.getUsedProjects()) {
          if (parentGuid.equals(reusedProject.getProjectGuid())) {
            return reusedProject;
          }
        }
      }
    }
    return parent;
  }
  if (element instanceof ITestSuiteContPO || element instanceof ITestJobContPO || element instanceof IReusedProjectPO) {
    return GeneralStorage.getInstance().getProject();
  }
  if (element instanceof ITestDataCubeContPO || element instanceof ITestDataCubePO || element instanceof SearchResultElement) {
    return null;
  }
  Assert.notReached(Messages.WrongTypeOfElement + StringConstants.EXCLAMATION_MARK);
  return null;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public Object getParent(Object element){
  if (element instanceof INodePO) {
    return ((INodePO)element).getParentNode();
  }
  if (element instanceof ITestSuiteContPO || element instanceof ITestJobContPO || element instanceof IReusedProjectPO) {
    return GeneralStorage.getInstance().getProject();
  }
  if (element instanceof ITestDataCubeContPO || element instanceof ITestDataCubePO || element instanceof SearchResultElement) {
    return null;
  }
  Assert.notReached(Messages.WrongTypeOfElement + StringConstants.EXCLAMATION_MARK);
  return null;
}
Program: 96277
Project: 96277
Buggy source:
/** 
 * @param gnode the gui node
 * @param decoration the decoration
 * @return wheter decoration should continue for this element or not
 */
private boolean shouldNotDecorate(INodePO gnode,IDecoration decoration){
  return gnode == null || gnode.getParentNode() == null || GuiNodeBP.getTestSuiteOfNode(gnode) == null || decoration.getDecorationContext() instanceof JBEditorDecorationContext || gnode instanceof IProjectPO;
}

Fixed version (ground truth):
/** 
 * @param gnode the gui node
 * @param decoration the decoration
 * @return wheter decoration should continue for this element or not
 */
private boolean shouldNotDecorate(INodePO gnode,IDecoration decoration){
  return gnode == null || gnode.getParentNode() == null || UINodeBP.getTestSuiteOfNode(gnode) == null || decoration.getDecorationContext() instanceof JBEditorDecorationContext || gnode instanceof IProjectPO;
}
Program: 96278
Project: 96278
Buggy source:
/** 
 * @param po The persistent object that was added
 */
private void handleDataAdded(IPersistentObject po){
  if ((po instanceof ISpecTestCasePO) || (po instanceof ICategoryPO)) {
    return;
  }
  getTreeViewer().refresh();
  getTreeViewer().setSelection(new StructuredSelection(po),true);
}

Fixed version (ground truth):
/** 
 * @param po The persistent object that was added
 */
private void handleDataAdded(IPersistentObject po){
  if ((po instanceof ISpecTestCasePO) || (po instanceof ICategoryPO)) {
    return;
  }
  getTreeViewer().refresh();
  getTreeViewer().expandToLevel(getTreeViewer().getAutoExpandLevel() + 1);
  getTreeViewer().setSelection(new StructuredSelection(po),true);
}