nus-yam/ex-repair huggingface dataset:
Program: 95876
Project: 95876
Buggy source:
/** 
 * Write the information from the Object to its corresponding XML element.
 * @param xml The XML element to be filled
 * @param po The persistent object which contains the information
 */
private void fillRefTestCase(RefTestCase xml,IExecTestCasePO po){
  fillNode(xml,po);
  checkForCancel();
  String execName=po.getRealName();
  if (execName == null) {
    execName=StringConstants.EMPTY;
  }
  if (po.getSpecTestCase() != null) {
    String specName=po.getSpecTestCase().getName();
    if (execName.equals(specName)) {
      xml.setName(null);
    }
 else {
      xml.setName(execName);
    }
  }
 else {
    xml.setName(execName);
  }
  xml.setTestcaseGuid(po.getSpecTestCaseGuid());
  if (po.getProjectGuid() != null) {
    xml.setProjectGuid(po.getProjectGuid());
  }
  xml.setHasOwnTestdata(!po.getHasReferencedTD());
  xml.setDatafile(po.getDataFile());
  if (po.getReferencedDataCube() != null) {
    xml.setReferencedTestData(po.getReferencedDataCube().getName());
  }
  if (!po.getHasReferencedTD()) {
    final ITDManager dataManager=po.getDataManager();
    if (dataManager != null) {
      TestData xmlTD=xml.addNewTestdata();
      if (po.getReferencedDataCube() == null) {
        fillTestData(xmlTD,dataManager);
      }
    }
  }
  for (  ICompNamesPairPO name : po.getCompNamesPairs()) {
    CompNames xmlNames=xml.addNewOverriddenNames();
    xmlNames.setOriginalName(name.getFirstName());
    xmlNames.setNewName(name.getSecondName());
    xmlNames.setPropagated(name.isPropagated());
    xmlNames.setType((name.getType() == null) ? StringConstants.EMPTY : name.getType());
  }
}

Fixed version (ground truth):
/** 
 * Write the information from the Object to its corresponding XML element.
 * @param xml The XML element to be filled
 * @param po The persistent object which contains the information
 */
private void fillRefTestCase(RefTestCase xml,IExecTestCasePO po){
  fillNode(xml,po);
  checkForCancel();
  String execName=po.getRealName();
  if (execName == null) {
    execName=StringConstants.EMPTY;
  }
  if (po.getSpecTestCase() != null) {
    String specName=po.getSpecTestCase().getName();
    if (execName.equals(specName)) {
      xml.setName(null);
    }
 else {
      xml.setName(execName);
    }
  }
 else {
    xml.setName(execName);
  }
  xml.setTestcaseGuid(po.getSpecTestCaseGuid());
  if (po.getProjectGuid() != null) {
    xml.setProjectGuid(po.getProjectGuid());
  }
  xml.setHasOwnTestdata(!po.getHasReferencedTD());
  xml.setDatafile(po.getDataFile());
  if (po.getReferencedDataCube() != null) {
    xml.setReferencedTestData(po.getReferencedDataCube().getName());
  }
  if (!po.getHasReferencedTD()) {
    final ITDManager dataManager=po.getDataManager();
    if (dataManager != null) {
      TestData xmlTD=xml.addNewTestdata();
      if (po.getReferencedDataCube() == null) {
        fillTestData(xmlTD,dataManager);
      }
    }
  }
  for (  ICompNamesPairPO name : po.getCompNamesPairs()) {
    CompNames xmlNames=xml.addNewOverriddenNames();
    xmlNames.setOriginalName(name.getFirstName());
    xmlNames.setNewName(name.getSecondName());
    xmlNames.setPropagated(name.isPropagated());
  }
}
Program: 95878
Project: 95878
Buggy source:
/** 
 * @param type the current type to setFIXME Clemens: make private, when persisting in DB
 */
public abstract void setType(String type);

Fixed version (ground truth):
/** 
 * @param type the current type to set
 */
public abstract void setType(String type);
Program: 95879
Project: 95879
Buggy source:
/** 
 * {@inheritDoc}
 */
public boolean isTrue(AWTEvent event){
  if (event.getID() == WindowEvent.WINDOW_LOST_FOCUS) {
    String name=null;
    if (event.getSource() instanceof Frame) {
      Frame frame=(Frame)event.getSource();
      name=frame.getTitle();
    }
 else     if (event.getSource() instanceof Dialog) {
      Dialog dialog=(Dialog)event.getSource();
      name=dialog.getTitle();
    }
 else {
      return false;
    }
    return MatchUtil.getInstance().match(name,m_title,m_operator);
  }
  return false;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public boolean isTrue(AWTEvent event){
  if (event.getID() == WindowEvent.WINDOW_LOST_FOCUS) {
    if (event.getSource() instanceof Window) {
      Window window=(Window)event.getSource();
      if (!window.isVisible()) {
        String name=null;
        if (window instanceof Frame) {
          Frame frame=(Frame)window;
          name=frame.getTitle();
        }
 else         if (window instanceof Dialog) {
          Dialog dialog=(Dialog)window;
          name=dialog.getTitle();
        }
 else {
          return false;
        }
        return MatchUtil.getInstance().match(name,m_title,m_operator);
      }
    }
  }
  return false;
}
Program: 95880
Project: 95880
Buggy source:
/** 
 * {@inheritDoc}
 */
public void addTrackedChange(String optionalComment){
  final boolean isTrackingChanges=GeneralStorage.getInstance().getProject().getIsTrackingActivated();
  if (isTrackingChanges) {
    final long timestamp=new Date().getTime();
    int maxTrackedChangesPerNode=30;
    final long maxDurationOfTrackedChangesInMS=1000L * 60 * 60* 24* 80;
    if (maxTrackedChangesPerNode >= 0) {
      while (m_trackedChangesMap.size() >= maxTrackedChangesPerNode) {
        int removeCount=m_trackedChangesMap.size() - maxTrackedChangesPerNode;
        while (removeCount > 0) {
          m_trackedChangesMap.remove(getTrackedChanges().firstKey());
        }
      }
    }
    if (maxDurationOfTrackedChangesInMS >= 0) {
      SortedMap<Long,String> changes=getTrackedChanges();
      while (changes.size() > 0 && timestamp - changes.firstKey() > maxDurationOfTrackedChangesInMS) {
        m_trackedChangesMap.remove(changes.firstKey());
      }
    }
    String systemPropertyName=GeneralStorage.getInstance().getProject().getProjectProperties().getTrackChangesSignature();
    StringBuffer comment=new StringBuffer(System.getProperty(systemPropertyName,"String_Node_Str"));
    if (optionalComment != null) {
      comment.append("String_Node_Str");
      comment.append(optionalComment);
    }
    m_trackedChangesMap.put(timestamp,comment.toString());
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public void addTrackedChange(String optionalComment){
  final IProjectPO project=GeneralStorage.getInstance().getProject();
  boolean isTrackingChanges=false;
  if (project != null) {
    isTrackingChanges=project.getIsTrackingActivated();
  }
  if (isTrackingChanges) {
    final long timestamp=new Date().getTime();
    int maxTrackedChangesPerNode=30;
    final long maxDurationOfTrackedChangesInMS=1000L * 60 * 60* 24* 80;
    if (maxTrackedChangesPerNode >= 0) {
      while (m_trackedChangesMap.size() >= maxTrackedChangesPerNode) {
        int removeCount=m_trackedChangesMap.size() - maxTrackedChangesPerNode;
        while (removeCount > 0) {
          m_trackedChangesMap.remove(getTrackedChanges().firstKey());
        }
      }
    }
    if (maxDurationOfTrackedChangesInMS >= 0) {
      SortedMap<Long,String> changes=getTrackedChanges();
      while (changes.size() > 0 && timestamp - changes.firstKey() > maxDurationOfTrackedChangesInMS) {
        m_trackedChangesMap.remove(changes.firstKey());
      }
    }
    String systemPropertyName=GeneralStorage.getInstance().getProject().getProjectProperties().getTrackChangesSignature();
    StringBuffer comment=new StringBuffer(System.getProperty(systemPropertyName,"String_Node_Str"));
    if (optionalComment != null) {
      comment.append("String_Node_Str");
      comment.append(optionalComment);
    }
    m_trackedChangesMap.put(timestamp,comment.toString());
  }
}
Program: 95881
Project: 95881
Buggy source:
/** 
 * @throws WorkbenchException {@inheritDoc}
 */
public void postWindowRestore() throws WorkbenchException {
  super.postWindowRestore();
  Plugin.showStatusLine((IWorkbenchPart)null);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public void postWindowRestore() throws WorkbenchException {
  super.postWindowRestore();
  Plugin.showStatusLine((IWorkbenchPart)null);
}
Program: 95882
Project: 95882
Buggy source:
/** 
 * add a permanent listener to update the main window title
 */
protected void addMainWindowTitleUpdater(){
  ApplicationWindowTitleUpdater updater=new ApplicationWindowTitleUpdater();
  DataEventDispatcher ded=DataEventDispatcher.getInstance();
  ded.addProjectLoadedListener(updater,true);
  ded.addDataChangedListener(updater,true);
  DatabaseStateDispatcher.addDatabaseStateListener(updater);
}

Fixed version (ground truth):
/** 
 * add a permanent listener to update the main window title
 */
protected void addMainWindowTitleUpdater(){
  m_updater=new ApplicationWindowTitleUpdater();
  DataEventDispatcher ded=DataEventDispatcher.getInstance();
  ded.addProjectLoadedListener(m_updater,true);
  ded.addDataChangedListener(m_updater,true);
  DatabaseStateDispatcher.addDatabaseStateListener(m_updater);
}
Program: 95883
Project: 95883
Buggy source:
/** 
 * @param repoLabel the repository to test the connection for
 * @return a status reflecting the current connection state
 */
public static IStatus testConnection(String repoLabel){
  TaskRepository repository=getRepositoryByLabel(repoLabel);
  if (repository == null) {
    return new Status(IStatus.ERROR,Activator.ID,NLS.bind(Messages.TaskRepositoryNotFound,repoLabel));
  }
  if (repository.isOffline()) {
    return new Status(IStatus.ERROR,Activator.ID,NLS.bind(Messages.TaskRepositoryOffline,repoLabel));
  }
  boolean savePassword=repository.getSavePassword(AuthenticationType.REPOSITORY);
  if (!savePassword) {
    return new Status(IStatus.ERROR,Activator.ID,NLS.bind(Messages.TaskRepositoryNoCredentialsStored,repoLabel));
  }
  AbstractRepositoryConnector connector=TasksUi.getRepositoryConnector(repository.getConnectorKind());
  if (connector == null) {
    return new Status(IStatus.ERROR,Activator.ID,NLS.bind(Messages.TaskRepositoryNoCredentialsStored,repoLabel));
  }
  try {
    connector.updateRepositoryConfiguration(repository,new NullProgressMonitor());
  }
 catch (  CoreException e) {
    return new Status(IStatus.ERROR,Activator.ID,e.getLocalizedMessage());
  }
  IStatus repoStatus=repository.getStatus();
  if (repoStatus != null) {
    return repoStatus;
  }
  return Status.OK_STATUS;
}

Fixed version (ground truth):
/** 
 * @param repoLabel the repository to test the connection for
 * @return a status reflecting the current connection state
 */
public static IStatus testConnection(String repoLabel){
  TaskRepository repository=getRepositoryByLabel(repoLabel);
  if (repository == null) {
    return new Status(IStatus.ERROR,Activator.ID,NLS.bind(Messages.TaskRepositoryNotFound,repoLabel));
  }
  if (repository.isOffline()) {
    return new Status(IStatus.ERROR,Activator.ID,NLS.bind(Messages.TaskRepositoryOffline,repoLabel));
  }
  boolean savePassword=repository.getSavePassword(AuthenticationType.REPOSITORY);
  if (!savePassword) {
    return new Status(IStatus.ERROR,Activator.ID,NLS.bind(Messages.TaskRepositoryNoCredentialsStored,repoLabel));
  }
  AbstractRepositoryConnector connector=TasksUi.getRepositoryConnector(repository.getConnectorKind());
  if (connector == null) {
    return new Status(IStatus.ERROR,Activator.ID,NLS.bind(Messages.TaskRepositoryNoCredentialsStored,repoLabel));
  }
  try {
    connector.updateRepositoryConfiguration(repository,new NullProgressMonitor());
  }
 catch (  CoreException e) {
    return new Status(IStatus.ERROR,Activator.ID,e.getLocalizedMessage().replace("String_Node_Str","String_Node_Str"));
  }
  IStatus repoStatus=repository.getStatus();
  if (repoStatus != null) {
    return repoStatus;
  }
  return Status.OK_STATUS;
}
Program: 95884
Project: 95884
Buggy source:
/** 
 * For Persistence (JPA / EclipseLink) only Sets the value of the taskId property.
 * @param taskId the new value of the taskId property
 */
public void setTaskId(String taskId){
  m_taskId=taskId;
}

Fixed version (ground truth):
/** 
 * For Persistence (JPA / EclipseLink) only Sets the value of the taskId property. If the length of the trimmed new taskId string is zero, the taskId property is set to null.
 * @param taskId the new value of the taskId property
 */
public void setTaskId(String taskId){
  String newTaskId=taskId;
  if (newTaskId != null) {
    newTaskId=newTaskId.trim();
    if (newTaskId.length() == 0) {
      newTaskId=null;
    }
  }
  m_taskId=newTaskId;
}
Program: 95885
Project: 95885
Buggy source:
protected IStatus run(IProgressMonitor monitor){
  getConsole().writeLine(NLS.bind(Messages.TaskRepositoryConnectionTest,almRepositoryName));
  IStatus connectionStatus=ALMAccess.testConnection(almRepositoryName);
  if (connectionStatus.isOK()) {
    getConsole().writeLine(NLS.bind(Messages.TaskRepositoryConnectionTestSucceeded,almRepositoryName));
    return processResultTree(monitor,reportSuccess,reportFailure);
  }
  getConsole().writeErrorLine(NLS.bind(Messages.TaskRepositoryConnectionTestFailed,connectionStatus.getMessage()));
  return connectionStatus;
}

Fixed version (ground truth):
protected IStatus run(IProgressMonitor monitor){
  getConsole().writeLine(NLS.bind(Messages.TaskRepositoryConnectionTest,almRepositoryName));
  IStatus connectionStatus=ALMAccess.testConnection(almRepositoryName);
  if (connectionStatus.isOK()) {
    getConsole().writeLine(NLS.bind(Messages.TaskRepositoryConnectionTestSucceeded,almRepositoryName));
    return processResultTree(monitor,reportSuccess,reportFailure,summary);
  }
  getConsole().writeErrorLine(NLS.bind(Messages.TaskRepositoryConnectionTestFailed,connectionStatus.getMessage()));
  return connectionStatus;
}
Program: 95886
Project: 95886
Buggy source:
/** 
 * process the result tree
 * @param reportFailure reportFailure
 * @param reportSuccess reportSuccess
 * @param monitor monitor
 * @return status
 */
private IStatus processResultTree(IProgressMonitor monitor,boolean reportSuccess,boolean reportFailure){
  Map<String,String> taskIdToComment=new HashMap<String,String>();
  TestResult resultTestModel=TestResultBP.getInstance().getResultTestModel();
  TestResultNode rootResultNode=resultTestModel.getRootResultNode();
  ITreeNodeOperation<TestResultNode> operation=new ReportOperation(taskIdToComment,reportFailure,reportSuccess,m_projProps.getDashboardURL(),m_summary.getId().toString());
  TestResultNodeTraverser traverser=new TestResultNodeTraverser(rootResultNode,operation);
  traverser.traverse();
  return reportToALM(monitor,taskIdToComment);
}

Fixed version (ground truth):
/** 
 * process the result tree
 * @param reportFailure reportFailure
 * @param reportSuccess reportSuccess
 * @param monitor monitor
 * @param summary the summary the result tree belongs to
 * @return status
 */
private IStatus processResultTree(IProgressMonitor monitor,boolean reportSuccess,boolean reportFailure,ITestResultSummaryPO summary){
  Map<String,String> taskIdToComment=new HashMap<String,String>();
  TestResult resultTestModel=TestResultBP.getInstance().getResultTestModel();
  TestResultNode rootResultNode=resultTestModel.getRootResultNode();
  ITreeNodeOperation<TestResultNode> operation=new ReportOperation(taskIdToComment,reportFailure,reportSuccess,m_projProps.getDashboardURL(),summary.getId().toString());
  TestResultNodeTraverser traverser=new TestResultNodeTraverser(rootResultNode,operation);
  traverser.traverse();
  return reportToALM(monitor,taskIdToComment);
}
Program: 95887
Project: 95887
Buggy source:
/** 
 * {@inheritDoc} 
 */
public void handleTestresultSummaryChanged(ITestResultSummaryPO summary,DataState state){
  if (state != DataState.Added) {
    return;
  }
  IProjectPO project=GeneralStorage.getInstance().getProject();
  m_projProps=project.getProjectProperties();
  final boolean reportSuccess=m_projProps.getIsReportOnSuccess();
  final boolean reportFailure=m_projProps.getIsReportOnFailure();
  final String almRepositoryName=m_projProps.getALMRepositoryName();
  if (!StringUtils.isBlank(almRepositoryName) && (reportSuccess || reportFailure)) {
    Job reportToALMOperation=new Job(NLS.bind(Messages.ReportToALMJob,almRepositoryName)){
      protected IStatus run(      IProgressMonitor monitor){
        getConsole().writeLine(NLS.bind(Messages.TaskRepositoryConnectionTest,almRepositoryName));
        IStatus connectionStatus=ALMAccess.testConnection(almRepositoryName);
        if (connectionStatus.isOK()) {
          getConsole().writeLine(NLS.bind(Messages.TaskRepositoryConnectionTestSucceeded,almRepositoryName));
          return processResultTree(monitor,reportSuccess,reportFailure);
        }
        getConsole().writeErrorLine(NLS.bind(Messages.TaskRepositoryConnectionTestFailed,connectionStatus.getMessage()));
        return connectionStatus;
      }
    }
;
    reportToALMOperation.schedule();
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc} 
 */
public void handleTestresultSummaryChanged(final ITestResultSummaryPO summary,DataState state){
  if (state != DataState.Added) {
    return;
  }
  IProjectPO project=GeneralStorage.getInstance().getProject();
  m_projProps=project.getProjectProperties();
  final boolean reportSuccess=m_projProps.getIsReportOnSuccess();
  final boolean reportFailure=m_projProps.getIsReportOnFailure();
  final String almRepositoryName=m_projProps.getALMRepositoryName();
  if (!StringUtils.isBlank(almRepositoryName) && (reportSuccess || reportFailure)) {
    Job reportToALMOperation=new Job(NLS.bind(Messages.ReportToALMJob,almRepositoryName)){
      protected IStatus run(      IProgressMonitor monitor){
        getConsole().writeLine(NLS.bind(Messages.TaskRepositoryConnectionTest,almRepositoryName));
        IStatus connectionStatus=ALMAccess.testConnection(almRepositoryName);
        if (connectionStatus.isOK()) {
          getConsole().writeLine(NLS.bind(Messages.TaskRepositoryConnectionTestSucceeded,almRepositoryName));
          return processResultTree(monitor,reportSuccess,reportFailure,summary);
        }
        getConsole().writeErrorLine(NLS.bind(Messages.TaskRepositoryConnectionTestFailed,connectionStatus.getMessage()));
        return connectionStatus;
      }
    }
;
    reportToALMOperation.schedule();
  }
}
Program: 95889
Project: 95889
Buggy source:
/** 
 * Creates the m_text field to enter the password.
 * @param area The composite. 
 */
private void createPasswordTextField(Composite area){
  new Label(area,SWT.NONE).setLayoutData(new GridData(GridData.FILL,GridData.CENTER,false,false,HORIZONTAL_SPAN + 1,1));
  m_pwdLabel=new Label(area,SWT.NONE);
  m_pwdLabel.setText(Messages.DBLoginDialogPwdLabel);
  m_pwdLabel.setData(SwtAUTHierarchyConstants.WIDGET_NAME,"String_Node_Str");
  m_pwdText=new Text(area,SWT.PASSWORD | SWT.BORDER);
  m_pwdText.setData(SwtAUTHierarchyConstants.WIDGET_NAME,"String_Node_Str");
  GridData gridData=newGridData();
  LayoutUtil.addToolTipAndMaxWidth(gridData,m_pwdText);
  m_pwdText.setLayoutData(gridData);
  LayoutUtil.setMaxChar(m_pwdText);
  if (!StringUtils.isEmpty(m_userText.getText())) {
    m_pwdText.setFocus();
  }
  m_pwdText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      if (modifyPasswordFieldAction()) {
        modifyUsernameFieldAction();
      }
    }
  }
);
}

Fixed version (ground truth):
/** 
 * Creates the m_text field to enter the password.
 * @param area The composite. 
 */
private void createPasswordTextField(Composite area){
  new Label(area,SWT.NONE).setLayoutData(new GridData(GridData.FILL,GridData.CENTER,false,false,HORIZONTAL_SPAN + 1,1));
  m_pwdLabel=new Label(area,SWT.NONE);
  m_pwdLabel.setText(Messages.DBLoginDialogPwdLabel);
  m_pwdLabel.setData(SwtAUTHierarchyConstants.WIDGET_NAME,"String_Node_Str");
  m_pwdText=new Text(area,SWT.PASSWORD | SWT.BORDER);
  m_pwdText.setData(SwtAUTHierarchyConstants.WIDGET_NAME,"String_Node_Str");
  GridData gridData=newGridData();
  m_pwdText.setLayoutData(gridData);
  LayoutUtil.setMaxChar(m_pwdText);
  if (!StringUtils.isEmpty(m_userText.getText())) {
    m_pwdText.setFocus();
  }
  m_pwdText.addModifyListener(new ModifyListener(){
    public void modifyText(    ModifyEvent e){
      if (modifyPasswordFieldAction()) {
        modifyUsernameFieldAction();
      }
    }
  }
);
}
Program: 95891
Project: 95891
Buggy source:
/** 
 * Calculates the request timeout. Important if an action has a higher timeout than the standard request timeout.
 * @param messageCap the MessageCap
 * @return the calculated timeout.
 */
private int calculateRequestTimeout(MessageCap messageCap){
  List<Integer> timeOuts=new ArrayList<Integer>();
  IParamDescriptionPO desc1=m_currentCap.getParameterForUniqueId("String_Node_Str");
  timeOuts.add(m_currentCap.getParameterList().indexOf(desc1));
  desc1=m_currentCap.getParameterForUniqueId("String_Node_Str");
  timeOuts.add(m_currentCap.getParameterList().indexOf(desc1));
  int timeout=0;
  for (  int index : timeOuts) {
    if (index > -1) {
      final MessageParam param=(MessageParam)messageCap.getMessageParams().get(index);
      final String paramTimeOut=param.getValue();
      timeout+=Integer.parseInt(paramTimeOut);
    }
  }
  boolean isShowText=messageCap.getMethod().equals("String_Node_Str");
  if (isShowText) {
    int showTextTimeout=calculateShowTextTimeout(messageCap);
    if (showTextTimeout != -1) {
      timeout+=showTextTimeout;
    }
  }
  return m_requestTimeout + timeout;
}

Fixed version (ground truth):
/** 
 * Calculates the request timeout. Important if an action has a higher timeout than the standard request timeout.
 * @param messageCap the MessageCap
 * @return the calculated timeout.
 */
private int calculateRequestTimeout(MessageCap messageCap){
  List<Integer> timeOuts=new ArrayList<Integer>();
  IParamDescriptionPO desc1=m_currentCap.getParameterForUniqueId(COMP_SYSTEM_TIMEOUT);
  timeOuts.add(m_currentCap.getParameterList().indexOf(desc1));
  desc1=m_currentCap.getParameterForUniqueId("String_Node_Str");
  timeOuts.add(m_currentCap.getParameterList().indexOf(desc1));
  int timeout=0;
  for (  int index : timeOuts) {
    if (index > -1) {
      final MessageParam param=(MessageParam)messageCap.getMessageParams().get(index);
      final String paramTimeOut=param.getValue();
      timeout+=Integer.parseInt(paramTimeOut);
    }
  }
  boolean isShowText=messageCap.getMethod().equals("String_Node_Str");
  if (isShowText) {
    int showTextTimeout=calculateShowTextTimeout(messageCap);
    if (showTextTimeout != -1) {
      timeout+=showTextTimeout;
    }
  }
  return m_requestTimeout + timeout;
}
Program: 95892
Project: 95892
Buggy source:
/** 
 * Processes the post execution of an action
 * @param msg the CAPTestResponseMessage.
 */
private void processPostExecution(CAPTestResponseMessage msg){
  m_varStore.store(LAST_ACTION_RETURN,msg.getReturnValue());
  final String cmdClassName=msg.getMessageCap().getPostExecutionCommand();
  if (cmdClassName != null && cmdClassName.length() > 0 && !m_currentCap.getMetaAction().isClientAction()) {
    TestErrorEvent errorEvent=executePostExecCommand(cmdClassName);
    if (msg.getTestErrorEvent() == null && errorEvent != null) {
      msg.setTestErrorEvent(errorEvent);
    }
  }
}

Fixed version (ground truth):
/** 
 * Processes the post execution of an action
 * @param msg the CAPTestResponseMessage.
 */
private void processPostExecution(CAPTestResponseMessage msg){
  m_varStore.store(LAST_ACTION_RETURN,msg.getReturnValue());
  final String cmdClassName=msg.getMessageCap().getPostExecutionCommand();
  if (cmdClassName != null && cmdClassName.length() > 0 && !m_currentCap.getMetaAction().isClientAction()) {
    TestErrorEvent errorEvent=executePostExecCommand(m_postExecCmdFactory.createCommand(cmdClassName));
    if (msg.getTestErrorEvent() == null && errorEvent != null) {
      msg.setTestErrorEvent(errorEvent);
    }
  }
}
Program: 95893
Project: 95893
Buggy source:
/** 
 * Fires an event if test fails
 * @param e JBException
 */
private void fireError(Exception e){
  ClientTestFactory.getClientTest().fireTestExecutionChanged(new TestExecutionEvent(TestExecutionEvent.TEST_EXEC_FAILED,e));
  endTestExecution();
}

Fixed version (ground truth):
/** 
 * Fires an event if test fails
 * @param e Exception
 */
private void fireError(Exception e){
  ClientTestFactory.getClientTest().fireTestExecutionChanged(new TestExecutionEvent(TestExecutionEvent.TEST_EXEC_FAILED,e));
  endTestExecution();
}
Program: 95894
Project: 95894
Buggy source:
/** 
 * Handles the client-actions
 * @param cap the cap to execute
 * @param capTestMessage the CAPTestMessage.
 * @return a response if the result of testing the CAP is determined entirely by the client. Returns <code>null</code> if the CAP message should be sent to the server.
 */
private CAPTestResponseMessage clientExecutionHandling(ICapPO cap,CAPTestMessage capTestMessage){
  Action action=cap.getMetaAction();
  if (!action.isClientAction()) {
    return null;
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug(Messages.ExecutingClientAction + StringConstants.COLON + StringConstants.SPACE+ action.getPostExecutionCommand());
  }
  final String postExecCommandClass=action.getPostExecutionCommand();
  final IPostExecutionCommand command=m_postExecCmdFactory.createCommand(postExecCommandClass);
  try {
    TestErrorEvent errorEvent=command.execute();
    if (errorEvent != null) {
      CAPTestResponseMessage response=new CAPTestResponseMessage();
      response.setTestErrorEvent(errorEvent);
      response.setMessageCap(capTestMessage.getMessageCap());
      return response;
    }
  }
 catch (  JBException e) {
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Handles the client-actions
 * @param cap the cap to execute
 * @param capTestMessage the CAPTestMessage.
 * @return a response if the result of testing the CAP is determined entirely by the client. Returns <code>null</code> if the CAP message should be sent to the server.
 */
private CAPTestResponseMessage clientExecutionHandling(ICapPO cap,CAPTestMessage capTestMessage){
  Action action=cap.getMetaAction();
  if (!action.isClientAction()) {
    return null;
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug(Messages.ExecutingClientAction + StringConstants.COLON + StringConstants.SPACE+ action.getPostExecutionCommand());
  }
  final String postExecCommandClass=action.getPostExecutionCommand();
  final IPostExecutionCommand command=m_postExecCmdFactory.createCommand(postExecCommandClass);
  TestErrorEvent errorEvent=executePostExecCommand(command);
  if (errorEvent != null) {
    CAPTestResponseMessage response=new CAPTestResponseMessage();
    response.setTestErrorEvent(errorEvent);
    response.setMessageCap(capTestMessage.getMessageCap());
    return response;
  }
  return null;
}
Program: 95895
Project: 95895
Buggy source:
/** 
 * Loads, instantiates and executes the given IPostExecutionCommand class
 * @param cmdClassName the IPostExecutionCommand to execute.
 * @return a TestErrorEvent representing an error that occurred during  execution, or <code>null</code> if no such error occurs. 
 */
private TestErrorEvent executePostExecCommand(String cmdClassName){
  final IPostExecutionCommand cmd=m_postExecCmdFactory.createCommand(cmdClassName);
  if (cmd instanceof AbstractPostExecutionCommand) {
    AbstractPostExecutionCommand aCmd=(AbstractPostExecutionCommand)cmd;
    aCmd.setCurrentCap(m_currentCap);
    aCmd.setExternalTestDataBP(m_externalTestDataBP);
    aCmd.setLocale(getLocale());
    aCmd.setTraverser(m_trav);
  }
  try {
    return cmd.execute();
  }
 catch (  JBException e) {
    StringBuilder msg=new StringBuilder();
    msg.append(Messages.ErrorExecutingCommand);
    msg.append(StringConstants.COLON);
    msg.append(StringConstants.SPACE);
    msg.append(cmdClassName);
    msg.append(StringConstants.SPACE);
    msg.append(StringConstants.DOT);
    msg.append(StringConstants.SPACE);
    msg.append(Messages.Exception);
    msg.append(StringConstants.COLON);
    msg.append(StringConstants.SPACE);
    msg.append(String.valueOf(e));
    LOG.error(msg.toString());
    fireError(e);
    return null;
  }
}

Fixed version (ground truth):
/** 
 * Loads, instantiates and executes the given IPostExecutionCommand class
 * @param cmd the IPostExecutionCommand to execute.
 * @return a TestErrorEvent representing an error that occurred duringexecution, or <code>null</code> if no such error occurs.
 */
private TestErrorEvent executePostExecCommand(IPostExecutionCommand cmd){
  if (cmd instanceof AbstractPostExecutionCommand) {
    AbstractPostExecutionCommand aCmd=(AbstractPostExecutionCommand)cmd;
    aCmd.setCurrentCap(m_currentCap);
    aCmd.setExternalTestDataBP(m_externalTestDataBP);
    aCmd.setLocale(getLocale());
    aCmd.setTraverser(m_trav);
  }
  try {
    return cmd.execute();
  }
 catch (  JBException e) {
    LOG.error(NLS.bind(Messages.ErrorExecutingCommand,cmd.getClass().getName(),e.getLocalizedMessage()));
    fireError(e);
    return null;
  }
}
Program: 95896
Project: 95896
Buggy source:
/** 
 * @param logicalName guid of the logical name for which to find the technical name
 * @param aut AUT information
 * @param comp component
 * @return a ComponentIdentifier or null
 */
private IComponentIdentifier getTechnicalName(String logicalName,IAUTMainPO aut,Component comp){
  IObjectMappingPO om=aut.getObjMap();
  IComponentIdentifier technicalName;
  try {
    technicalName=om.getTechnicalName(logicalName);
  }
 catch (  LogicComponentNotManagedException e) {
    technicalName=null;
  }
  if (technicalName == null && comp instanceof ConcreteComponent) {
    ConcreteComponent cc=((ConcreteComponent)comp);
    if (cc.hasDefaultMapping() && cc.getComponentClass() != null) {
      Set realizers=cc.getAllRealizers();
      for (Iterator iterator=realizers.iterator(); iterator.hasNext(); ) {
        ConcreteComponent concreteComponent=(ConcreteComponent)iterator.next();
        if (aut.getToolkit().equals(concreteComponent.getToolkitDesriptor().getToolkitID())) {
          technicalName=new ComponentIdentifier();
          technicalName.setComponentClassName(concreteComponent.getComponentClass());
          break;
        }
      }
    }
  }
  return technicalName;
}

Fixed version (ground truth):
/** 
 * @param logicalName guid of the logical name for which to find the technical name
 * @param aut AUT information
 * @param comp component
 * @return a ComponentIdentifier or null
 */
private IComponentIdentifier getTechnicalName(String logicalName,IAUTMainPO aut,Component comp){
  IObjectMappingPO om=aut.getObjMap();
  IComponentIdentifier technicalName;
  try {
    technicalName=om.getTechnicalName(logicalName);
  }
 catch (  LogicComponentNotManagedException e) {
    technicalName=null;
  }
  if (technicalName == null && comp instanceof ConcreteComponent) {
    ConcreteComponent cc=((ConcreteComponent)comp);
    if (cc.hasDefaultMapping() && cc.getComponentClass() != null) {
      Set realizers=cc.getAllRealizers();
      String toolkit=aut.getToolkit();
      ToolkitPluginDescriptor tpd=null;
      while (!StringUtils.isEmpty(toolkit)) {
        for (Iterator iterator=realizers.iterator(); iterator.hasNext(); ) {
          ConcreteComponent concreteComponent=(ConcreteComponent)iterator.next();
          if (toolkit.equals(concreteComponent.getToolkitDesriptor().getToolkitID()) && concreteComponent.getComponentClass() != null) {
            technicalName=new ComponentIdentifier();
            technicalName.setComponentClassName(concreteComponent.getComponentClass());
            return technicalName;
          }
        }
        try {
          tpd=ToolkitSupportBP.getToolkitDescriptor(toolkit);
          toolkit=tpd.getIncludes();
        }
 catch (        ToolkitPluginException e) {
          LOG.error("String_Node_Str",e);
          return null;
        }
      }
    }
  }
  return technicalName;
}
Program: 95897
Project: 95897
Buggy source:
/** 
 * @param toolkitId the id of the toolkit
 * @return the {@link ToolkitPluginDescriptor} of the toolkit with the given id.
 */
private static ToolkitPluginDescriptor getToolkitDescriptor(String toolkitId) throws ToolkitPluginException {
  if (toolkitId == null) {
    final String msg=Messages.ToolkitNameIsNull + StringConstants.EXCLAMATION_MARK;
    log.error(msg);
    throwToolkitPluginException(msg,null);
  }
  for (  ToolkitPluginDescriptor descr : toolkitProvider.keySet()) {
    if (toolkitId.equals(descr.getToolkitID())) {
      return descr;
    }
  }
  final String msg=Messages.NoToolkitPluginDescriptorFound + StringConstants.COLON + StringConstants.SPACE+ String.valueOf(toolkitId);
  log.error(msg);
  throwToolkitPluginException(msg,null);
  return null;
}

Fixed version (ground truth):
/** 
 * @param toolkitId the id of the toolkit
 * @return the {@link ToolkitPluginDescriptor} of the toolkit with the given id.
 */
public static ToolkitPluginDescriptor getToolkitDescriptor(String toolkitId) throws ToolkitPluginException {
  if (toolkitId == null) {
    final String msg=Messages.ToolkitNameIsNull + StringConstants.EXCLAMATION_MARK;
    log.error(msg);
    throwToolkitPluginException(msg,null);
  }
  for (  ToolkitPluginDescriptor descr : toolkitProvider.keySet()) {
    if (toolkitId.equals(descr.getToolkitID())) {
      return descr;
    }
  }
  final String msg=Messages.NoToolkitPluginDescriptorFound + StringConstants.COLON + StringConstants.SPACE+ String.valueOf(toolkitId);
  log.error(msg);
  throwToolkitPluginException(msg,null);
  return null;
}
Program: 95898
Project: 95898
Buggy source:
/** 
 * {@inheritDoc}
 */
public Message execute(){
  ObjectMappingEventDispatcher.clearObjMapTransient();
  fireAutStateChanged();
  m_wasExecuted=true;
  return null;
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public Message execute(){
  fireAutStateChanged();
  m_wasExecuted=true;
  return null;
}
Program: 95900
Project: 95900
Buggy source:
public void run(){
  if (getEditorHelper().requestEditableState() != JBEditorHelper.EditableState.OK) {
    return;
  }
  if (!ObjectMappingEventDispatcher.getObjMapTransient().existTechnicalName(ci) && !hasDefaultMapping) {
    String capComponentName=m_objectMappingManager.addMapping(recordAut,ci,newCap.getComponentName());
    newCap.setComponentName(capComponentName);
  }
  getTreeViewer().refresh(false);
  getTreeViewer().setSelection(new StructuredSelection(newCap),true);
  getEditorHelper().setDirty(true);
}

Fixed version (ground truth):
public void run(){
  if (getEditorHelper().requestEditableState() != JBEditorHelper.EditableState.OK) {
    return;
  }
  if (!hasDefaultMapping) {
    String capComponentName=m_objectMappingManager.addMapping(recordAut,ci,newCap.getComponentName());
    newCap.setComponentName(capComponentName);
  }
  getTreeViewer().refresh(false);
  getTreeViewer().setSelection(new StructuredSelection(newCap),true);
  getEditorHelper().setDirty(true);
}
Program: 95901
Project: 95901
Buggy source:
/** 
 * {@inheritDoc}
 */
public void capRecorded(final ICapPO newCap,final IComponentIdentifier ci,final boolean hasDefaultMapping){
  if (newCap == null) {
    ErrorHandlingUtil.createMessageDialog(MessageIDs.E_TEST_STEP_NOT_CREATED);
  }
 else {
    final IAUTMainPO recordAut=TestExecution.getInstance().getConnectedAut();
    Plugin.getDisplay().syncExec(new Runnable(){
      public void run(){
        if (getEditorHelper().requestEditableState() != JBEditorHelper.EditableState.OK) {
          return;
        }
        if (!ObjectMappingEventDispatcher.getObjMapTransient().existTechnicalName(ci) && !hasDefaultMapping) {
          String capComponentName=m_objectMappingManager.addMapping(recordAut,ci,newCap.getComponentName());
          newCap.setComponentName(capComponentName);
        }
        getTreeViewer().refresh(false);
        getTreeViewer().setSelection(new StructuredSelection(newCap),true);
        getEditorHelper().setDirty(true);
      }
    }
);
  }
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public void capRecorded(final ICapPO newCap,final IComponentIdentifier ci,final boolean hasDefaultMapping){
  if (newCap == null) {
    ErrorHandlingUtil.createMessageDialog(MessageIDs.E_TEST_STEP_NOT_CREATED);
  }
 else {
    final IAUTMainPO recordAut=TestExecution.getInstance().getConnectedAut();
    Plugin.getDisplay().syncExec(new Runnable(){
      public void run(){
        if (getEditorHelper().requestEditableState() != JBEditorHelper.EditableState.OK) {
          return;
        }
        if (!hasDefaultMapping) {
          String capComponentName=m_objectMappingManager.addMapping(recordAut,ci,newCap.getComponentName());
          newCap.setComponentName(capComponentName);
        }
        getTreeViewer().refresh(false);
        getTreeViewer().setSelection(new StructuredSelection(newCap),true);
        getEditorHelper().setDirty(true);
      }
    }
);
  }
}
Program: 95902
Project: 95902
Buggy source:
/** 
 * Toggles the combobox dropdown list by clicking on the combo box.
 */
protected void toggleDropdownList(){
  Rectangle r=findArrowIconArea();
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + r + "String_Node_Str"+ getRealComponent());
  }
  getRobot().click(getRealComponent(),r,ClickOptions.create().setScrollToVisible(false).setConfirmClick(false));
}

Fixed version (ground truth):
/** 
 * Toggles the combobox dropdown list by clicking on the combo box.
 */
protected void toggleDropdownList(){
  Rectangle r=findArrowIconArea();
  if (log.isDebugEnabled()) {
    log.debug("String_Node_Str" + r + "String_Node_Str"+ getRealComponent());
  }
  getRobot().click(getRealComponent(),r,ClickOptions.create().setScrollToVisible(true).setConfirmClick(false));
}
Program: 95903
Project: 95903
Buggy source:
/** 
 * @param po The persistent object that was added
 */
private void handleDataAdded(IPersistentObject po){
  if (po instanceof ISpecTestCasePO) {
    return;
  }
  getTreeViewer().refresh();
  getTreeViewer().expandToLevel(getTreeViewer().getAutoExpandLevel());
  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 IComponentNamePO) {
    return;
  }
  getTreeViewer().refresh();
  getTreeViewer().expandToLevel(getTreeViewer().getAutoExpandLevel());
  getTreeViewer().setSelection(new StructuredSelection(po),true);
}
Program: 95904
Project: 95904
Buggy source:
/** 
 * @param nodesToDelete the nodes to delete
 * @return a list of abstract cmd handles for node deletion
 */
protected List<AbstractCmdHandle> getDeleteCommands(List<INodePO> nodesToDelete){
  IEditorReference[] editors=Plugin.getActivePage().getEditorReferences();
  List<AbstractCmdHandle> cmds=new ArrayList<AbstractCmdHandle>(nodesToDelete.size());
  for (  INodePO node : nodesToDelete) {
    AbstractCmdHandle cmd=null;
    if (node instanceof ITestSuitePO) {
      ITestSuitePO testSuite=(ITestSuitePO)node;
      List<IRefTestSuitePO> refTs=NodePM.getInternalRefTestSuites(testSuite.getGuid(),testSuite.getParentProjectId());
      if (refTs.size() > 0) {
        ErrorHandlingUtil.createMessageDialog(MessageIDs.I_REUSED_TS);
        return ListUtils.EMPTY_LIST;
      }
      closeEditors(testSuite,editors);
      cmd=new DeleteExecHandle(testSuite);
    }
 else     if (node instanceof ITestJobPO) {
      ITestJobPO testjob=(ITestJobPO)node;
      closeEditors(testjob,editors);
      cmd=new DeleteExecHandle(testjob);
    }
 else     if (node instanceof ICategoryPO) {
      ICategoryPO category=(ICategoryPO)node;
      cmd=new DeleteCatHandle(category);
    }
    cmds.add(cmd);
  }
  return cmds;
}

Fixed version (ground truth):
/** 
 * @param nodesToDelete the nodes to delete
 * @return a list of abstract cmd handles for node deletion
 */
protected List<AbstractCmdHandle> getDeleteCommands(List<INodePO> nodesToDelete){
  List<AbstractCmdHandle> cmds=new ArrayList<AbstractCmdHandle>(nodesToDelete.size());
  for (  INodePO node : nodesToDelete) {
    AbstractCmdHandle cmd=null;
    if (node instanceof ITestSuitePO) {
      ITestSuitePO testSuite=(ITestSuitePO)node;
      List<IRefTestSuitePO> refTs=NodePM.getInternalRefTestSuites(testSuite.getGuid(),testSuite.getParentProjectId());
      if (refTs.size() > 0) {
        ErrorHandlingUtil.createMessageDialog(MessageIDs.I_REUSED_TS);
        return ListUtils.EMPTY_LIST;
      }
      closeOpenEditor(testSuite);
      cmd=new DeleteExecHandle(testSuite);
    }
 else     if (node instanceof ITestJobPO) {
      ITestJobPO testjob=(ITestJobPO)node;
      closeOpenEditor(testjob);
      cmd=new DeleteExecHandle(testjob);
    }
 else     if (node instanceof ICategoryPO) {
      ICategoryPO category=(ICategoryPO)node;
      cmd=new DeleteCatHandle(category);
    }
    cmds.add(cmd);
  }
  return cmds;
}
Program: 95905
Project: 95905
Buggy source:
/** 
 * Resets this singleton: Closes the communicator removes the listeners.<br> <b>Note: </b><br> This method is used by the Restart-AUT-Action only to avoid errors while reconnecting with the AUTServer.<br> This is necessary because the disconnect from the AUTServer is implemented badly which will be corrected in a future version!
 */
public synchronized void reset(){
  if (getCommunicator() != null) {
    getCommunicator().clearListeners();
  }
  getCommunicator().close();
  instance=null;
}

Fixed version (ground truth):
/** 
 * Resets this singleton: Closes the communicator removes the listeners.<br> <b>Note: </b><br> This method is used by the Restart-AUT-Action only to avoid errors while reconnecting with the AUTServer.<br> This is necessary because the disconnect from the AUTServer is implemented badly which will be corrected in a future version!
 */
public synchronized void reset(){
  Communicator communicator=getCommunicator();
  if (communicator != null) {
    communicator.interruptAllTimeouts();
    communicator.clearListeners();
    communicator.close();
  }
  instance=null;
}
Program: 95906
Project: 95906
Buggy source:
public void selectionChanged(SelectionChangedEvent event){
  boolean pageComplete=false;
  ISpecTestCasePO specTC=null;
  if (tctc.hasValidSelection()) {
    IStructuredSelection selection=(IStructuredSelection)event.getSelection();
    pageComplete=true;
    specTC=(ISpecTestCasePO)selection.getFirstElement();
  }
  setChoosenTestCase(specTC);
  setPageComplete(pageComplete);
}

Fixed version (ground truth):
public void selectionChanged(SelectionChangedEvent event){
  boolean pageComplete=false;
  ISpecTestCasePO specTC=null;
  if (tctc.hasValidSelection()) {
    IStructuredSelection selection=(IStructuredSelection)event.getSelection();
    pageComplete=true;
    specTC=(ISpecTestCasePO)selection.getFirstElement();
    if (specTC == null) {
      pageComplete=false;
    }
  }
  setChoosenTestCase(specTC);
  setPageComplete(pageComplete);
}
Program: 95907
Project: 95907
Buggy source:
/** 
 * {@inheritDoc}
 */
public void createControl(Composite parent){
  final TestCaseTreeComposite tctc;
  if (m_parentTestCase != null) {
    tctc=new TestCaseTreeComposite(parent,SWT.SINGLE,m_parentTestCase);
  }
 else {
    tctc=new TestCaseTreeComposite(parent,SWT.SINGLE,m_setOfParentTestCases);
  }
  tctc.getTreeViewer().addSelectionChangedListener(new ISelectionChangedListener(){
    public void selectionChanged(    SelectionChangedEvent event){
      boolean pageComplete=false;
      ISpecTestCasePO specTC=null;
      if (tctc.hasValidSelection()) {
        IStructuredSelection selection=(IStructuredSelection)event.getSelection();
        pageComplete=true;
        specTC=(ISpecTestCasePO)selection.getFirstElement();
      }
      setChoosenTestCase(specTC);
      setPageComplete(pageComplete);
    }
  }
);
  setControl(tctc);
}

Fixed version (ground truth):
/** 
 * {@inheritDoc}
 */
public void createControl(Composite parent){
  final TestCaseTreeComposite tctc;
  if (m_parentTestCase != null) {
    tctc=new TestCaseTreeComposite(parent,SWT.SINGLE,m_parentTestCase);
  }
 else {
    tctc=new TestCaseTreeComposite(parent,SWT.SINGLE,m_setOfParentTestCases);
  }
  tctc.getTreeViewer().addSelectionChangedListener(new ISelectionChangedListener(){
    public void selectionChanged(    SelectionChangedEvent event){
      boolean pageComplete=false;
      ISpecTestCasePO specTC=null;
      if (tctc.hasValidSelection()) {
        IStructuredSelection selection=(IStructuredSelection)event.getSelection();
        pageComplete=true;
        specTC=(ISpecTestCasePO)selection.getFirstElement();
        if (specTC == null) {
          pageComplete=false;
        }
      }
      setChoosenTestCase(specTC);
      setPageComplete(pageComplete);
    }
  }
);
  setControl(tctc);
}
Program: 95908
Project: 95908
Buggy source:
@Override protected int getTerminationTimeout(){
  return 0;
}

Fixed version (ground truth):
@Override protected int getTerminationTimeout(){
  return NO_TIMEOUT__FORCE_RESTART;
}
Program: 95910
Project: 95910
Buggy source:
/** 
 * Executes actions after the drop.
 * @param node the dropped node. 
 * @param targetEditor The editor to which the item has been dropped/pasted.
 */
private static void postDropAction(INodePO node,AbstractTestCaseEditor targetEditor){
  targetEditor.setFocus();
  if (node != null) {
    targetEditor.getTreeViewer().setSelection(new StructuredSelection(node));
  }
  targetEditor.getTreeViewer().refresh();
  targetEditor.getEditorHelper().setDirty(true);
  LocalSelectionTransfer.getInstance().setSelection(null);
}

Fixed version (ground truth):
/** 
 * Executes actions after the drop.
 * @param node the dropped node. 
 * @param targetEditor The editor to which the item has been dropped/pasted.
 */
private static void postDropAction(INodePO node,AbstractTestCaseEditor targetEditor){
  targetEditor.setFocus();
  targetEditor.getEditorHelper().setDirty(true);
  LocalSelectionTransfer.getInstance().setSelection(null);
}
Program: 95911
Project: 95911
Buggy source:
/** 
 * Executes actions after the drop.
 * @param node the dropped node. 
 * @param targetEditor The editor to which the item has been dropped/pasted.
 */
private static void postDropAction(INodePO node,TestJobEditor targetEditor){
  targetEditor.setFocus();
  if (node != null) {
    targetEditor.getTreeViewer().setSelection(new StructuredSelection(node));
  }
  targetEditor.getTreeViewer().refresh();
  targetEditor.getEditorHelper().setDirty(true);
  LocalSelectionTransfer.getInstance().setSelection(null);
}

Fixed version (ground truth):
/** 
 * Executes actions after the drop.
 * @param node the dropped node. 
 * @param targetEditor The editor to which the item has been dropped/pasted.
 */
private static void postDropAction(INodePO node,TestJobEditor targetEditor){
  targetEditor.setFocus();
  targetEditor.getEditorHelper().setDirty(true);
  LocalSelectionTransfer.getInstance().setSelection(null);
}
Program: 95912
Project: 95912
Buggy source:
/** 
 * @param selectionChangedListenerList the selectionChangedListenerList to set
 */
public void setSelectionChangedListenerList(List<ISelectionChangedListener> selectionChangedListenerList){
  m_selectionChangedListenerList=selectionChangedListenerList;
}

Fixed version (ground truth):
/** 
 * @param selectionChangedListenerList the selectionChangedListenerList to set
 */
protected void setSelectionChangedListenerList(List<ISelectionChangedListener> selectionChangedListenerList){
  m_selectionChangedListenerList=selectionChangedListenerList;
}
Program: 95913
Project: 95913
Buggy source:
/** 
 * @param parentComposite the parentComposite to set
 */
public void setParentComposite(Composite parentComposite){
  m_parentComposite=parentComposite;
}

Fixed version (ground truth):
/** 
 * @param parentComposite the parentComposite to set
 */
protected void setParentComposite(Composite parentComposite){
  m_parentComposite=parentComposite;
}
Program: 95914
Project: 95914
Buggy source:
/** 
 * @param pasteTreeItemAction the pasteTreeItemAction to set
 */
public void setPasteTreeItemAction(PasteTreeItemActionTCEditor pasteTreeItemAction){
  m_pasteTreeItemAction=pasteTreeItemAction;
}

Fixed version (ground truth):
/** 
 * @param pasteTreeItemAction the pasteTreeItemAction to set
 */
protected void setPasteTreeItemAction(PasteTreeItemActionTCEditor pasteTreeItemAction){
  m_pasteTreeItemAction=pasteTreeItemAction;
}
Program: 95915
Project: 95915
Buggy source:
/** 
 * @return the topTreeViewer
 */
public TreeViewer getMainTreeViewer(){
  return m_mainTreeViewer;
}

Fixed version (ground truth):
/** 
 * @return the topTreeViewer
 */
protected TreeViewer getMainTreeViewer(){
  return m_mainTreeViewer;
}