nus-yam/ex-repair huggingface dataset:
Program: 95372
Project: 95372
Buggy source:
/** 
 * {@inheritDoc}
 */
public void handleDataChanged(IPersistentObject po,DataState dataState,UpdateState updState){
  if (po instanceof INodePO) {
    INodePO changedNode=(INodePO)po;
    INodePO editorNode=(INodePO)getEditorHelper().getEditSupport().getWorkVersion();
    boolean isVisibleInEditor=editorNode.indexOf(changedNode) > -1;
    isVisibleInEditor|=contains(editorNode,changedNode);
    if (editorNode instanceof ISpecTestCasePO) {
      isVisibleInEditor|=((ISpecTestCasePO)editorNode).getAllEventEventExecTC().contains(po);
    }
switch (dataState) {
case Added:
      if (isVisibleInEditor) {
        handleNodeAdded(changedNode);
      }
    break;
case Deleted:
  if (!(po instanceof IProjectPO)) {
    isVisibleInEditor=true;
    refresh();
  }
break;
case Renamed:
createPartName();
break;
case StructureModified:
if (isVisibleInEditor) {
getEditorHelper().setDirty(true);
}
if (!handleStructureModified(po)) {
return;
}
break;
default :
}
if (isVisibleInEditor) {
runLocalChecks();
}
getEditorHelper().handleDataChanged(po,dataState);
}
 else if (po instanceof IComponentNamePO && updState != UpdateState.onlyInEditor) {
handleCompNameChanged((IComponentNamePO)po,dataState);
}
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public void handleDataChanged(IPersistentObject po,DataState dataState,UpdateState updState){
  if (po instanceof INodePO) {
    INodePO changedNode=(INodePO)po;
    INodePO editorNode=(INodePO)getEditorHelper().getEditSupport().getWorkVersion();
    boolean isVisibleInEditor=editorNode.indexOf(changedNode) > -1;
    isVisibleInEditor|=contains(editorNode,changedNode);
    if (editorNode instanceof ISpecTestCasePO) {
      isVisibleInEditor|=((ISpecTestCasePO)editorNode).getAllEventEventExecTC().contains(po);
    }
switch (dataState) {
case Added:
      if (isVisibleInEditor) {
        handleNodeAdded(changedNode);
      }
    break;
case Deleted:
  if (!(po instanceof IProjectPO)) {
    isVisibleInEditor=true;
    refresh();
  }
break;
case Renamed:
createPartName();
break;
case StructureModified:
if (isVisibleInEditor) {
getEditorHelper().setDirty(true);
}
if (!handleStructureModified(po)) {
return;
}
break;
default :
}
if (isVisibleInEditor) {
runLocalChecks();
}
getEditorHelper().handleDataChanged(po,dataState);
}
 else if (po instanceof IComponentNamePO && updState != UpdateState.onlyInEditor) {
handleCompNameChanged((IComponentNamePO)po,dataState);
}
 else if (po instanceof IObjectMappingPO && updState != UpdateState.onlyInEditor) {
IPersistentObject workversion=getEditorHelper().getEditSupport().getWorkVersion();
if (workversion instanceof ITestSuitePO) {
EntityManager session=getEditorHelper().getEditSupport().getSession();
session.refresh(session.find(po.getClass(),po.getId()));
}
runLocalChecks();
}
}
Program: 95373
Project: 95373
Buggy source:
/** 
 * run local completeness checks such as test data completeness
 */
public void runLocalChecks(){
  INodePO node=(INodePO)getEditorHelper().getEditSupport().getWorkVersion();
  CompletenessGuard.checkAll(node,new NullProgressMonitor());
}

Fixed version (ground truth):
/** 
 * run local completeness checks such as test data completeness
 */
public void runLocalChecks(){
  INodePO node=(INodePO)getEditorHelper().getEditSupport().getWorkVersion();
  node.clearProblems();
  for (Iterator<INodePO> childIterator=node.getAllNodeIter(); childIterator.hasNext(); ) {
    INodePO next=childIterator.next();
    next.clearProblems();
  }
  CompletenessGuard.checkAll(node,new NullProgressMonitor());
  m_decoraterUpdateJob.setPriority(Job.DECORATE);
  m_decoraterUpdateJob.schedule(300);
}
Program: 95374
Project: 95374
Buggy source:
/** 
 * assumes the typed data
 */
private void writeData(){
  if (m_currentPart instanceof AbstractJBEditor) {
    m_tcEditor=(AbstractJBEditor)m_currentPart;
  }
  if (m_tcEditor == null) {
    return;
  }
  int column=getColumn();
  final Control editor=m_editor.getEditor();
  if (!TextControlBP.isTextValid(editor)) {
    TextControlBP.setText(m_oldValue,editor);
  }
  final String property=getTableViewer().getColumnProperties()[column].toString();
  String value=TextControlBP.getText(editor);
  if (m_oldValue != null && m_oldValue.equals(value)) {
    return;
  }
  if (value != null && value.equals(StringConstants.EMPTY)) {
    value=null;
  }
  if (LOG.isDebugEnabled()) {
    logDataChange(property,value,m_oldValue,getParamInterfaceObj().getSpecificationUser());
  }
  if (value.length() > IPersistentObject.MAX_STR_LGT_CHAR) {
    value=value.substring(0,IPersistentObject.MAX_STR_LGT_CHAR);
    if (value.getBytes(StandardCharsets.UTF_8).length > IPersistentObject.MAX_STRING_LENGTH) {
      value=m_oldValue;
    }
    TextControlBP.setText(value,editor);
    ErrorHandlingUtil.createMessageDialog(MessageIDs.W_MAX_CHAR,new Object[]{IPersistentObject.MAX_STR_LGT_CHAR},null);
    return;
  }
  writeDataSetData(property,value,m_tcEditor);
}

Fixed version (ground truth):
/** 
 * assumes the typed data
 */
private void writeData(){
  if (m_currentPart instanceof AbstractJBEditor) {
    m_tcEditor=(AbstractJBEditor)m_currentPart;
  }
  if (m_tcEditor == null) {
    return;
  }
  int column=getColumn();
  final Control editor=m_editor.getEditor();
  if (!TextControlBP.isTextValid(editor)) {
    TextControlBP.setText(m_oldValue,editor);
  }
  final String property=getTableViewer().getColumnProperties()[column].toString();
  String value=TextControlBP.getText(editor);
  if (m_oldValue != null && m_oldValue.equals(value)) {
    return;
  }
  if (value != null && value.equals(StringConstants.EMPTY)) {
    value=null;
  }
  if (LOG.isDebugEnabled()) {
    logDataChange(property,value,m_oldValue,getParamInterfaceObj().getSpecificationUser());
  }
  if (value != null && value.length() > IPersistentObject.MAX_STR_LGT_CHAR) {
    value=value.substring(0,IPersistentObject.MAX_STR_LGT_CHAR);
    if (value.getBytes(StandardCharsets.UTF_8).length > IPersistentObject.MAX_STRING_LENGTH) {
      value=m_oldValue;
    }
    TextControlBP.setText(value,editor);
    ErrorHandlingUtil.createMessageDialog(MessageIDs.W_MAX_CHAR,new Object[]{IPersistentObject.MAX_STR_LGT_CHAR},null);
    return;
  }
  writeDataSetData(property,value,m_tcEditor);
}
Program: 95376
Project: 95376
Buggy source:
/** 
 * @param node the node to check
 */
public static void checkLocalTestData(INodePO node){
  INodePO possibleDataSourceNode=node;
  if (node instanceof IExecTestCasePO) {
    IExecTestCasePO execTc=(IExecTestCasePO)node;
    if (execTc.getHasReferencedTD()) {
      possibleDataSourceNode=execTc.getSpecTestCase();
    }
  }
  if (possibleDataSourceNode instanceof IParamNodePO) {
    IParamNodePO dataSourceNode=(IParamNodePO)possibleDataSourceNode;
    INodePO nodeToModify=null;
    if (!(node instanceof ISpecTestCasePO)) {
      nodeToModify=node;
    }
    if (nodeToModify != null) {
      setCompletenessTestData(nodeToModify,dataSourceNode.isTestDataComplete());
    }
  }
}

Fixed version (ground truth):
/** 
 * @param node the node to check
 */
public static void checkLocalTestData(INodePO node){
  INodePO possibleDataSourceNode=node;
  if (node instanceof IExecTestCasePO) {
    IExecTestCasePO execTc=(IExecTestCasePO)node;
    if (StringUtils.isNotBlank(execTc.getDataFile())) {
      return;
    }
    if (execTc.getHasReferencedTD()) {
      possibleDataSourceNode=execTc.getSpecTestCase();
    }
  }
  if (possibleDataSourceNode instanceof IParamNodePO) {
    IParamNodePO dataSourceNode=(IParamNodePO)possibleDataSourceNode;
    INodePO nodeToModify=null;
    if (!(node instanceof ISpecTestCasePO)) {
      nodeToModify=node;
    }
    if (nodeToModify != null) {
      setCompletenessTestData(nodeToModify,dataSourceNode.isTestDataComplete());
    }
  }
}
Program: 95377
Project: 95377
Buggy source:
/** 
 * Removes a problem from the problems view.
 * @param problem the problem with the marker that should be deleted
 */
public void remove(Problem problem){
  try {
    IMarker marker=m_res.findMarker(m_problems.get(problem).getId());
    marker.delete();
    m_problems.remove(problem);
    m_markers.remove(marker);
  }
 catch (  CoreException e) {
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * Removes a problem from the problems view.
 * @param problem the problem with the marker that should be deleted
 */
public void remove(Problem problem){
  try {
    IMarker problemMarker=m_problems.get(problem);
    if (problemMarker != null) {
      IMarker marker=m_res.findMarker(problemMarker.getId());
      marker.delete();
      m_markers.remove(marker);
    }
    m_problems.remove(problem);
  }
 catch (  CoreException e) {
    e.printStackTrace();
  }
}
Program: 95378
Project: 95378
Buggy source:
/** 
 * {@inheritDoc}This should always be called by the assisted editor during its  <code>handleDataChanged</code> method.
 */
public void handleDataChanged(final IPersistentObject po,final DataState dataState){
  IPersistentObject workVersion=getEditSupport().getWorkVersion();
switch (dataState) {
case Added:
    break;
case Deleted:
  if (po.equals(workVersion)) {
    m_editor.getSite().getPage().closeEditor(m_editor,false);
  }
break;
case Renamed:
if (!isDirty() && editorContainsPo(po)) {
handleProjectLoaded();
}
break;
case StructureModified:
if (po.equals(workVersion) && !po.getVersion().equals(workVersion.getVersion())) {
try {
m_editor.reOpenEditor(po);
}
 catch (PMException e) {
ErrorHandlingUtil.createMessageDialog(MessageIDs.E_REFRESH_FAILED,null,new String[]{Messages.ErrorMessageEDITOR_CLOSE});
m_editor.getSite().getPage().closeEditor(m_editor,false);
}
}
break;
default :
}
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}This should always be called by the assisted editor during its  <code>handleDataChanged</code> method.
 */
public void handleDataChanged(final IPersistentObject po,final DataState dataState){
  EditSupport editSupport=getEditSupport();
  if (editSupport == null) {
    return;
  }
  IPersistentObject workVersion=editSupport.getWorkVersion();
switch (dataState) {
case Added:
    break;
case Deleted:
  if (po.equals(workVersion)) {
    m_editor.getSite().getPage().closeEditor(m_editor,false);
  }
break;
case Renamed:
if (!isDirty() && editorContainsPo(po)) {
handleProjectLoaded();
}
break;
case StructureModified:
if (po.equals(workVersion) && !po.getVersion().equals(workVersion.getVersion())) {
try {
m_editor.reOpenEditor(po);
}
 catch (PMException e) {
ErrorHandlingUtil.createMessageDialog(MessageIDs.E_REFRESH_FAILED,null,new String[]{Messages.ErrorMessageEDITOR_CLOSE});
m_editor.getSite().getPage().closeEditor(m_editor,false);
}
}
break;
default :
}
}
Program: 95379
Project: 95379
Buggy source:
/** 
 * {@inheritDoc} 
 */
public void clickOnIndex(final Integer index,ClickOptions co){
  final int actualItemCount=EventThreadQueuerJavaFXImpl.invokeAndWait("String_Node_Str",new Callable<Integer>(){
    public Integer call() throws Exception {
      final ObservableList<?> items=getRealComponent().getItems();
      int itemCount=items != null ? items.size() : -1;
      return new Integer(itemCount);
    }
  }
).intValue();
  if (index >= actualItemCount || (index < 0)) {
    throw new StepExecutionException("String_Node_Str" + index + "String_Node_Str",EventFactory.createActionError(TestErrorEvent.INVALID_INDEX));
  }
  Rectangle r=EventThreadQueuerJavaFXImpl.invokeAndWait("String_Node_Str",new Callable<Rectangle>(){
    public Rectangle call() throws Exception {
      final T listView=getRealComponent();
      listView.scrollTo(index.intValue());
      listView.layout();
      List<ListCell> lCells=NodeTraverseHelper.getInstancesOf(listView,ListCell.class);
      for (      ListCell<?> cell : lCells) {
        if (cell.getIndex() == index.intValue() && cell.getListView() == listView) {
          Rectangle b=NodeBounds.getAbsoluteBounds(cell);
          Rectangle tableB=NodeBounds.getAbsoluteBounds(listView);
          double widthOfClickableRectangle=b.getWidth();
          double prefWidth=cell.prefWidth(cell.getHeight());
          if (widthOfClickableRectangle > listView.getWidth()) {
            widthOfClickableRectangle=listView.getWidth();
          }
          if (StringUtils.isBlank(cell.getText())) {
            widthOfClickableRectangle=b.getWidth();
          }
          return new Rectangle(Math.abs(tableB.x - b.x),Math.abs(tableB.y - b.y),Rounding.round(widthOfClickableRectangle),Rounding.round(b.getHeight()));
        }
      }
      return null;
    }
  }
);
  getRobot().click(getRealComponent(),r,co.setClickType(ClickOptions.ClickType.RELEASED));
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public void clickOnIndex(final Integer index,ClickOptions co){
  final int actualItemCount=EventThreadQueuerJavaFXImpl.invokeAndWait("String_Node_Str",new Callable<Integer>(){
    public Integer call() throws Exception {
      final ObservableList<?> items=getRealComponent().getItems();
      int itemCount=items != null ? items.size() : -1;
      return new Integer(itemCount);
    }
  }
).intValue();
  if (index >= actualItemCount || (index < 0)) {
    throw new StepExecutionException("String_Node_Str" + index + "String_Node_Str",EventFactory.createActionError(TestErrorEvent.INVALID_INDEX));
  }
  EventThreadQueuerJavaFXImpl.invokeAndWait("String_Node_Str",new Callable<Rectangle>(){
    public Rectangle call() throws Exception {
      final T listView=getRealComponent();
      listView.layout();
      listView.scrollTo(index.intValue());
      return null;
    }
  }
);
  TimeUtil.delay(100);
  Rectangle r=scrollToAndGetRectangle(index);
  getRobot().click(getRealComponent(),r,co.setClickType(ClickOptions.ClickType.RELEASED));
}
Program: 95380
Project: 95380
Buggy source:
/** 
 * @param dto the DTO to 
 * @param assignNewUuid if there should be a new Uuid
 * @return a {@link ICommentPO}
 */
private ICommentPO createComment(CommentDTO dto,boolean assignNewUuid){
  if (dto.getUuid() != null && !assignNewUuid) {
    return NodeMaker.createCommentPO(dto.getName(),dto.getUuid());
  }
  return NodeMaker.createCommentPO(dto.getName());
}

Fixed version (ground truth):
/** 
 * @param dto the DTO to 
 * @param assignNewUuid if there should be a new Uuid
 * @return a {@link ICommentPO}
 */
private ICommentPO createComment(CommentDTO dto,boolean assignNewUuid){
  ICommentPO comment;
  if (dto.getUuid() != null && !assignNewUuid) {
    comment=NodeMaker.createCommentPO(dto.getName(),dto.getUuid());
  }
 else {
    comment=NodeMaker.createCommentPO(dto.getName());
  }
  comment.setActive(dto.isActive());
  return comment;
}
Program: 95381
Project: 95381
Buggy source:
/** 
 * Remove a change Listener
 */
public void removeChangeListener(){
  Object children=ChildrenGetter.getAsRealType(getComponent());
  EventTarget component=getComponent();
  if (component instanceof Node) {
    ((Node)component).visibleProperty().removeListener(VisibleChangeHandler.INSTACE);
  }
  if (children instanceof ObjectProperty) {
    ChildrenListenerHelper.removeListener((ObjectProperty<? extends EventTarget>)children);
  }
 else   if (children instanceof ObservableList) {
    ChildrenListenerHelper.removeListener((ObservableList<? extends EventTarget>)children);
  }
}

Fixed version (ground truth):
/** 
 * Remove a change Listener
 */
@SuppressWarnings("String_Node_Str") public void removeChangeListener(){
  Object children=ChildrenGetter.getAsRealType(getComponent());
  EventTarget component=getComponent();
  if (component instanceof Node) {
    Node node=(Node)component;
    node.visibleProperty().removeListener(VisibleChangeHandler.INSTACE);
    node.idProperty().removeListener(m_iDChangeListener);
  }
  if (children instanceof ObjectProperty) {
    ChildrenListenerHelper.removeListener((ObjectProperty<? extends EventTarget>)children);
  }
 else   if (children instanceof ObservableList) {
    ChildrenListenerHelper.removeListener((ObservableList<? extends EventTarget>)children);
  }
}
Program: 95382
Project: 95382
Buggy source:
/** 
 * Add a change Listener
 * @param component the component
 */
public void addChangeListener(EventTarget component){
  if (component instanceof Node) {
    ((Node)component).visibleProperty().addListener(new WeakChangeListener<Boolean>(VisibleChangeHandler.INSTACE));
  }
  Object children=ChildrenGetter.getAsRealType(component);
  if (children instanceof ReadOnlyObjectProperty) {
    ChildrenListenerHelper.addListener((ReadOnlyObjectProperty<? extends EventTarget>)children);
  }
 else   if (children instanceof ObservableList) {
    ChildrenListenerHelper.addListener((ObservableList<? extends EventTarget>)children);
  }
}

Fixed version (ground truth):
/** 
 * Add a change Listener
 * @param component the component
 */
@SuppressWarnings("String_Node_Str") public void addChangeListener(EventTarget component){
  if (component instanceof Node) {
    ((Node)component).visibleProperty().addListener(VisibleChangeHandler.INSTACE);
    ((Node)component).idProperty().addListener(m_iDChangeListener);
  }
  Object children=ChildrenGetter.getAsRealType(component);
  if (children instanceof ReadOnlyObjectProperty) {
    ChildrenListenerHelper.addListener((ReadOnlyObjectProperty<? extends EventTarget>)children);
  }
 else   if (children instanceof ObservableList) {
    ChildrenListenerHelper.addListener((ObservableList<? extends EventTarget>)children);
  }
}
Program: 95384
Project: 95384
Buggy source:
/** 
 * {@inheritDoc} 
 */
public void disconnect(){
  if (isConnected()) {
    m_instance.close();
  }
 else {
    throw new IllegalStateException("String_Node_Str");
  }
  Thread.interrupted();
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public void disconnect(){
  if (isConnected()) {
    m_instance.getCommunicator().setIsServerSocketClosable(true);
    m_instance.close();
  }
 else {
    throw new IllegalStateException("String_Node_Str");
  }
  Thread.interrupted();
}
Program: 95385
Project: 95385
Buggy source:
/** 
 * Remove a change Listener
 */
@SuppressWarnings("String_Node_Str") public void removeChangeListener(){
  Object children=ChildrenGetter.getAsRealType(getComponent());
  EventTarget component=getComponent();
  if (component instanceof Node) {
    Node node=(Node)component;
    node.visibleProperty().removeListener(VisibleChangeHandler.INSTACE);
    node.idProperty().removeListener(m_iDChangeListener);
  }
  if (children instanceof ObjectProperty) {
    ChildrenListenerHelper.removeListener((ObjectProperty<? extends EventTarget>)children);
  }
 else   if (children instanceof ObservableList) {
    ChildrenListenerHelper.removeListener((ObservableList<? extends EventTarget>)children);
  }
}

Fixed version (ground truth):
/** 
 * Remove a change Listener
 */
@SuppressWarnings("String_Node_Str") public void removeChangeListener(){
  Object children=ChildrenGetter.getAsRealType(getComponent());
  EventTarget component=getComponent();
  if (children instanceof ObjectProperty) {
    ChildrenListenerHelper.removeListener((ObjectProperty<? extends EventTarget>)children);
  }
 else   if (children instanceof ObservableList) {
    ChildrenListenerHelper.removeListener((ObservableList<? extends EventTarget>)children);
  }
}
Program: 95386
Project: 95386
Buggy source:
/** 
 * Add a change Listener
 * @param component the component
 */
@SuppressWarnings("String_Node_Str") public void addChangeListener(EventTarget component){
  if (component instanceof Node) {
    ((Node)component).visibleProperty().addListener(VisibleChangeHandler.INSTACE);
    ((Node)component).idProperty().addListener(m_iDChangeListener);
  }
  Object children=ChildrenGetter.getAsRealType(component);
  if (children instanceof ReadOnlyObjectProperty) {
    ChildrenListenerHelper.addListener((ReadOnlyObjectProperty<? extends EventTarget>)children);
  }
 else   if (children instanceof ObservableList) {
    ChildrenListenerHelper.addListener((ObservableList<? extends EventTarget>)children);
  }
}

Fixed version (ground truth):
/** 
 * Add a change Listener
 * @param component the component
 */
@SuppressWarnings("String_Node_Str") public void addChangeListener(EventTarget component){
  if (component instanceof Node) {
    Node node=(Node)component;
    node.visibleProperty().addListener(VisibleChangeHandler.INSTACE);
    node.idProperty().addListener(idChangeListener);
  }
  Object children=ChildrenGetter.getAsRealType(component);
  if (children instanceof ReadOnlyObjectProperty) {
    ChildrenListenerHelper.addListener((ReadOnlyObjectProperty<? extends EventTarget>)children);
  }
 else   if (children instanceof ObservableList) {
    ChildrenListenerHelper.addListener((ObservableList<? extends EventTarget>)children);
  }
}
Program: 95387
Project: 95387
Buggy source:
@Override public void changed(ObservableValue<? extends T> observable,T oldValue,T newValue){
  if (observable instanceof ReadOnlyProperty) {
    @SuppressWarnings("String_Node_Str") Object bean=((ReadOnlyProperty)observable).getBean();
    if (bean instanceof EventTarget && !newValue.equals(oldValue)) {
      EventTarget eventTarget=(EventTarget)bean;
      AUTJavaFXHierarchy hierarchy=ComponentHandler.getAutHierarchy();
      hierarchy.removeComponentFromHierarchy(eventTarget);
      hierarchy.createHierarchyFrom(eventTarget);
    }
  }
}

Fixed version (ground truth):
@Override public void changed(ObservableValue<? extends T> observable,T oldValue,T newValue){
  if (observable instanceof ReadOnlyProperty) {
    @SuppressWarnings("String_Node_Str") Object bean=((ReadOnlyProperty)observable).getBean();
    if (bean instanceof EventTarget && !newValue.equals(oldValue)) {
      EventTarget eventTarget=(EventTarget)bean;
      AUTJavaFXHierarchy hierarchy=ComponentHandler.getAutHierarchy();
      try {
        if (hierarchy.getComponentIdentifier(eventTarget) != null) {
          hierarchy.removeComponentFromHierarchy(eventTarget);
          hierarchy.createHierarchyFrom(eventTarget);
        }
      }
 catch (      ComponentNotManagedException e) {
      }
    }
  }
}
Program: 95388
Project: 95388
Buggy source:
@Override public String getText(){
  return EventThreadQueuerJavaFXImpl.invokeAndWait("String_Node_Str",new Callable<String>(){
    @Override public String call() throws Exception {
      ObservableList<Node> children=getRealComponent().getChildrenUnmodifiable();
      for (      Node node : children) {
        if (node instanceof ListCell) {
          IComponent adapter=(IComponent)AdapterFactoryRegistry.getInstance().getAdapter(IComponent.class,node);
          if (adapter != null && adapter instanceof ITextComponent) {
            return ((ITextComponent)adapter).getText();
          }
        }
      }
      return null;
    }
  }
);
}

Fixed version (ground truth):
@Override public String getText(){
  return EventThreadQueuerJavaFXImpl.invokeAndWait("String_Node_Str",new Callable<String>(){
    @Override public String call() throws Exception {
      T comboBox=getRealComponent();
      if (comboBox.isEditable()) {
        TextField editor=comboBox.getEditor();
        if (editor != null) {
          return editor.getText();
        }
      }
      ObservableList<Node> children=comboBox.getChildrenUnmodifiable();
      for (      Node node : children) {
        if (node instanceof ListCell) {
          IComponent adapter=(IComponent)AdapterFactoryRegistry.getInstance().getAdapter(IComponent.class,node);
          if (adapter != null && adapter instanceof ITextComponent) {
            return ((ITextComponent)adapter).getText();
          }
        }
      }
      return null;
    }
  }
);
}
Program: 95390
Project: 95390
Buggy source:
@Override public void rcDropValue(String value,String operator,String searchType,int delayBeforeDrop){
  final DragAndDropHelper dndHelper=DragAndDropHelper.getInstance();
  try {
    ListCell<?> targetCell=((ListViewAdapter<ListView<?>>)getComponent()).getCell(value);
    if (targetCell == null) {
      throw new StepExecutionException("String_Node_Str",EventFactory.createActionError(TestErrorEvent.NOT_VISIBLE));
    }
    rcSelectValue(value,operator,searchType,BinaryChoice.no.rcValue(),dndHelper.getMouseButton(),0);
    waitBeforeDrop(delayBeforeDrop);
  }
  finally {
    getRobot().mouseRelease(null,null,dndHelper.getMouseButton());
    pressOrReleaseModifiers(dndHelper.getModifier(),false);
    Node listView=((Node)getRealComponent());
    listView.removeEventFilter(ScrollToEvent.ANY,m_scrollConsumer);
    dndHelper.setDragMode(false);
  }
}

Fixed version (ground truth):
@Override public void rcDropValue(String value,String operator,String searchType,int delayBeforeDrop){
  final DragAndDropHelper dndHelper=DragAndDropHelper.getInstance();
  try {
    ListCell<?> targetCell=((ListViewAdapter<ListView<?>>)getComponent()).getCell(value);
    if (targetCell == null) {
      throw new StepExecutionException("String_Node_Str",EventFactory.createActionError(TestErrorEvent.NOT_VISIBLE));
    }
    rcSelectValue(value,operator,searchType,BinaryChoice.no.rcValue(),dndHelper.getMouseButton(),0);
    getRobot().shakeMouse();
    waitBeforeDrop(delayBeforeDrop);
  }
  finally {
    getRobot().mouseRelease(null,null,dndHelper.getMouseButton());
    pressOrReleaseModifiers(dndHelper.getModifier(),false);
    Node listView=((Node)getRealComponent());
    listView.removeEventFilter(ScrollToEvent.ANY,m_scrollConsumer);
    dndHelper.setDragMode(false);
  }
}
Program: 95391
Project: 95391
Buggy source:
@Override public void rcDropIndex(int index,int delayBeforeDrop){
  final DragAndDropHelper dndHelper=DragAndDropHelper.getInstance();
  try {
    ListCell<?> targetCell=((ListViewAdapter<ListView<?>>)getComponent()).getCell(index);
    if (targetCell == null) {
      throw new StepExecutionException("String_Node_Str",EventFactory.createActionError(TestErrorEvent.NOT_VISIBLE));
    }
    rcSelectIndex(String.valueOf(index),BinaryChoice.no.rcValue(),dndHelper.getMouseButton(),0);
    waitBeforeDrop(delayBeforeDrop);
  }
  finally {
    getRobot().mouseRelease(null,null,dndHelper.getMouseButton());
    pressOrReleaseModifiers(dndHelper.getModifier(),false);
    Node listView=((Node)getRealComponent());
    listView.removeEventFilter(ScrollToEvent.ANY,m_scrollConsumer);
    dndHelper.setDragMode(false);
  }
}

Fixed version (ground truth):
@Override public void rcDropIndex(int index,int delayBeforeDrop){
  final DragAndDropHelper dndHelper=DragAndDropHelper.getInstance();
  try {
    ListCell<?> targetCell=((ListViewAdapter<ListView<?>>)getComponent()).getCell(index);
    if (targetCell == null) {
      throw new StepExecutionException("String_Node_Str",EventFactory.createActionError(TestErrorEvent.NOT_VISIBLE));
    }
    rcSelectIndex(String.valueOf(index),BinaryChoice.no.rcValue(),dndHelper.getMouseButton(),0);
    getRobot().shakeMouse();
    waitBeforeDrop(delayBeforeDrop);
  }
  finally {
    getRobot().mouseRelease(null,null,dndHelper.getMouseButton());
    pressOrReleaseModifiers(dndHelper.getModifier(),false);
    Node listView=((Node)getRealComponent());
    listView.removeEventFilter(ScrollToEvent.ANY,m_scrollConsumer);
    dndHelper.setDragMode(false);
  }
}
Program: 95392
Project: 95392
Buggy source:
@Override public void rcDropRowByValue(String col,String colOperator,String value,String regexOp,String searchType,int delayBeforeDrop){
  try {
    TableAdapter adapter=(TableAdapter)getComponent();
    int implCol=adapter.getColumnFromString(col,colOperator);
    int implRow=super.findRow(value,regexOp,searchType,adapter,implCol);
    TableCell targetCell=getCellAt(implRow + 1,implCol + 1);
    if (targetCell == null) {
      throw new StepExecutionException("String_Node_Str",EventFactory.createActionError(TestErrorEvent.NOT_VISIBLE));
    }
    super.rcDropRowByValue(col,colOperator,value,regexOp,searchType,delayBeforeDrop);
  }
  finally {
    Node table=((Node)getRealComponent());
    table.removeEventFilter(ScrollToEvent.ANY,m_scrollConsumer);
    DragAndDropHelper dndHelper=DragAndDropHelper.getInstance();
    getRobot().mouseRelease(null,null,dndHelper.getMouseButton());
    pressOrReleaseModifiers(dndHelper.getModifier(),false);
    dndHelper.setDragMode(false);
  }
}

Fixed version (ground truth):
@Override public void rcDropRowByValue(String col,String colOperator,String value,String regexOp,String searchType,int delayBeforeDrop){
  try {
    TableAdapter adapter=(TableAdapter)getComponent();
    int implCol=adapter.getColumnFromString(col,colOperator);
    int implRow=super.findRow(value,regexOp,searchType,adapter,implCol);
    TableCell targetCell=getCellAt(implRow + 1,implCol + 1);
    if (targetCell == null) {
      throw new StepExecutionException("String_Node_Str",EventFactory.createActionError(TestErrorEvent.NOT_VISIBLE));
    }
    super.rcDropRowByValue(col,colOperator,value,regexOp,searchType,delayBeforeDrop);
  }
  finally {
    Node table=((Node)getRealComponent());
    table.removeEventFilter(ScrollToEvent.ANY,m_scrollConsumer);
    DragAndDropHelper dndHelper=DragAndDropHelper.getInstance();
    getRobot().mouseRelease(null,null,dndHelper.getMouseButton());
    try {
      pressOrReleaseModifiers(dndHelper.getModifier(),false);
    }
 catch (    RobotException e) {
      if (!EnvironmentUtils.isLinuxOS()) {
        throw e;
      }
    }
    dndHelper.setDragMode(false);
  }
}
Program: 95393
Project: 95393
Buggy source:
@Override public void rcDropCellByColValue(String row,String rowOperator,String value,String regex,String searchType,int delayBeforeDrop){
  try {
    TableAdapter adapter=(TableAdapter)getComponent();
    int implRow=adapter.getRowFromString(row,rowOperator);
    int implCol=super.findColumn(value,regex,searchType,adapter,implRow);
    TableCell targetCell=getCellAt(implRow + 1,implCol + 1);
    if (targetCell == null) {
      throw new StepExecutionException("String_Node_Str",EventFactory.createActionError(TestErrorEvent.NOT_VISIBLE));
    }
    super.rcDropCellByColValue(row,rowOperator,value,regex,searchType,delayBeforeDrop);
  }
  finally {
    Node table=((Node)getRealComponent());
    table.removeEventFilter(ScrollToEvent.ANY,m_scrollConsumer);
    DragAndDropHelper dndHelper=DragAndDropHelper.getInstance();
    getRobot().mouseRelease(null,null,dndHelper.getMouseButton());
    pressOrReleaseModifiers(dndHelper.getModifier(),false);
    dndHelper.setDragMode(false);
  }
}

Fixed version (ground truth):
@Override public void rcDropCellByColValue(String row,String rowOperator,String value,String regex,String searchType,int delayBeforeDrop){
  try {
    TableAdapter adapter=(TableAdapter)getComponent();
    int implRow=adapter.getRowFromString(row,rowOperator);
    int implCol=super.findColumn(value,regex,searchType,adapter,implRow);
    TableCell targetCell=getCellAt(implRow + 1,implCol + 1);
    if (targetCell == null) {
      throw new StepExecutionException("String_Node_Str",EventFactory.createActionError(TestErrorEvent.NOT_VISIBLE));
    }
    super.rcDropCellByColValue(row,rowOperator,value,regex,searchType,delayBeforeDrop);
  }
  finally {
    Node table=((Node)getRealComponent());
    table.removeEventFilter(ScrollToEvent.ANY,m_scrollConsumer);
    DragAndDropHelper dndHelper=DragAndDropHelper.getInstance();
    getRobot().mouseRelease(null,null,dndHelper.getMouseButton());
    try {
      pressOrReleaseModifiers(dndHelper.getModifier(),false);
    }
 catch (    RobotException e) {
      if (!EnvironmentUtils.isLinuxOS()) {
        throw e;
      }
    }
    dndHelper.setDragMode(false);
  }
}
Program: 95394
Project: 95394
Buggy source:
@Override public void rcDropCell(String row,String rowOperator,String col,String colOperator,int xPos,String xUnits,int yPos,String yUnits,int delayBeforeDrop) throws StepExecutionException {
  try {
    TableAdapter adapter=(TableAdapter)getComponent();
    int implRow=adapter.getRowFromString(row,rowOperator);
    int implCol=adapter.getColumnFromString(col,colOperator);
    TableCell targetCell=getCellAt(implRow + 1,implCol + 1);
    if (targetCell == null) {
      throw new StepExecutionException("String_Node_Str",EventFactory.createActionError(TestErrorEvent.NOT_VISIBLE));
    }
    super.rcDropCell(row,rowOperator,col,colOperator,xPos,xUnits,yPos,yUnits,delayBeforeDrop);
  }
  finally {
    Node table=((Node)getRealComponent());
    table.removeEventFilter(ScrollToEvent.ANY,m_scrollConsumer);
    DragAndDropHelper dndHelper=DragAndDropHelper.getInstance();
    getRobot().mouseRelease(null,null,dndHelper.getMouseButton());
    pressOrReleaseModifiers(dndHelper.getModifier(),false);
    dndHelper.setDragMode(false);
  }
}

Fixed version (ground truth):
@Override public void rcDropCell(String row,String rowOperator,String col,String colOperator,int xPos,String xUnits,int yPos,String yUnits,int delayBeforeDrop) throws StepExecutionException {
  try {
    TableAdapter adapter=(TableAdapter)getComponent();
    int implRow=adapter.getRowFromString(row,rowOperator);
    int implCol=adapter.getColumnFromString(col,colOperator);
    TableCell targetCell=getCellAt(implRow + 1,implCol + 1);
    if (targetCell == null) {
      throw new StepExecutionException("String_Node_Str",EventFactory.createActionError(TestErrorEvent.NOT_VISIBLE));
    }
    super.rcDropCell(row,rowOperator,col,colOperator,xPos,xUnits,yPos,yUnits,delayBeforeDrop);
  }
  finally {
    Node table=((Node)getRealComponent());
    table.removeEventFilter(ScrollToEvent.ANY,m_scrollConsumer);
    DragAndDropHelper dndHelper=DragAndDropHelper.getInstance();
    getRobot().mouseRelease(null,null,dndHelper.getMouseButton());
    try {
      pressOrReleaseModifiers(dndHelper.getModifier(),false);
    }
 catch (    RobotException e) {
      if (!EnvironmentUtils.isLinuxOS()) {
        throw e;
      }
    }
    dndHelper.setDragMode(false);
  }
}
Program: 95395
Project: 95395
Buggy source:
/** 
 * inputs/replaces the given text
 * @param text the text to input
 * @param replace whether to replace or not
 * @param cell {@link Cell} the location of a Cell
 * @throws StepExecutionException If there is no selected cell,or if the cell is not editable, or if the table cell editor permits the text to be written.
 */
private void inputText(final String text,boolean replace,Cell cell) throws StepExecutionException {
  ITableComponent adapter=getTableAdapter();
  Rectangle rectangle=adapter.scrollCellToVisible(cell.getRow(),cell.getCol());
  Object editor=activateEditor(cell,rectangle);
  editor=setEditorToReplaceMode(editor,replace);
  getRobot().type(editor,text);
}

Fixed version (ground truth):
/** 
 * inputs/replaces the given text
 * @param text the text to input
 * @param replace whether to replace or not
 * @param cell {@link Cell} the location of a Cell
 * @throws StepExecutionException If there is no selected cell,or if the cell is not editable, or if the table cell editor permits the text to be written.
 */
private void inputText(final String text,boolean replace,Cell cell) throws StepExecutionException {
  ITableComponent adapter=getTableAdapter();
  Rectangle rectangle=adapter.scrollCellToVisible(cell.getRow(),cell.getCol());
  Object editor=activateEditor(cell,rectangle);
  editor=setEditorToReplaceMode(editor,replace);
  getRobot().type(editor,text);
  if (replace) {
    getRobot().keyType(null,SWT.CR);
  }
}
Program: 95396
Project: 95396
Buggy source:
/** 
 * {@inheritDoc}
 */
public Rectangle scrollCellToVisible(final int row,final int col) throws StepExecutionException {
  final Table table=m_table;
  getEventThreadQueuer().invokeAndWait("String_Node_Str",new IRunnable<Void>(){
    public Void run(){
      if (table.getColumnCount() > 0 || col > 0) {
        table.showColumn(table.getColumn(col));
      }
      table.showItem(table.getItem(row));
      return null;
    }
  }
);
  ((SwtRobot)getRobot()).waitForIdle();
  checkRowColBounds(row,col);
  final org.eclipse.swt.graphics.Rectangle cBoundsRelToParent=SwtPointUtil.toSwtRectangle(getCellBounds(row,col,true));
  getEventThreadQueuer().invokeAndWait("String_Node_Str",new IRunnable<Void>(){
    public Void run(){
      org.eclipse.swt.graphics.Point cOriginRelToParent=table.getDisplay().map(table,table.getParent(),new org.eclipse.swt.graphics.Point(cBoundsRelToParent.x,cBoundsRelToParent.y));
      cBoundsRelToParent.x=cOriginRelToParent.x;
      cBoundsRelToParent.y=cOriginRelToParent.y;
      return null;
    }
  }
);
  Control parent=getEventThreadQueuer().invokeAndWait("String_Node_Str",new IRunnable<Control>(){
    public Control run(){
      return table.getParent();
    }
  }
);
  getRobot().scrollToVisible(parent,cBoundsRelToParent);
  ((SwtRobot)getRobot()).waitForIdle();
  return getVisibleBounds(getCellBounds(row,col,true));
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public Rectangle scrollCellToVisible(final int row,final int col) throws StepExecutionException {
  final Table table=m_table;
  getEventThreadQueuer().invokeAndWait("String_Node_Str",new IRunnable<Void>(){
    public Void run(){
      if (table.getColumnCount() > 0 || col > 0) {
        table.showColumn(table.getColumn(col));
      }
      table.showItem(table.getItem(row));
      return null;
    }
  }
);
  checkRowColBounds(row,col);
  final org.eclipse.swt.graphics.Rectangle cBoundsRelToParent=SwtPointUtil.toSwtRectangle(getCellBounds(row,col,true));
  getEventThreadQueuer().invokeAndWait("String_Node_Str",new IRunnable<Void>(){
    public Void run(){
      org.eclipse.swt.graphics.Point cOriginRelToParent=table.getDisplay().map(table,table.getParent(),new org.eclipse.swt.graphics.Point(cBoundsRelToParent.x,cBoundsRelToParent.y));
      cBoundsRelToParent.x=cOriginRelToParent.x;
      cBoundsRelToParent.y=cOriginRelToParent.y;
      return null;
    }
  }
);
  Control parent=getEventThreadQueuer().invokeAndWait("String_Node_Str",new IRunnable<Control>(){
    public Control run(){
      return table.getParent();
    }
  }
);
  getRobot().scrollToVisible(parent,cBoundsRelToParent);
  return getVisibleBounds(getCellBounds(row,col,true));
}
Program: 95398
Project: 95398
Buggy source:
public void doubleClick(DoubleClickEvent event){
  if (!m_addButton.getEnabled()) {
    return;
  }
  notifyListener();
  setReturnCode(ADD);
  close();
}

Fixed version (ground truth):
public void doubleClick(DoubleClickEvent event){
  if (!m_addButton.getEnabled()) {
    return;
  }
  notifyListener();
  setReturnCode(IDialogConstants.OK_ID);
  close();
}
Program: 95399
Project: 95399
Buggy source:
/** 
 * Asks from the user the new TC name and the category where to save it. Includes business logic to handle 'Back' button when choosing Category.
 * @param editor the Test Case Editor
 * @return whether the operation can commence
 */
protected boolean askNewNameAndCategory(AbstractTestCaseEditor editor){
  TestCaseTreeDialog dialog=new TestCaseTreeDialog(getActiveShell(),Messages.SelectCategoryDialogTitle,Messages.SelectCategoryDialogMessage,null,Messages.SelectCategoryDialogTitle,SWT.SINGLE,IconConstants.OPEN_TC_DIALOG_IMAGE);
  dialog.setReuseds(false);
  dialog.setOnlyCategories(true);
  dialog.setEnterTextLabel(Messages.RefactorTCOptTextLabel,getSuggestedName(editor));
  dialog.setPreSelect(GeneralStorage.getInstance().getProject().getSpecObjCont());
  dialog.open();
  if (dialog.getReturnCode() != TestCaseTreeDialog.ADD || dialog.getSelection().isEmpty()) {
    return false;
  }
  m_newTCName=dialog.getEnteredText();
  m_selectedCategory=dialog.getSelection().get(0);
  return m_newTCName != null && m_selectedCategory != null;
}

Fixed version (ground truth):
/** 
 * Asks from the user the new TC name and the category where to save it. Includes business logic to handle 'Back' button when choosing Category.
 * @param editor the Test Case Editor
 * @return whether the operation can commence
 */
protected boolean askNewNameAndCategory(AbstractTestCaseEditor editor){
  TestCaseTreeDialog dialog=new TestCaseTreeDialog(getActiveShell(),Messages.SelectCategoryDialogTitle,Messages.SelectCategoryDialogMessage,null,Messages.SelectCategoryDialogTitle,SWT.SINGLE,IconConstants.OPEN_TC_DIALOG_IMAGE);
  dialog.setReuseds(false);
  dialog.setOnlyCategories(true);
  dialog.setEnterTextLabel(Messages.RefactorTCOptTextLabel,getSuggestedName(editor));
  dialog.setPreSelect(GeneralStorage.getInstance().getProject().getSpecObjCont());
  dialog.open();
  if (dialog.getReturnCode() != IDialogConstants.OK_ID || dialog.getSelection().isEmpty()) {
    return false;
  }
  m_newTCName=dialog.getEnteredText();
  m_selectedCategory=dialog.getSelection().get(0);
  return m_newTCName != null && m_selectedCategory != null;
}
Program: 95400
Project: 95400
Buggy source:
/** 
 * Opens the PopUp with the TestCaseTree.
 * @param editor The test case editor.
 */
private void openTestCasePopUp(final TestCaseEditor editor){
  final ISpecTestCasePO parentNode=(ISpecTestCasePO)editor.getTreeViewer().getTree().getItem(0).getData();
  if (hasTestCaseAllEventHandler(parentNode)) {
    return;
  }
  String title=Messages.AddEventHandlerActionAddEventHandler;
  TestCaseTreeDialog dialog=new TestCaseTreeDialog(getActiveShell(),title,StringConstants.EMPTY,parentNode,title,SWT.SINGLE,IconConstants.ADD_EH_IMAGE);
  final SelectionTransfer selTransferObj=new SelectionTransfer();
  ISelectionListener selListener=new ISelectionListener(){
    public void selectionChanged(    IWorkbenchPart part,    ISelection selection){
      selTransferObj.setSelection(selection);
    }
  }
;
  dialog.addSelectionListener(selListener);
  dialog.setHelpAvailable(true);
  dialog.create();
  DialogUtils.setWidgetNameForModalDialog(dialog);
  Plugin.getHelpSystem().setHelp(dialog.getShell(),ContextHelpIds.EVENT_HANDLER_ADD);
  int returnCode=dialog.open();
  if (returnCode == TestCaseTreeDialog.ADD) {
    addEventHandler(selTransferObj.getSelection(),parentNode,editor);
  }
  dialog.removeSelectionListener(selListener);
}

Fixed version (ground truth):
/** 
 * Opens the PopUp with the TestCaseTree.
 * @param editor The test case editor.
 */
private void openTestCasePopUp(final TestCaseEditor editor){
  final ISpecTestCasePO parentNode=(ISpecTestCasePO)editor.getTreeViewer().getTree().getItem(0).getData();
  if (hasTestCaseAllEventHandler(parentNode)) {
    return;
  }
  String title=Messages.AddEventHandlerActionAddEventHandler;
  TestCaseTreeDialog dialog=new TestCaseTreeDialog(getActiveShell(),title,StringConstants.EMPTY,parentNode,title,SWT.SINGLE,IconConstants.ADD_EH_IMAGE);
  final SelectionTransfer selTransferObj=new SelectionTransfer();
  ISelectionListener selListener=new ISelectionListener(){
    public void selectionChanged(    IWorkbenchPart part,    ISelection selection){
      selTransferObj.setSelection(selection);
    }
  }
;
  dialog.addSelectionListener(selListener);
  dialog.setHelpAvailable(true);
  dialog.create();
  DialogUtils.setWidgetNameForModalDialog(dialog);
  Plugin.getHelpSystem().setHelp(dialog.getShell(),ContextHelpIds.EVENT_HANDLER_ADD);
  int returnCode=dialog.open();
  if (returnCode == IDialogConstants.OK_ID) {
    addEventHandler(selTransferObj.getSelection(),parentNode,editor);
  }
  dialog.removeSelectionListener(selListener);
}
Program: 95401
Project: 95401
Buggy source:
/** 
 * {@inheritDoc}
 */
public Collection<String> getNodeTextList(final TreeItem node){
  final Collection<String> res=new ArrayList<String>();
  getQueuer().invokeAndWait("String_Node_Str" + node,new IRunnable<Void>(){
    public Void run(){
      int colCount=getTree().getColumnCount();
      for (int i=0; i < colCount; i++) {
        String textAtColumn=CAPUtil.getWidgetText(node,SwtToolkitConstants.WIDGET_TEXT_KEY_PREFIX + i,node.getText(i));
        if (textAtColumn != null) {
          res.add(textAtColumn);
        }
      }
      String text=CAPUtil.getWidgetText(node,node.getText());
      if (text != null) {
        res.add(text);
      }
      return null;
    }
  }
);
  return res;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public Collection<String> getNodeTextList(final TreeItem node){
  final Collection<String> res=new ArrayList<String>();
  getQueuer().invokeAndWait("String_Node_Str" + node,new IRunnable<Void>(){
    public Void run(){
      String textAtColumn=getRenderedText(node);
      if (textAtColumn != null) {
        res.add(textAtColumn);
      }
      String text=node.getText(getColumn());
      if (text != null) {
        res.add(text);
      }
      return null;
    }
  }
);
  return res;
}
Program: 95402
Project: 95402
Buggy source:
public void run(IPersistentObject workingPo){
  final INodePO editorNode=(INodePO)workingPo;
  final INodePO node=(INodePO)getSelection().getFirstElement();
  if (node == null) {
    return;
  }
  ISelectionListener listener=getSelectionListener(tce,editorNode,node);
  ISpecTestCasePO specTC=null;
  if (editorNode instanceof ISpecTestCasePO) {
    specTC=(ISpecTestCasePO)editorNode;
  }
  TestCaseTreeDialog dialog=new TestCaseTreeDialog(getActiveShell(),specTC,SWT.MULTI);
  dialog.addSelectionListener(listener);
  dialog.setHelpAvailable(true);
  dialog.create();
  DialogUtils.setWidgetNameForModalDialog(dialog);
  Plugin.getHelpSystem().setHelp(dialog.getShell(),ContextHelpIds.TESTCASE_ADD_EXISTING);
  dialog.open();
  dialog.removeSelectionListener(listener);
}

Fixed version (ground truth):
public void run(IPersistentObject workingPo){
  final INodePO editorNode=(INodePO)workingPo;
  final INodePO node=(INodePO)getSelection().getFirstElement();
  if (node == null) {
    return;
  }
  ISpecTestCasePO specTC=null;
  if (editorNode instanceof ISpecTestCasePO) {
    specTC=(ISpecTestCasePO)editorNode;
  }
  TestCaseTreeDialog dialog=new TestCaseTreeDialog(getActiveShell(),specTC,SWT.MULTI);
  dialog.setHelpAvailable(true);
  dialog.create();
  DialogUtils.setWidgetNameForModalDialog(dialog);
  Plugin.getHelpSystem().setHelp(dialog.getShell(),ContextHelpIds.TESTCASE_ADD_EXISTING);
  if (dialog.open() == IDialogConstants.OK_ID) {
    addNewNodes(tce,node,dialog.getSelection());
  }
}
Program: 95403
Project: 95403
Buggy source:
/** 
 * {@inheritDoc}
 */
public Object executeImpl(ExecutionEvent event){
  final AbstractTestCaseEditor tce=(AbstractTestCaseEditor)HandlerUtil.getActiveEditor(event);
  tce.getEditorHelper().doEditorOperation(new IEditorOperation(){
    public void run(    IPersistentObject workingPo){
      final INodePO editorNode=(INodePO)workingPo;
      final INodePO node=(INodePO)getSelection().getFirstElement();
      if (node == null) {
        return;
      }
      ISelectionListener listener=getSelectionListener(tce,editorNode,node);
      ISpecTestCasePO specTC=null;
      if (editorNode instanceof ISpecTestCasePO) {
        specTC=(ISpecTestCasePO)editorNode;
      }
      TestCaseTreeDialog dialog=new TestCaseTreeDialog(getActiveShell(),specTC,SWT.MULTI);
      dialog.addSelectionListener(listener);
      dialog.setHelpAvailable(true);
      dialog.create();
      DialogUtils.setWidgetNameForModalDialog(dialog);
      Plugin.getHelpSystem().setHelp(dialog.getShell(),ContextHelpIds.TESTCASE_ADD_EXISTING);
      dialog.open();
      dialog.removeSelectionListener(listener);
    }
  }
);
  return null;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public Object executeImpl(ExecutionEvent event){
  final AbstractTestCaseEditor tce=(AbstractTestCaseEditor)HandlerUtil.getActiveEditor(event);
  tce.getEditorHelper().doEditorOperation(new IEditorOperation(){
    public void run(    IPersistentObject workingPo){
      final INodePO editorNode=(INodePO)workingPo;
      final INodePO node=(INodePO)getSelection().getFirstElement();
      if (node == null) {
        return;
      }
      ISpecTestCasePO specTC=null;
      if (editorNode instanceof ISpecTestCasePO) {
        specTC=(ISpecTestCasePO)editorNode;
      }
      TestCaseTreeDialog dialog=new TestCaseTreeDialog(getActiveShell(),specTC,SWT.MULTI);
      dialog.setHelpAvailable(true);
      dialog.create();
      DialogUtils.setWidgetNameForModalDialog(dialog);
      Plugin.getHelpSystem().setHelp(dialog.getShell(),ContextHelpIds.TESTCASE_ADD_EXISTING);
      if (dialog.open() == IDialogConstants.OK_ID) {
        addNewNodes(tce,node,dialog.getSelection());
      }
    }
  }
);
  return null;
}