nus-yam/ex-repair huggingface dataset:
Program: 129573
Project: 129573
Buggy source:
protected void deleteTable(TableNode tableItem){
  Collection<MetadataTable> tables=new ArrayList<MetadataTable>();
  Iterator<MetadataTable> iterate=ConnectionHelper.getTables(getConnection()).iterator();
  while (iterate.hasNext()) {
    MetadataTable metadata=iterate.next();
    if (metadata != null && metadata.getLabel().equals(tableItem.getValue())) {
      tables.add(metadata);
    }
  }
  TableNode parent=tableItem.getParent();
  String catalog="String_Node_Str";
  String schema="String_Node_Str";
  if (parent != null) {
    if (parent.getType() == TableNode.CATALOG) {
      catalog=parent.getValue();
    }
 else     if (parent.getType() == TableNode.SCHEMA) {
      schema=parent.getValue();
      TableNode catalogNode=parent.getParent();
      if (catalogNode != null) {
        catalog=catalogNode.getValue();
      }
    }
  }
  boolean isAccess=EDatabaseTypeName.ACCESS.getDisplayName().equals(metadataconnection.getDbType());
  if (isAccess) {
    ProjectNodeHelper.removeTablesFromCurrentCatalogOrSchema(catalog,getConnection().getName(),getConnection(),tables);
  }
 else {
    if ("String_Node_Str".equals(schema) && ExtractMetaDataUtils.useAllSynonyms && EDatabaseTypeName.ORACLEFORSID.getDisplayName().equals(metadataconnection.getDbType())) {
      schema=MetadataConnectionUtils.FAKE_SCHEMA_SYNONYMS;
    }
    ProjectNodeHelper.removeTablesFromCurrentCatalogOrSchema(catalog,schema,getConnection(),tables);
  }
}

Fixed version (ground truth):
protected void deleteTable(TableNode tableItem){
  Collection<MetadataTable> tables=new ArrayList<MetadataTable>();
  Iterator<MetadataTable> iterate=ConnectionHelper.getTables(getConnection()).iterator();
  while (iterate.hasNext()) {
    MetadataTable metadata=iterate.next();
    if (metadata != null && metadata.getLabel().equals(tableItem.getValue())) {
      tables.add(metadata);
    }
  }
  TableNode parent=tableItem.getParent();
  String catalog="String_Node_Str";
  String schema="String_Node_Str";
  if (parent != null) {
    if (parent.getType() == TableNode.CATALOG) {
      catalog=parent.getValue();
    }
 else     if (parent.getType() == TableNode.SCHEMA) {
      schema=parent.getValue();
      TableNode catalogNode=parent.getParent();
      if (catalogNode != null) {
        catalog=catalogNode.getValue();
      }
    }
  }
  boolean isAccess=EDatabaseTypeName.ACCESS.getDisplayName().equals(metadataconnection.getDbType());
  if (isAccess) {
    ProjectNodeHelper.removeTablesFromCurrentCatalogOrSchema(catalog,getConnection().getName(),getConnection(),tables);
  }
 else {
    if ("String_Node_Str".equals(schema) && ExtractMetaDataUtils.useAllSynonyms) {
      schema=MetadataConnectionUtils.FAKE_SCHEMA_SYNONYMS;
    }
    ProjectNodeHelper.removeTablesFromCurrentCatalogOrSchema(catalog,schema,getConnection(),tables);
  }
}
Program: 129575
Project: 129575
Buggy source:
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  monitor.beginTask(Messages.getString("String_Node_Str"),IProgressMonitor.UNKNOWN);
  if (salesforceAPI == null) {
    try {
      salesforceAPI=new SalesforceModuleParseAPI();
    }
 catch (    Throwable e) {
      ExceptionHandler.process(e);
    }
  }
  boolean socksProxy=false;
  boolean httpProxy=false;
  boolean httpsProxy=false;
  if (SalesforceModuleParseAPI.USE_SOCKS_PROXY.equals(proxy)) {
    socksProxy=true;
  }
  if (SalesforceModuleParseAPI.USE_HTTP_PROXY.equals(proxy)) {
    if (endPoint.startsWith("String_Node_Str")) {
      httpsProxy=true;
    }
 else {
      httpProxy=true;
    }
  }
  salesforceAPI.resetProxy(httpProxy,socksProxy,httpsProxy);
  salesforceAPI.setProxy(proxyHost,proxyPort,proxyUsername,proxyPassword,httpProxy,socksProxy,httpsProxy);
  try {
    ArrayList loginList=salesforceAPI.login(endPoint,username,password,timeOut);
    if (loginList != null) {
      for (int i=0; i < loginList.size(); i++) {
        if (loginList.get(i) instanceof SoapBindingStub) {
          binding=(SoapBindingStub)loginList.get(i);
        }
        if (loginList.get(i) instanceof SforceServiceStub) {
          bindingPartner=(SforceServiceStub)loginList.get(i);
        }
      }
    }
    salesforceAPI.setLogin(true);
  }
 catch (  Throwable e) {
    errors.add(e.getMessage());
    ExceptionHandler.process(e);
  }
 finally {
    salesforceAPI.resetProxy(httpProxy,socksProxy,httpsProxy);
  }
  monitor.done();
}

Fixed version (ground truth):
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
  monitor.beginTask(Messages.getString("String_Node_Str"),IProgressMonitor.UNKNOWN);
  if (salesforceAPI == null) {
    try {
      salesforceAPI=new SalesforceModuleParseAPI();
    }
 catch (    Throwable e) {
      ExceptionHandler.process(e);
    }
  }
  boolean socksProxy=false;
  boolean httpProxy=false;
  boolean httpsProxy=false;
  if (SalesforceModuleParseAPI.USE_SOCKS_PROXY.equals(proxy)) {
    socksProxy=true;
  }
  if (SalesforceModuleParseAPI.USE_HTTP_PROXY.equals(proxy)) {
    if (endPoint.startsWith("String_Node_Str")) {
      httpsProxy=true;
    }
 else {
      httpProxy=true;
    }
  }
  salesforceAPI.resetAllProxy();
  salesforceAPI.setProxy(proxyHost,proxyPort,proxyUsername,proxyPassword,httpProxy,socksProxy,httpsProxy);
  try {
    ArrayList loginList=salesforceAPI.login(endPoint,username,password,timeOut);
    if (loginList != null) {
      for (int i=0; i < loginList.size(); i++) {
        if (loginList.get(i) instanceof SoapBindingStub) {
          binding=(SoapBindingStub)loginList.get(i);
        }
        if (loginList.get(i) instanceof SforceServiceStub) {
          bindingPartner=(SforceServiceStub)loginList.get(i);
        }
      }
    }
    salesforceAPI.setLogin(true);
  }
 catch (  Throwable e) {
    errors.add(e.getMessage());
    ExceptionHandler.process(e);
  }
 finally {
    salesforceAPI.resetAllProxy();
  }
  monitor.done();
}
Program: 129578
Project: 129578
Buggy source:
/** 
 * checkConnection.
 * @param displayMessageBox
 */
protected void checkConnection(final boolean displayMessageBox){
  try {
    if (table.getItemCount() > 0) {
      table.removeAll();
    }
    parentWizardPage.getWizard().getContainer().run(true,true,new IRunnableWithProgress(){
      public void run(      IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
        monitor.beginTask(Messages.getString("String_Node_Str"),IProgressMonitor.UNKNOWN);
        managerConnection.check(getIMetadataConnection());
        if (true) {
          itemTableName=connectFromCustomModuleName();
          if (itemTableName.size() <= 0) {
            if (displayMessageBox) {
              openInfoDialogInUIThread(getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),true);
            }
          }
 else {
            createAllItems(displayMessageBox,null);
          }
        }
 else         if (displayMessageBox) {
          getShell().getDisplay().asyncExec(new Runnable(){
            public void run(){
              new ErrorDialogWidthDetailArea(getShell(),PID,Messages.getString("String_Node_Str"),managerConnection.getMessageException());
            }
          }
);
        }
        monitor.done();
      }
    }
);
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
}

Fixed version (ground truth):
/** 
 * checkConnection.
 * @param displayMessageBox
 */
protected void checkConnection(final boolean displayMessageBox){
  try {
    if (table.getItemCount() > 0) {
      table.removeAll();
    }
    parentWizardPage.getWizard().getContainer().run(true,true,new IRunnableWithProgress(){
      public void run(      IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
        monitor.beginTask(Messages.getString("String_Node_Str"),IProgressMonitor.UNKNOWN);
        managerConnection.check(getIMetadataConnection());
        String proxy=null;
        if (temConnection.isUseProxy()) {
          proxy=SalesforceModuleParseAPI.USE_SOCKS_PROXY;
        }
 else         if (temConnection.isUseHttpProxy()) {
          proxy=SalesforceModuleParseAPI.USE_HTTP_PROXY;
        }
        itemTableName=connectFromCustomModuleName(proxy);
        if (itemTableName.size() <= 0) {
          if (displayMessageBox) {
            openInfoDialogInUIThread(getShell(),Messages.getString("String_Node_Str"),Messages.getString("String_Node_Str"),true);
          }
        }
 else {
          createAllItems(displayMessageBox,null);
        }
        monitor.done();
      }
    }
);
  }
 catch (  Exception e) {
    ExceptionHandler.process(e);
  }
}
Program: 129580
Project: 129580
Buggy source:
/** 
 * Looks up the <code>IContextParameter</code> from context list by the specified parameters.
 * @param sourceId
 * @param contextParaName
 * @param index
 * @return
 */
private IContextParameter lookupContextParameter(String sourceId,String contextParaName,int index){
  List<IContext> contextList=parentModel.getContexts();
  IContext context=contextList.get(index);
  List<IContextParameter> list=context.getContextParameterList();
  if (list != null && list.size() > 0) {
    for (    IContextParameter contextPara : list) {
      String tempSourceId=contextPara.getSource();
      String tempContextParaName=contextPara.getName();
      if (tempSourceId.equals(sourceId) && tempContextParaName.equals(contextParaName)) {
        return contextPara;
      }
    }
  }
  return null;
}

Fixed version (ground truth):
/** 
 * Looks up the <code>IContextParameter</code> from context list by the specified parameters.
 * @param sourceId
 * @param contextParaName
 * @param index
 * @return
 */
private IContextParameter lookupContextParameter(String sourceId,String contextParaName,int index){
  List<IContext> contextList=parentModel.getContexts();
  int size=contextList.size();
  if (index < size) {
    IContext context=contextList.get(index);
    List<IContextParameter> list=context.getContextParameterList();
    if (list != null && list.size() > 0) {
      for (      IContextParameter contextPara : list) {
        String tempSourceId=contextPara.getSource();
        String tempContextParaName=contextPara.getName();
        if (tempSourceId.equals(sourceId) && tempContextParaName.equals(contextParaName)) {
          return contextPara;
        }
      }
    }
  }
  return null;
}
Program: 129581
Project: 129581
Buggy source:
private String getColumnTextForChild(ContextTableTabChildModel child,int columnIndex){
  String text="String_Node_Str";
  String sourceId=child.getContextParameter().getSource();
  String variableName=child.getContextParameter().getName();
  if (columnIndex == 0)   return child.getContextParameter().getName();
 else {
    List<IContext> contextList=parentModel.getContexts();
    IContext context=contextList.get(columnIndex - 1);
    List<IContextParameter> list=context.getContextParameterList();
    if (list != null && list.size() > 0) {
      for (      IContextParameter contextPara : list) {
        String tempName=contextPara.getName();
        String tempSourceId=contextPara.getSource();
        if (tempName.equals(variableName) && tempSourceId.equals(sourceId)) {
          return contextPara.getValue();
        }
      }
    }
  }
  return text;
}

Fixed version (ground truth):
private String getColumnTextForChild(ContextTableTabChildModel child,int columnIndex){
  String text="String_Node_Str";
  String sourceId=child.getContextParameter().getSource();
  String variableName=child.getContextParameter().getName();
  List<IContext> contextList=parentModel.getContexts();
  int size=contextList.size();
  if (columnIndex == 0)   return child.getContextParameter().getName();
 else   if (columnIndex - 1 < size) {
    IContext context=contextList.get(columnIndex - 1);
    List<IContextParameter> list=context.getContextParameterList();
    if (list != null && list.size() > 0) {
      for (      IContextParameter contextPara : list) {
        String tempName=contextPara.getName();
        String tempSourceId=contextPara.getSource();
        if (tempName.equals(variableName) && tempSourceId.equals(sourceId)) {
          return contextPara.getValue();
        }
      }
    }
  }
  return text;
}
Program: 129583
Project: 129583
Buggy source:
public WebDriver setWebDriver(Browser browser){
switch (browser) {
case iexplore:
    driver=this.setIExplore();
default :
  driver=this.setFirefox();
}
return driver;
}

Fixed version (ground truth):
public WebDriver setWebDriver(Browser browser){
switch (browser) {
case iexplore:
    driver=this.setIExplore();
  break;
default :
driver=this.setFirefox();
}
return driver;
}
Program: 129585
Project: 129585
Buggy source:
public Item copy(Item originalItem,IPath path,boolean changeLabelWithCopyPrefix) throws PersistenceException, BusinessException {
  Resource resource;
  ProjectManager projectManage=ProjectManager.getInstance();
  if (!projectManage.getProject(originalItem).equals(projectManage.getCurrentProject().getEmfProject())) {
    originalItem.getProperty().eResource().getContents().add(originalItem);
  }
  resource=originalItem.getProperty().eResource();
  ByteArrayOutputStream out=new ByteArrayOutputStream();
  try {
    resource.save(out,null);
    Resource createResource=new ResourceSetImpl().createResource(resource.getURI());
    ByteArrayInputStream in=new ByteArrayInputStream(out.toByteArray());
    createResource.load(in,null);
    Item newItem=copyFromResource(createResource,changeLabelWithCopyPrefix);
    copyReferenceFiles(originalItem,newItem);
    create(getRepositoryContext().getProject(),newItem,path);
    if (newItem instanceof ConnectionItem) {
      ConnectionItem connectionItem=(ConnectionItem)newItem;
      Resource itemResource=xmiResourceManager.getItemResource(connectionItem);
      if (itemResource != null && itemResource instanceof XMLResource) {
        XMLResource xmlResource=(XMLResource)itemResource;
        xmlResource.setID(connectionItem.getConnection(),EcoreUtil.generateUUID());
      }
    }
    return newItem;
  }
 catch (  IOException e) {
    ExceptionHandler.process(e);
  }
  return null;
}

Fixed version (ground truth):
public Item copy(Item originalItem,IPath path,boolean changeLabelWithCopyPrefix) throws PersistenceException, BusinessException {
  Resource resource;
  ProjectManager projectManage=ProjectManager.getInstance();
  if (!projectManage.getProject(originalItem).equals(projectManage.getCurrentProject().getEmfProject())) {
    originalItem.getProperty().eResource().getContents().add(originalItem);
  }
  resource=originalItem.getProperty().eResource();
  ByteArrayOutputStream out=new ByteArrayOutputStream();
  try {
    resource.save(out,null);
    Resource createResource=new ResourceSetImpl().createResource(resource.getURI());
    ByteArrayInputStream in=new ByteArrayInputStream(out.toByteArray());
    createResource.load(in,null);
    Item newItem=copyFromResource(createResource,changeLabelWithCopyPrefix);
    copyReferenceFiles(originalItem,newItem);
    create(getRepositoryContext().getProject(),newItem,path);
    copyScreenshotFile(originalItem,newItem);
    if (newItem instanceof ConnectionItem) {
      ConnectionItem connectionItem=(ConnectionItem)newItem;
      Resource itemResource=xmiResourceManager.getItemResource(connectionItem);
      if (itemResource != null && itemResource instanceof XMLResource) {
        XMLResource xmlResource=(XMLResource)itemResource;
        xmlResource.setID(connectionItem.getConnection(),EcoreUtil.generateUUID());
      }
    }
    return newItem;
  }
 catch (  IOException e) {
    ExceptionHandler.process(e);
  }
  return null;
}
Program: 129587
Project: 129587
Buggy source:
public Item copy(Item originalItem,IPath path,boolean changeLabelWithCopyPrefix) throws PersistenceException, BusinessException {
  Resource resource;
  ProjectManager projectManage=ProjectManager.getInstance();
  if (!projectManage.getProject(originalItem).equals(projectManage.getCurrentProject().getEmfProject())) {
    originalItem.getProperty().eResource().getContents().add(originalItem);
  }
  resource=originalItem.getProperty().eResource();
  ByteArrayOutputStream out=new ByteArrayOutputStream();
  try {
    resource.save(out,null);
    Resource createResource=new ResourceSetImpl().createResource(resource.getURI());
    ByteArrayInputStream in=new ByteArrayInputStream(out.toByteArray());
    createResource.load(in,null);
    Item newItem=copyFromResource(createResource,changeLabelWithCopyPrefix);
    copyReferenceFiles(originalItem,newItem);
    create(getRepositoryContext().getProject(),newItem,path);
    if (newItem instanceof ConnectionItem) {
      ConnectionItem connectionItem=(ConnectionItem)newItem;
      Resource itemResource=xmiResourceManager.getItemResource(connectionItem);
      if (itemResource != null && itemResource instanceof XMLResource) {
        XMLResource xmlResource=(XMLResource)itemResource;
        xmlResource.setID(connectionItem.getConnection(),EcoreUtil.generateUUID());
      }
    }
    return newItem;
  }
 catch (  IOException e) {
    ExceptionHandler.process(e);
  }
  return null;
}

Fixed version (ground truth):
public Item copy(Item originalItem,IPath path,boolean changeLabelWithCopyPrefix) throws PersistenceException, BusinessException {
  Resource resource;
  ProjectManager projectManage=ProjectManager.getInstance();
  if (!projectManage.getProject(originalItem).equals(projectManage.getCurrentProject().getEmfProject())) {
    originalItem.getProperty().eResource().getContents().add(originalItem);
  }
  resource=originalItem.getProperty().eResource();
  ByteArrayOutputStream out=new ByteArrayOutputStream();
  try {
    resource.save(out,null);
    Resource createResource=new ResourceSetImpl().createResource(resource.getURI());
    ByteArrayInputStream in=new ByteArrayInputStream(out.toByteArray());
    createResource.load(in,null);
    Item newItem=copyFromResource(createResource,changeLabelWithCopyPrefix);
    copyReferenceFiles(originalItem,newItem);
    create(getRepositoryContext().getProject(),newItem,path);
    copyScreenshotFile(originalItem,newItem);
    if (newItem instanceof ConnectionItem) {
      ConnectionItem connectionItem=(ConnectionItem)newItem;
      Resource itemResource=xmiResourceManager.getItemResource(connectionItem);
      if (itemResource != null && itemResource instanceof XMLResource) {
        XMLResource xmlResource=(XMLResource)itemResource;
        xmlResource.setID(connectionItem.getConnection(),EcoreUtil.generateUUID());
      }
    }
    return newItem;
  }
 catch (  IOException e) {
    ExceptionHandler.process(e);
  }
  return null;
}
Program: 129590
Project: 129590
Buggy source:
public static List<TalendItemType> getTISItemTypes(){
  List<TalendItemType> itemList=new ArrayList<TalendItemType>();
  itemList.add(TalendItemType.SERVICES);
  itemList.add(TalendItemType.JOBLET_DESIGNS);
  itemList.add(TalendItemType.JOBSCRIPTS);
  itemList.add(TalendItemType.SAP_CONNECTIONS);
  itemList.add(TalendItemType.SURVIVORSHIP_RULES);
  itemList.add(TalendItemType.BRMS);
  itemList.add(TalendItemType.EMBEDDED_RULES);
  itemList.add(TalendItemType.VALIDATION_RULES);
  itemList.add(TalendItemType.COPYBOOK);
  itemList.add(TalendItemType.HL7);
  itemList.add(TalendItemType.EDI);
  return itemList;
}

Fixed version (ground truth):
public static List<TalendItemType> getTISItemTypes(){
  List<TalendItemType> itemList=new ArrayList<TalendItemType>();
  for (  TalendItemType itemType : TalendItemType.values())   itemList.add(itemType);
  return itemList;
}
Program: 129591
Project: 129591
Buggy source:
public SWTBotShell beginEditWizard(String contextMenu,String shellTitle){
  parentNode.getNode(itemFullName).contextMenu(contextMenu).click();
  SWTBotShell shell=gefBot.shell(shellTitle).activate();
  return shell;
}

Fixed version (ground truth):
public SWTBotShell beginEditWizard(String contextMenu,String shellTitle){
  parentNode.getNode(itemFullName).contextMenu(contextMenu).click();
  SWTBotShell shell=null;
  if (shellTitle == null)   shell=gefBot.activeShell();
 else   shell=gefBot.shell(shellTitle).activate();
  return shell;
}
Program: 129592
Project: 129592
Buggy source:
/** 
 * DOC ycbai Comment method "getRoutineFromName".
 * @param name
 * @return
 */
public static IRepositoryViewObject getRoutineFromName(String name){
  if (name == null)   return null;
  IProxyRepositoryFactory factory=CorePlugin.getDefault().getProxyRepositoryFactory();
  try {
    List<IRepositoryViewObject> all=factory.getAll(ProjectManager.getInstance().getCurrentProject(),ERepositoryObjectType.ROUTINES);
    for (    IRepositoryViewObject obj : all) {
      if (obj != null && obj.getProperty() != null) {
        Item item=obj.getProperty().getItem();
        String label=obj.getProperty().getLabel();
        if (item != null && item instanceof RoutineItem && name.equals(label)) {
          return obj;
        }
      }
    }
  }
 catch (  PersistenceException e) {
    ExceptionHandler.process(e);
  }
  return null;
}

Fixed version (ground truth):
/** 
 * DOC hcyi Comment method "getRoutineFromName".
 * @param tempProject
 * @param name
 * @return
 */
public static IRepositoryViewObject getRoutineFromName(Project tempProject,String name){
  if (name == null)   return null;
  IProxyRepositoryFactory factory=CorePlugin.getDefault().getProxyRepositoryFactory();
  try {
    List<IRepositoryViewObject> all=factory.getAll(tempProject,ERepositoryObjectType.ROUTINES);
    for (    IRepositoryViewObject obj : all) {
      if (obj != null && obj.getProperty() != null) {
        Item item=obj.getProperty().getItem();
        String label=obj.getProperty().getLabel();
        if (item != null && item instanceof RoutineItem && name.equals(label)) {
          return obj;
        }
      }
    }
  }
 catch (  PersistenceException e) {
    ExceptionHandler.process(e);
  }
  return null;
}
Program: 129593
Project: 129593
Buggy source:
public void reSortWindows(){
  this.checkGetStartedWindow();
  this.reSortWindowLayout("String_Node_Str",500,500);
  this.checkAlertsWindow();
  this.reSortWindowLayout("String_Node_Str",500,500);
  this.checkProcessWindow();
  this.reSortWindowLayout("String_Node_Str",-800,500);
  this.checkSearchWindow();
  this.reSortWindowLayout("String_Node_Str",-300,200);
  this.checkTasksWindow();
}

Fixed version (ground truth):
public void reSortWindows(){
  this.checkGetStartedWindow();
  this.reSortWindowLayout("String_Node_Str","String_Node_Str",0,20);
  this.checkAlertsWindow();
  this.reSortWindowLayout("String_Node_Str","String_Node_Str",0,20);
  this.checkSearchWindow();
  this.reSortWindowLayout("String_Node_Str","String_Node_Str",0,20);
  this.checkTasksWindow();
  this.reSortWindowLayout("String_Node_Str","String_Node_Str",0,20);
  this.checkProcessWindow();
}
Program: 129594
Project: 129594
Buggy source:
public void reSortWindowLayout(String xpathLocatorKey,int xP,int yP){
  Point p1=this.getWindowPosition(this.getElementByXpath(locator.getString(xpathLocatorKey)));
  WebElement ele1=(this.getElementByXpath(locator.getString(xpathLocatorKey)));
  logger.info(this.getWindowPosition(ele1).x + "String_Node_Str" + this.getWindowPosition(ele1).y);
  this.dragAndDropBy(ele1,this.getWindowPosition(ele1).x + xP,this.getWindowPosition(ele1).y + yP);
  this.sleepCertainTime(5000);
  WebElement ele2=this.getElementByXpath(locator.getString(xpathLocatorKey));
  Point p2=this.getWindowPosition(this.getElementByXpath(locator.getString(xpathLocatorKey)));
  logger.info(this.getWindowPosition(ele2).x + "String_Node_Str" + this.getWindowPosition(ele2).y);
  Assert.assertFalse(p1.equals(p2),"String_Node_Str");
}

Fixed version (ground truth):
public void reSortWindowLayout(String srcXpathLocatorKey,String destXpathLocatorKey,int xP,int yP){
  WebElement srcElementOld=(this.getElementByXpath(locator.getString(srcXpathLocatorKey)));
  Point pointOld=this.getWindowPosition(srcElementOld);
  Actions builder=new Actions(driver);
  builder.clickAndHold(this.getElementByXpath(locator.getString(srcXpathLocatorKey))).moveToElement(this.getElementByXpath(locator.getString(destXpathLocatorKey)),xP,yP).release().build().perform();
  this.sleepCertainTime(5000);
  WebElement srcElementNew=(this.getElementByXpath(locator.getString(srcXpathLocatorKey)));
  Point pointNew=this.getWindowPosition(srcElementNew);
  Assert.assertFalse(pointNew.equals(pointOld),"String_Node_Str");
}
Program: 129596
Project: 129596
Buggy source:
public static IRepositoryViewObject getRoutineFromName(String name,boolean includeSystem){
  if (name == null)   return null;
  IProxyRepositoryFactory factory=CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
  try {
    List<IRepositoryViewObject> all=factory.getAll(ProjectManager.getInstance().getCurrentProject(),ERepositoryObjectType.ROUTINES);
    for (    IRepositoryViewObject obj : all) {
      if (obj != null && obj.getProperty() != null) {
        Item item=obj.getProperty().getItem();
        String label=obj.getProperty().getLabel();
        if (item != null && item instanceof RoutineItem) {
          RoutineItem routineItem=(RoutineItem)item;
          if (name.equals(label)) {
            if (!includeSystem && routineItem.isBuiltIn()) {
              continue;
            }
 else {
              return obj;
            }
          }
        }
      }
    }
  }
 catch (  PersistenceException e) {
    ExceptionHandler.process(e);
  }
  return null;
}

Fixed version (ground truth):
public static IRepositoryViewObject getRoutineFromName(Project tempProject,String name,boolean includeSystem){
  if (name == null)   return null;
  IProxyRepositoryFactory factory=CoreRuntimePlugin.getInstance().getProxyRepositoryFactory();
  try {
    List<IRepositoryViewObject> all=factory.getAll(tempProject,ERepositoryObjectType.ROUTINES);
    for (    IRepositoryViewObject obj : all) {
      if (obj != null && obj.getProperty() != null) {
        Item item=obj.getProperty().getItem();
        String label=obj.getProperty().getLabel();
        if (item != null && item instanceof RoutineItem) {
          RoutineItem routineItem=(RoutineItem)item;
          if (name.equals(label)) {
            if (!includeSystem && routineItem.isBuiltIn()) {
              continue;
            }
 else {
              return obj;
            }
          }
        }
      }
    }
  }
 catch (  PersistenceException e) {
    ExceptionHandler.process(e);
  }
  return null;
}
Program: 129597
Project: 129597
Buggy source:
/** 
 * Empty Recycle bin
 * @author fzhong
 * @return void
 */
public static void emptyRecycleBin(){
  try {
    SWTBotTreeItem recycleBin=tree.expandNode("String_Node_Str").select();
    gefBot.waitUntil(Conditions.widgetIsEnabled(recycleBin));
    if (recycleBin.rowCount() != 0) {
      recycleBin.click();
      recycleBin.contextMenu("String_Node_Str").click();
      gefBot.waitUntil(Conditions.shellIsActive("String_Node_Str"));
      gefBot.button("String_Node_Str").click();
    }
  }
 catch (  Exception e) {
    gefBot.closeAllShells();
    System.out.println("String_Node_Str");
    e.printStackTrace();
  }
}

Fixed version (ground truth):
/** 
 * Empty Recycle bin
 * @author fzhong
 * @return void
 */
public static void emptyRecycleBin(){
  try {
    Thread.sleep(1000);
    SWTBotTreeItem recycleBin=tree.expandNode("String_Node_Str").select();
    gefBot.waitUntil(Conditions.widgetIsEnabled(recycleBin));
    if (recycleBin.rowCount() != 0) {
      recycleBin.click();
      recycleBin.contextMenu("String_Node_Str").click();
      gefBot.waitUntil(Conditions.shellIsActive("String_Node_Str"));
      gefBot.button("String_Node_Str").click();
      Thread.sleep(1000);
    }
  }
 catch (  Exception e) {
    gefBot.closeAllShells();
    System.out.println("String_Node_Str");
    e.printStackTrace();
  }
}
Program: 129598
Project: 129598
Buggy source:
public void maxARecordPanel(){
  Point b=this.findElementDefineDriver(this.driver,By.xpath(locator.getString("String_Node_Str"))).getLocation();
  Point a=this.findElementDefineDriver(this.driver,By.xpath(locator.getString("String_Node_Str"))).getLocation();
  logger.info(b.x + "String_Node_Str" + b.y);
  logger.info(a.x + "String_Node_Str" + a.y);
  logger.info("String_Node_Str" + (a.x - b.x - 50));
  this.dragAndDropBy(this.findElementDefineDriver(this.driver,By.xpath(locator.getString("String_Node_Str"))),-a.x + b.x + 50,0);
}

Fixed version (ground truth):
public void maxARecordPanel(){
  Point b=this.findElementDefineDriver(this.driver,By.xpath(locator.getString("String_Node_Str"))).getLocation();
  Point a=this.findElementDefineDriver(this.driver,By.xpath(locator.getString("String_Node_Str"))).getLocation();
  logger.info("String_Node_Str" + b.x + "String_Node_Str"+ b.y);
  logger.info("String_Node_Str" + a.x + "String_Node_Str"+ a.y);
  logger.info("String_Node_Str" + (a.x - b.x - 50));
  Actions builder=new Actions(driver);
  builder.clickAndHold(this.findElementDefineDriver(this.driver,By.xpath(locator.getString("String_Node_Str")))).moveToElement(this.findElementDefineDriver(this.driver,By.xpath(locator.getString("String_Node_Str"))),2,-2).release().build().perform();
}
Program: 129599
Project: 129599
Buggy source:
public void maxDataBrowserBoard(){
  Point b=this.findElementDefineDriver(this.driver,By.xpath(locator.getString("String_Node_Str"))).getLocation();
  logger.info("String_Node_Str" + (b.x - 50));
  this.dragAndDropBy(this.findElementDefineDriver(this.driver,By.xpath(locator.getString("String_Node_Str"))),-b.x + 50,0);
}

Fixed version (ground truth):
public void maxDataBrowserBoard(){
  Point b=this.findElementDefineDriver(this.driver,By.xpath(locator.getString("String_Node_Str"))).getLocation();
  logger.info("String_Node_Str" + b.x + "String_Node_Str"+ b.y);
  logger.info("String_Node_Str" + (b.x - 100));
  Actions builder=new Actions(driver);
  builder.clickAndHold(this.findElementDefineDriver(this.driver,By.xpath(locator.getString("String_Node_Str")))).moveToElement(this.findElementDefineDriver(this.driver,By.id(locator.getString("String_Node_Str"))),-5,0).release().build().perform();
}
Program: 129600
Project: 129600
Buggy source:
@BeforeClass @Parameters({"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}) public void initWebdriver(String url,String root,String testlinkId,String testlinkProject,ITestContext context){
  System.setProperty("String_Node_Str",testlinkId);
  System.setProperty("String_Node_Str",testlinkProject);
  URL file=Login.class.getClassLoader().getResource("String_Node_Str");
  PropertyConfigurator.configure(file.getPath() + "String_Node_Str");
  FirefoxProfile firefoxProfile=new FirefoxProfile();
  firefoxProfile.setPreference("String_Node_Str",2);
  firefoxProfile.setPreference("String_Node_Str",false);
  firefoxProfile.setPreference("String_Node_Str",this.getAbsoluteFolderPath("String_Node_Str"));
  firefoxProfile.setPreference("String_Node_Str","String_Node_Str");
  firefoxProfile.setPreference("String_Node_Str",0);
  driver=new FirefoxDriver(firefoxProfile);
  driver.manage().timeouts().setScriptTimeout(10,TimeUnit.SECONDS);
  logger.info("String_Node_Str");
  logger.info("String_Node_Str" + url + root);
  driver.get(url + root);
  super.setDriver(driver);
  windowMaximize();
  onTestListener(context,Login.class.getClassLoader().getResource("String_Node_Str").getPath());
}

Fixed version (ground truth):
@BeforeClass @Parameters({"String_Node_Str","String_Node_Str","String_Node_Str","String_Node_Str"}) public void initWebdriver(String url,String root,String testlinkId,String testlinkProject,ITestContext context){
  System.setProperty("String_Node_Str",testlinkId);
  System.setProperty("String_Node_Str",testlinkProject);
  URL file=Login.class.getClassLoader().getResource("String_Node_Str");
  PropertyConfigurator.configure(file.getPath() + "String_Node_Str");
  FirefoxProfile firefoxProfile=new FirefoxProfile();
  firefoxProfile.setPreference("String_Node_Str",2);
  firefoxProfile.setPreference("String_Node_Str",false);
  firefoxProfile.setPreference("String_Node_Str",this.getAbsoluteFolderPath("String_Node_Str"));
  firefoxProfile.setPreference("String_Node_Str","String_Node_Str");
  firefoxProfile.setPreference("String_Node_Str",0);
  firefoxProfile.setPreference("String_Node_Str",0);
  driver=new FirefoxDriver(firefoxProfile);
  driver.manage().timeouts().setScriptTimeout(10,TimeUnit.SECONDS);
  logger.info("String_Node_Str");
  logger.info("String_Node_Str" + url + root);
  driver.get(url + root);
  super.setDriver(driver);
  windowMaximize();
  onTestListener(context,Login.class.getClassLoader().getResource("String_Node_Str").getPath());
}
Program: 129602
Project: 129602
Buggy source:
public void run(){
  for (  TalendTabbedPropertyList ttpl : controls) {
    ttpl.select(index);
  }
}

Fixed version (ground truth):
public void run(IProgressMonitor monitor){
  Iterator<ERepositoryObjectType> it=repositoriesFolders.keySet().iterator();
  List<String> folderPaths;
  while (it.hasNext()) {
    ERepositoryObjectType key=it.next();
    folderPaths=repositoriesFolders.get(key);
    for (    String path : folderPaths) {
      IFolder folder=project.getFolder(key.getFolder() + "String_Node_Str" + path);
      if (folder.exists()) {
        try {
          folder.delete(true,false,null);
        }
 catch (        CoreException e) {
          e.printStackTrace();
        }
      }
    }
  }
  try {
    project.refreshLocal(IResource.DEPTH_INFINITE,null);
  }
 catch (  CoreException e) {
    e.printStackTrace();
  }
  gefBot.resetActivePerspective();
}
Program: 129604
Project: 129604
Buggy source:
public void finishCreationWizard(final SWTBotShell shell){
  gefBot.waitUntil(new DefaultCondition(){
    public boolean test() throws Exception {
      return gefBot.button("String_Node_Str").isEnabled();
    }
    public String getFailureMessage(){
      shell.close();
      return "String_Node_Str";
    }
  }
);
  gefBot.button("String_Node_Str").click();
  if ("String_Node_Str".equals(gefBot.activeShell().getText())) {
    String errorLog=gefBot.label(1).getText();
    gefBot.button("String_Node_Str").click();
    Assert.fail(errorLog);
  }
  gefBot.waitUntil(new DefaultCondition(){
    public boolean test() throws Exception {
      return !shell.isOpen();
    }
    public String getFailureMessage(){
      return "String_Node_Str";
    }
  }
,2000);
  SWTBotTreeItem newTreeItem=null;
  try {
    if (gefBot.toolbarButtonWithTooltip("String_Node_Str").isEnabled()) {
      gefBot.toolbarButtonWithTooltip("String_Node_Str").click();
    }
    parentNode.setFocus();
    newTreeItem=parentNode.expand().select(itemName + "String_Node_Str");
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
 finally {
    Assert.assertNotNull("String_Node_Str",newTreeItem);
  }
  setItem(parentNode.getNode(itemName + "String_Node_Str"));
}

Fixed version (ground truth):
public void finishCreationWizard(final SWTBotShell shell){
  gefBot.waitUntil(new DefaultCondition(){
    public boolean test() throws Exception {
      return gefBot.button("String_Node_Str").isEnabled();
    }
    public String getFailureMessage(){
      shell.close();
      return "String_Node_Str";
    }
  }
);
  gefBot.button("String_Node_Str").click();
  gefBot.waitUntil(new DefaultCondition(){
    public boolean test() throws Exception {
      return gefBot.activeShell() != null;
    }
    public String getFailureMessage(){
      return "String_Node_Str";
    }
  }
,60000);
  if ("String_Node_Str".equals(gefBot.activeShell().getText())) {
    String errorLog=gefBot.label(1).getText();
    gefBot.button("String_Node_Str").click();
    Assert.fail(errorLog);
  }
  gefBot.waitUntil(new DefaultCondition(){
    public boolean test() throws Exception {
      return !shell.isOpen();
    }
    public String getFailureMessage(){
      return "String_Node_Str";
    }
  }
,2000);
  SWTBotTreeItem newTreeItem=null;
  try {
    if (gefBot.toolbarButtonWithTooltip("String_Node_Str").isEnabled()) {
      gefBot.toolbarButtonWithTooltip("String_Node_Str").click();
    }
    parentNode.setFocus();
    newTreeItem=parentNode.expand().select(itemName + "String_Node_Str");
    newTreeItem.setFocus();
  }
 catch (  Exception e) {
    e.printStackTrace();
  }
 finally {
    Assert.assertNotNull("String_Node_Str",newTreeItem);
  }
  setItem(parentNode.getNode(itemName + "String_Node_Str"));
}
Program: 129605
Project: 129605
Buggy source:
@SuppressWarnings("String_Node_Str") public TalendItem copyAndPaste(){
  getItem().contextMenu("String_Node_Str").click();
  parentNode.contextMenu("String_Node_Str").click();
  TalendItem copyItem=(TalendItem)this.clone();
  SWTBotTreeItem newItem=null;
  try {
    newItem=parentNode.getNode("String_Node_Str" + itemFullName);
  }
 catch (  WidgetNotFoundException e) {
    Assert.fail("String_Node_Str" + itemFullName + "String_Node_Str");
  }
 finally {
    if (newItem == null)     return null;
    copyItem.setItem(newItem);
    return copyItem;
  }
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public TalendItem copyAndPaste(){
  getItem().contextMenu("String_Node_Str").click();
  parentNode.contextMenu("String_Node_Str").click();
  TalendItem copyItem=(TalendItem)this.clone();
  SWTBotTreeItem newItem=null;
  try {
    newItem=parentNode.getNode("String_Node_Str" + itemFullName);
  }
 catch (  WidgetNotFoundException e) {
    Assert.fail("String_Node_Str" + itemFullName + "String_Node_Str");
  }
 finally {
    if (newItem == null)     return null;
    copyItem.setItem(newItem);
    gefBot.sleep(6000);
    return copyItem;
  }
}
Program: 129609
Project: 129609
Buggy source:
/** 
 * This method determine if the 'Finish' button is enable This method is called when 'Finish' button is pressed in the wizard. We will create an operation and run it using wizard as execution context.
 */
public boolean performFinish(){
  boolean formIsPerformed;
  if (delimitedFileWizardPage3 == null) {
    formIsPerformed=delimitedFileWizardPage2.isPageComplete();
  }
 else {
    formIsPerformed=delimitedFileWizardPage3.isPageComplete();
  }
  if (formIsPerformed) {
    IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
    try {
      if (creation) {
        String nextId=factory.getNextId();
        connectionProperty.setId(nextId);
        connectionItem.getProperty().setLabel(connectionItem.getProperty().getDisplayName());
        factory.create(connectionItem,delimitedFileWizardPage0.getDestinationPath());
      }
 else {
        connectionItem.getProperty().setLabel(connectionItem.getProperty().getDisplayName());
        RepositoryUpdateManager.updateFileConnection(connectionItem);
        factory.save(connectionItem);
        closeLockStrategy();
      }
      ProxyRepositoryFactory.getInstance().saveProject(ProjectManager.getInstance().getCurrentProject());
    }
 catch (    PersistenceException e) {
      String detailError=e.toString();
      new ErrorDialogWidthDetailArea(getShell(),PID,Messages.getString("String_Node_Str"),detailError);
      log.error(Messages.getString("String_Node_Str") + "String_Node_Str" + detailError);
      return false;
    }
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * This method determine if the 'Finish' button is enable This method is called when 'Finish' button is pressed in the wizard. We will create an operation and run it using wizard as execution context.
 */
public boolean performFinish(){
  boolean formIsPerformed;
  if (delimitedFileWizardPage3 == null) {
    formIsPerformed=delimitedFileWizardPage2.isPageComplete();
  }
 else {
    formIsPerformed=delimitedFileWizardPage3.isPageComplete();
  }
  if (formIsPerformed) {
    IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
    try {
      if (creation) {
        String nextId=factory.getNextId();
        connectionProperty.setId(nextId);
        connectionItem.getProperty().setLabel(connectionItem.getProperty().getDisplayName());
        factory.create(connectionItem,delimitedFileWizardPage0.getDestinationPath());
      }
 else {
        connectionItem.getProperty().setLabel(connectionItem.getProperty().getDisplayName());
        RepositoryUpdateManager.updateFileConnection(connectionItem);
        updateConnectionItem();
      }
      ProxyRepositoryFactory.getInstance().saveProject(ProjectManager.getInstance().getCurrentProject());
    }
 catch (    Exception e) {
      String detailError=e.toString();
      new ErrorDialogWidthDetailArea(getShell(),PID,Messages.getString("String_Node_Str"),detailError);
      log.error(Messages.getString("String_Node_Str") + "String_Node_Str" + detailError);
      return false;
    }
    return true;
  }
 else {
    return false;
  }
}
Program: 129610
Project: 129610
Buggy source:
@Override public boolean performFinish(){
  boolean formIsPerformed=false;
  if (page3 == null) {
    formIsPerformed=page1.isPageComplete();
  }
 else {
    formIsPerformed=page3.isPageComplete();
  }
  if (formIsPerformed) {
    IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
    try {
      if (creation) {
        String nextId=factory.getNextId();
        connectionProperty.setId(nextId);
        connectionProperty.setLabel(connectionProperty.getDisplayName());
        factory.create(connectionItem,excelFileWizardPage0.getDestinationPath());
      }
 else {
        connectionProperty.setLabel(connectionProperty.getDisplayName());
        RepositoryUpdateManager.updateFileConnection(connectionItem);
        factory.save(connectionItem);
        closeLockStrategy();
      }
      ProxyRepositoryFactory.getInstance().saveProject(ProjectManager.getInstance().getCurrentProject());
    }
 catch (    PersistenceException e) {
      String detailError=e.toString();
      new ErrorDialogWidthDetailArea(getShell(),PID,Messages.getString("String_Node_Str"),detailError);
      log.error(Messages.getString("String_Node_Str") + "String_Node_Str" + detailError);
      return false;
    }
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
@Override public boolean performFinish(){
  boolean formIsPerformed=false;
  if (page3 == null) {
    formIsPerformed=page1.isPageComplete();
  }
 else {
    formIsPerformed=page3.isPageComplete();
  }
  if (formIsPerformed) {
    IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
    try {
      if (creation) {
        String nextId=factory.getNextId();
        connectionProperty.setId(nextId);
        connectionProperty.setLabel(connectionProperty.getDisplayName());
        factory.create(connectionItem,excelFileWizardPage0.getDestinationPath());
      }
 else {
        connectionProperty.setLabel(connectionProperty.getDisplayName());
        RepositoryUpdateManager.updateFileConnection(connectionItem);
        updateConnectionItem();
      }
      ProxyRepositoryFactory.getInstance().saveProject(ProjectManager.getInstance().getCurrentProject());
    }
 catch (    Exception e) {
      String detailError=e.toString();
      new ErrorDialogWidthDetailArea(getShell(),PID,Messages.getString("String_Node_Str"),detailError);
      log.error(Messages.getString("String_Node_Str") + "String_Node_Str" + detailError);
      return false;
    }
    return true;
  }
 else {
    return false;
  }
}
Program: 129611
Project: 129611
Buggy source:
/** 
 * This method determine if the 'Finish' button is enable This method is called when 'Finish' button is pressed in the wizard. We will create an operation and run it using wizard as execution context.
 */
public boolean performFinish(){
  boolean formIsPerformed;
  if (ldifFileWizardPage3 == null) {
    formIsPerformed=ldifFileWizardPage2.isPageComplete();
  }
 else {
    formIsPerformed=ldifFileWizardPage3.isPageComplete();
  }
  if (formIsPerformed) {
    IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
    try {
      if (creation) {
        String nextId=factory.getNextId();
        connectionProperty.setId(nextId);
        connectionProperty.setLabel(connectionProperty.getDisplayName());
        factory.create(connectionItem,ldifFileWizardPage0.getDestinationPath());
      }
 else {
        connectionProperty.setLabel(connectionProperty.getDisplayName());
        RepositoryUpdateManager.updateFileConnection(connectionItem);
        factory.save(connectionItem);
        closeLockStrategy();
      }
      ProxyRepositoryFactory.getInstance().saveProject(ProjectManager.getInstance().getCurrentProject());
    }
 catch (    PersistenceException e) {
      String detailError=e.toString();
      new ErrorDialogWidthDetailArea(getShell(),PID,Messages.getString("String_Node_Str"),detailError);
      log.error(Messages.getString("String_Node_Str") + "String_Node_Str" + detailError);
      return false;
    }
    return true;
  }
 else {
    return false;
  }
}

Fixed version (ground truth):
/** 
 * This method determine if the 'Finish' button is enable This method is called when 'Finish' button is pressed in the wizard. We will create an operation and run it using wizard as execution context.
 */
public boolean performFinish(){
  boolean formIsPerformed;
  if (ldifFileWizardPage3 == null) {
    formIsPerformed=ldifFileWizardPage2.isPageComplete();
  }
 else {
    formIsPerformed=ldifFileWizardPage3.isPageComplete();
  }
  if (formIsPerformed) {
    IProxyRepositoryFactory factory=ProxyRepositoryFactory.getInstance();
    try {
      if (creation) {
        String nextId=factory.getNextId();
        connectionProperty.setId(nextId);
        connectionProperty.setLabel(connectionProperty.getDisplayName());
        factory.create(connectionItem,ldifFileWizardPage0.getDestinationPath());
      }
 else {
        connectionProperty.setLabel(connectionProperty.getDisplayName());
        RepositoryUpdateManager.updateFileConnection(connectionItem);
        updateConnectionItem();
      }
      ProxyRepositoryFactory.getInstance().saveProject(ProjectManager.getInstance().getCurrentProject());
    }
 catch (    Exception e) {
      String detailError=e.toString();
      new ErrorDialogWidthDetailArea(getShell(),PID,Messages.getString("String_Node_Str"),detailError);
      log.error(Messages.getString("String_Node_Str") + "String_Node_Str" + detailError);
      return false;
    }
    return true;
  }
 else {
    return false;
  }
}