nus-yam/ex-repair huggingface dataset:
Program: 114900
Project: 114900
Buggy source:
@BeforeClass(alwaysRun=true) public void setEnvironment() throws Exception {
  super.init();
  publisherURLHttp=getPublisherURLHttp();
  storeURLHttp=getStoreURLHttp();
  serverConfigurationManager=new ServerConfigurationManager(gatewayContextWrk);
  serverConfigurationManager.applyConfigurationWithoutRestart(new File(getAMResourceLocation() + File.separator + "String_Node_Str"+ "String_Node_Str"));
  serverConfigurationManager.applyConfiguration(new File(getAMResourceLocation() + File.separator + "String_Node_Str"+ "String_Node_Str"));
  userManagementClient=new UserManagementClient(keyManagerContext.getContextUrls().getBackEndUrl(),keyManagerContext.getContextTenant().getContextUser().getUserName(),keyManagerContext.getContextTenant().getContextUser().getPassword());
  URL url=new URL(gatewayUrlsWrk.getWebAppURLHttp());
  wireMonitorURL="String_Node_Str" + url.getHost() + "String_Node_Str"+ hostPort;
  server=new WireMonitorServer(hostPort);
  server.setReadTimeOut(300);
  server.start();
  String gatewaySessionCookie=createSession(gatewayContextMgt);
  loadSynapseConfigurationFromClasspath("String_Node_Str" + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str",gatewayContextMgt,gatewaySessionCookie);
}

Fixed version (ground truth):
@BeforeClass(alwaysRun=true) public void setEnvironment() throws Exception {
  super.init();
  publisherURLHttp=getPublisherURLHttp();
  storeURLHttp=getStoreURLHttp();
  serverConfigurationManager=new ServerConfigurationManager(gatewayContextWrk);
  serverConfigurationManager.applyConfigurationWithoutRestart(new File(getAMResourceLocation() + File.separator + "String_Node_Str"+ "String_Node_Str"));
  serverConfigurationManager.applyConfiguration(new File(getAMResourceLocation() + File.separator + "String_Node_Str"+ "String_Node_Str"));
  userManagementClient1=new UserManagementClient(keyManagerContext.getContextUrls().getBackEndUrl(),keyManagerContext.getContextTenant().getContextUser().getUserName(),keyManagerContext.getContextTenant().getContextUser().getPassword());
  URL url=new URL(gatewayUrlsWrk.getWebAppURLHttp());
  wireMonitorURL="String_Node_Str" + url.getHost() + "String_Node_Str"+ hostPort;
  server=new WireMonitorServer(hostPort);
  server.setReadTimeOut(300);
  server.start();
  String gatewaySessionCookie=createSession(gatewayContextMgt);
  loadSynapseConfigurationFromClasspath("String_Node_Str" + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str",gatewayContextMgt,gatewaySessionCookie);
}
Program: 114902
Project: 114902
Buggy source:
/** 
 * Verify whether AM_MONITORING_WEB_APP is deployed or not
 * @param webAppURL - Backend URL of the webApp (not need to include webApp name or context)
 */
public static void isMonitoringAppDeployed(String webAppURL){
  long currentTime=System.currentTimeMillis();
  long waitTime=currentTime + (WEB_APP_DEPLOYMENT_DELAY);
  HttpResponse response=null;
  while (waitTime > System.currentTimeMillis()) {
    try {
      response=HttpRequestUtil.sendGetRequest(webAppURL + "String_Node_Str" + APIMIntegrationConstants.AM_MONITORING_WEB_APP_NAME+ "String_Node_Str"+ APIMIntegrationConstants.AM_MONITORING_WEB_APP_NAME+ "String_Node_Str",null);
    }
 catch (    IOException ignore) {
      log.info("String_Node_Str" + APIMIntegrationConstants.AM_MONITORING_WEB_APP_NAME + "String_Node_Str"+ APIMIntegrationConstants.IS_WEB_APP_EXISTS);
    }
    if (response != null) {
      if (response.getData().contains(APIMIntegrationConstants.IS_WEB_APP_EXISTS)) {
        log.info("String_Node_Str" + APIMIntegrationConstants.AM_MONITORING_WEB_APP_NAME + "String_Node_Str");
        break;
      }
 else {
        try {
          Thread.sleep(500);
        }
 catch (        InterruptedException ignored) {
        }
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Verify whether AM_MONITORING_WEB_APP is deployed or not
 * @param webAppURL - Backend URL of the webApp (not need to include webApp name or context)
 */
public static void isMonitoringAppDeployed(String webAppURL){
  long currentTime=System.currentTimeMillis();
  long waitTime=currentTime + (WEB_APP_DEPLOYMENT_DELAY);
  HttpResponse response=null;
  while (waitTime > System.currentTimeMillis()) {
    try {
      response=HttpRequestUtil.sendGetRequest(webAppURL + "String_Node_Str" + APIMIntegrationConstants.AM_MONITORING_WEB_APP_NAME+ "String_Node_Str"+ MultitenantConstants.SUPER_TENANT_DOMAIN_NAME+ "String_Node_Str"+ MultitenantConstants.SUPER_TENANT_ID+ "String_Node_Str"+ APIMIntegrationConstants.AM_MONITORING_WEB_APP_NAME+ "String_Node_Str",null);
    }
 catch (    IOException ignore) {
      log.info("String_Node_Str" + APIMIntegrationConstants.AM_MONITORING_WEB_APP_NAME + "String_Node_Str"+ APIMIntegrationConstants.IS_WEB_APP_EXISTS);
    }
    if (response != null) {
      if (response.getData().contains(APIMIntegrationConstants.IS_WEB_APP_EXISTS)) {
        log.info("String_Node_Str" + APIMIntegrationConstants.AM_MONITORING_WEB_APP_NAME + "String_Node_Str");
        break;
      }
 else {
        try {
          Thread.sleep(500);
        }
 catch (        InterruptedException ignored) {
        }
      }
    }
  }
}
Program: 114903
Project: 114903
Buggy source:
@AfterClass(alwaysRun=true) public void destroy() throws Exception {
  AutomationContext storeContext=new AutomationContext(APIMIntegrationConstants.AM_PRODUCT_GROUP_NAME,APIMIntegrationConstants.AM_STORE_INSTANCE,TestUserMode.SUPER_TENANT_ADMIN);
  int deletedUserCount=0;
  int beforeDeleteUserCount=storeUserSignUpCredentialsDataProvider().length;
  for (int i=0; i < storeUserSignUpCredentialsDataProvider().length; i++) {
    userManagementClient.deleteUser(storeUserSignUpCredentialsDataProvider()[i][0].toString());
    deletedUserCount++;
  }
  assertEquals(deletedUserCount,beforeDeleteUserCount,"String_Node_Str");
}

Fixed version (ground truth):
@AfterClass(alwaysRun=true) public void destroy() throws Exception {
  int deletedUserCount=0;
  int beforeDeleteUserCount=storeUserSignUpCredentialsDataProvider().length;
  for (int i=0; i < storeUserSignUpCredentialsDataProvider().length; i++) {
    userManagementClient.deleteUser(storeUserSignUpCredentialsDataProvider()[i][0].toString());
    deletedUserCount++;
  }
  assertEquals(deletedUserCount,beforeDeleteUserCount,"String_Node_Str");
}
Program: 114904
Project: 114904
Buggy source:
@Test(groups={"String_Node_Str"},description="String_Node_Str",dependsOnMethods="String_Node_Str") public void testUpdatedHTTPTransport() throws Exception {
  APIRequest apiRequest=new APIRequest(apiName,APIContext,new URL(endpointUrl));
  apiRequest.setHttps_checked("String_Node_Str");
  apiRequest.setProvider(user.getUserName());
  System.out.println(apiRequest.getProvider());
  HttpResponse serviceResponse=apiPublisher.updateAPI(apiRequest);
  assertTrue(serviceResponse.getData().contains("String_Node_Str"),apiName + "String_Node_Str");
  HttpResponse apiUpdateResponsePublisher=apiPublisher.getAPI(apiName,apiRequest.getProvider(),apiRequest.getVersion());
  serviceResponse=HttpRequestUtil.doGet(getAPIInvocationURLHttp(APIContext + "String_Node_Str" + APIVersion),requestHeaders);
  assertEquals(serviceResponse.getResponseCode(),Response.Status.OK.getStatusCode(),"String_Node_Str");
  try {
    serviceResponse=HttpRequestUtil.doGet(getAPIInvocationURLHttps(APIContext + "String_Node_Str" + APIVersion),requestHeaders);
    assertEquals(serviceResponse.getResponseCode(),Response.Status.FORBIDDEN.getStatusCode(),"String_Node_Str");
  }
 catch (  NoHttpResponseException e) {
    log.info("String_Node_Str",e);
  }
}

Fixed version (ground truth):
@Test(groups={"String_Node_Str"},description="String_Node_Str",dependsOnMethods="String_Node_Str") public void testUpdatedHTTPTransport() throws Exception {
  APIRequest apiRequest=new APIRequest(apiName,APIContext,new URL(endpointUrl));
  apiRequest.setHttps_checked("String_Node_Str");
  apiRequest.setProvider(user.getUserName());
  HttpResponse serviceResponse=apiPublisher.updateAPI(apiRequest);
  assertTrue(serviceResponse.getData().contains("String_Node_Str"),apiName + "String_Node_Str");
  HttpResponse apiUpdateResponsePublisher=apiPublisher.getAPI(apiName,apiRequest.getProvider(),apiRequest.getVersion());
  serviceResponse=HttpRequestUtil.doGet(getAPIInvocationURLHttp(APIContext + "String_Node_Str" + APIVersion),requestHeaders);
  assertEquals(serviceResponse.getResponseCode(),Response.Status.OK.getStatusCode(),"String_Node_Str");
  try {
    serviceResponse=HttpRequestUtil.doGet(getAPIInvocationURLHttps(APIContext + "String_Node_Str" + APIVersion),requestHeaders);
    assertEquals(serviceResponse.getResponseCode(),Response.Status.FORBIDDEN.getStatusCode(),"String_Node_Str");
  }
 catch (  Exception ignored) {
  }
}
Program: 114905
Project: 114905
Buggy source:
@Test(groups={"String_Node_Str"},description="String_Node_Str",dependsOnMethods="String_Node_Str") public void testUpdatedHTTPSTransport() throws Exception {
  APIRequest apiRequest=new APIRequest(apiName,APIContext,new URL(endpointUrl));
  apiRequest.setProvider(user.getUserName());
  apiRequest.setHttp_checked("String_Node_Str");
  apiRequest.setHttps_checked("String_Node_Str");
  apiPublisher.updateAPI(apiRequest);
  try {
    HttpResponse serviceResponse=HttpRequestUtil.doGet(getAPIInvocationURLHttp(APIContext + "String_Node_Str" + APIVersion),requestHeaders);
    assertEquals(serviceResponse.getResponseCode(),Response.Status.FORBIDDEN.getStatusCode(),"String_Node_Str");
  }
 catch (  NoHttpResponseException e) {
    log.info("String_Node_Str",e);
  }
  HttpResponse serviceResponse=HttpRequestUtil.doGet(getAPIInvocationURLHttps(APIContext + "String_Node_Str" + APIVersion),requestHeaders);
  assertEquals(serviceResponse.getResponseCode(),Response.Status.OK.getStatusCode(),"String_Node_Str");
}

Fixed version (ground truth):
@Test(groups={"String_Node_Str"},description="String_Node_Str",dependsOnMethods="String_Node_Str") public void testUpdatedHTTPSTransport() throws Exception {
  APIRequest apiRequest=new APIRequest(apiName,APIContext,new URL(endpointUrl));
  apiRequest.setProvider(user.getUserName());
  apiRequest.setHttp_checked("String_Node_Str");
  apiRequest.setHttps_checked("String_Node_Str");
  apiPublisher.updateAPI(apiRequest);
  try {
    HttpResponse serviceResponse=HttpRequestUtil.doGet(getAPIInvocationURLHttp(APIContext + "String_Node_Str" + APIVersion),requestHeaders);
    assertEquals(serviceResponse.getResponseCode(),Response.Status.FORBIDDEN.getStatusCode(),"String_Node_Str");
  }
 catch (  Exception ignored) {
  }
  HttpResponse serviceResponse=HttpRequestUtil.doGet(getAPIInvocationURLHttps(APIContext + "String_Node_Str" + APIVersion),requestHeaders);
  assertEquals(serviceResponse.getResponseCode(),Response.Status.OK.getStatusCode(),"String_Node_Str");
}
Program: 114915
Project: 114915
Buggy source:
/** 
 * This method is used to workflow-extensions.xml configuration by handling the addition of the executors to handle work flow executors
 * @throws APIMigrationException
 */
private void workflowExtensionsMigration() throws APIMigrationException {
  log.info("String_Node_Str");
  for (  Tenant tenant : getTenantsArray()) {
    log.debug("String_Node_Str" + tenant.getId() + '('+ tenant.getDomain()+ ')');
    try {
      registryService.startTenantFlow(tenant);
      if (!registryService.isGovernanceRegistryResourceExists(APIConstants.WORKFLOW_EXECUTOR_LOCATION)) {
        log.debug("String_Node_Str" + tenant.getId() + '('+ tenant.getDomain()+ ')');
        continue;
      }
      String workFlowExtensions=ResourceUtil.getResourceContent(registryService.getGovernanceRegistryResource(APIConstants.WORKFLOW_EXECUTOR_LOCATION));
      String updatedWorkFlowExtensions=ResourceModifier.modifyWorkFlowExtensions(workFlowExtensions);
      registryService.updateGovernanceRegistryResource(APIConstants.WORKFLOW_EXECUTOR_LOCATION,updatedWorkFlowExtensions);
    }
 catch (    RegistryException e) {
      log.error("String_Node_Str" + tenant.getId() + '('+ tenant.getDomain()+ ')',e);
    }
catch (    UserStoreException e) {
      log.error("String_Node_Str" + tenant.getId() + '('+ tenant.getDomain()+ ')',e);
    }
 finally {
      registryService.endTenantFlow();
    }
    log.debug("String_Node_Str" + tenant.getId() + '('+ tenant.getDomain()+ ')');
  }
  log.info("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * This method is used to workflow-extensions.xml configuration by handling the addition of the executors to handle work flow executors
 * @throws APIMigrationException
 */
private void workflowExtensionsMigration() throws APIMigrationException {
  log.info("String_Node_Str");
  for (  Tenant tenant : getTenantsArray()) {
    log.info("String_Node_Str" + tenant.getId() + '('+ tenant.getDomain()+ ')');
    try {
      registryService.startTenantFlow(tenant);
      if (!registryService.isGovernanceRegistryResourceExists(APIConstants.WORKFLOW_EXECUTOR_LOCATION)) {
        log.debug("String_Node_Str" + tenant.getId() + '('+ tenant.getDomain()+ ')');
        continue;
      }
      String workFlowExtensions=ResourceUtil.getResourceContent(registryService.getGovernanceRegistryResource(APIConstants.WORKFLOW_EXECUTOR_LOCATION));
      String updatedWorkFlowExtensions=ResourceModifier.modifyWorkFlowExtensions(workFlowExtensions);
      registryService.updateGovernanceRegistryResource(APIConstants.WORKFLOW_EXECUTOR_LOCATION,updatedWorkFlowExtensions);
    }
 catch (    RegistryException e) {
      log.error("String_Node_Str" + tenant.getId() + '('+ tenant.getDomain()+ ')',e);
    }
catch (    UserStoreException e) {
      log.error("String_Node_Str" + tenant.getId() + '('+ tenant.getDomain()+ ')',e);
    }
 finally {
      registryService.endTenantFlow();
    }
    log.info("String_Node_Str" + tenant.getId() + '('+ tenant.getDomain()+ ')');
  }
  log.info("String_Node_Str");
}
Program: 114924
Project: 114924
Buggy source:
@Test(description="String_Node_Str") public void testRemoveSubscriptionByAppId() throws Exception {
  defaultAppListIndex=numberOfApis - 2;
  HttpResponse getAllAppResponse=apiStore.getAllApplications();
  assertEquals(getAllAppResponse.getResponseCode(),Response.Status.OK.getStatusCode(),"String_Node_Str");
  JSONObject getAllAppJsonObject=new JSONObject(getAllAppResponse.getData());
  assertFalse(getAllAppJsonObject.getBoolean("String_Node_Str"),"String_Node_Str");
  JSONArray getAllAppsJsonArray=getAllAppJsonObject.getJSONArray("String_Node_Str");
  for (int arrayIndex=0; arrayIndex < getAllAppsJsonArray.length(); arrayIndex++) {
    if (getAllAppsJsonArray.getJSONObject(arrayIndex).getString("String_Node_Str").equals(applicationName)) {
      String defaultAppId=getAllAppsJsonArray.getJSONObject(arrayIndex).getString("String_Node_Str");
      HttpResponse removeSubscriptionByIdResponse=apiStore.removeAPISubscription(apiNameList.get(defaultAppListIndex),version,providerName,defaultAppId);
      assertEquals(removeSubscriptionByIdResponse.getResponseCode(),Response.Status.OK.getStatusCode(),"String_Node_Str");
      JSONObject removeSubscriptionByIdJsonObject=new JSONObject(removeSubscriptionByIdResponse.getData());
      assertFalse(removeSubscriptionByIdJsonObject.getBoolean("String_Node_Str"),"String_Node_Str");
    }
  }
}

Fixed version (ground truth):
@Test(description="String_Node_Str") public void testRemoveSubscriptionByAppId() throws Exception {
  defaultAppListIndex=numberOfApis - 2;
  HttpResponse getAllAppResponse=apiStore.getAllApplications();
  assertEquals(getAllAppResponse.getResponseCode(),Response.Status.OK.getStatusCode(),"String_Node_Str");
  JSONObject getAllAppJsonObject=new JSONObject(getAllAppResponse.getData());
  assertFalse(getAllAppJsonObject.getBoolean("String_Node_Str"),"String_Node_Str");
  JSONArray getAllAppsJsonArray=getAllAppJsonObject.getJSONArray("String_Node_Str");
  for (int arrayIndex=0; arrayIndex < getAllAppsJsonArray.length(); arrayIndex++) {
    if (getAllAppsJsonArray.getJSONObject(arrayIndex).getString("String_Node_Str").equals(newApplicationName)) {
      String defaultAppId=getAllAppsJsonArray.getJSONObject(arrayIndex).getString("String_Node_Str");
      HttpResponse removeSubscriptionByIdResponse=apiStore.removeAPISubscription(apiNameList.get(defaultAppListIndex),version,providerName,defaultAppId);
      assertEquals(removeSubscriptionByIdResponse.getResponseCode(),Response.Status.OK.getStatusCode(),"String_Node_Str");
      JSONObject removeSubscriptionByIdJsonObject=new JSONObject(removeSubscriptionByIdResponse.getData());
      assertFalse(removeSubscriptionByIdJsonObject.getBoolean("String_Node_Str"),"String_Node_Str");
    }
  }
}
Program: 114927
Project: 114927
Buggy source:
@DataProvider public static Object[][] userModeDataProvider(){
  return new Object[][]{new Object[]{TestUserMode.TENANT_ADMIN}};
}

Fixed version (ground truth):
@DataProvider public static Object[][] userModeDataProvider(){
  return new Object[][]{new Object[]{TestUserMode.SUPER_TENANT_ADMIN},new Object[]{TestUserMode.TENANT_ADMIN}};
}
Program: 114928
Project: 114928
Buggy source:
@AfterClass(alwaysRun=true) public void destroy() throws Exception {
  HttpResponse httpResponse;
  if (app1Name != null) {
    httpResponse=apiStore.removeApplication(app1Name);
    checkError(httpResponse.getData(),"String_Node_Str" + app1Name);
  }
  if (app2Name != null) {
    httpResponse=apiStore.removeApplication(app2Name);
    checkError(httpResponse.getData(),"String_Node_Str" + app2Name);
  }
  httpResponse=apiPublisher.deleteAPI(apiName,"String_Node_Str",publisherContext.getSuperTenant().getContextUser().getUserName());
  checkError(httpResponse.getData(),"String_Node_Str" + apiName);
  httpResponse=apiPublisher.deleteAPI(apiNameFaultyAPI,"String_Node_Str",publisherContext.getSuperTenant().getContextUser().getUserName());
  checkError(httpResponse.getData(),"String_Node_Str" + apiNameFaultyAPI);
  super.cleanup();
}

Fixed version (ground truth):
@AfterClass(alwaysRun=true) public void destroy() throws Exception {
  HttpResponse httpResponse;
  if (app1Name != null) {
    httpResponse=apiStore.removeApplication(app1Name);
    checkError(httpResponse.getData(),"String_Node_Str" + app1Name);
  }
  if (app2Name != null) {
    httpResponse=apiStore.removeApplication(app2Name);
    checkError(httpResponse.getData(),"String_Node_Str" + app2Name);
  }
  httpResponse=apiPublisher.deleteAPI(apiName,"String_Node_Str",publisherContext.getSuperTenant().getContextUser().getUserName());
  checkError(httpResponse.getData(),"String_Node_Str" + apiName);
  httpResponse=apiPublisher.deleteAPI(apiNameFaultyAPI,"String_Node_Str",publisherContext.getSuperTenant().getContextUser().getUserName());
  checkError(httpResponse.getData(),"String_Node_Str" + apiNameFaultyAPI);
  super.cleanUp();
}
Program: 114929
Project: 114929
Buggy source:
@AfterClass(alwaysRun=true) public void destroy() throws Exception {
  super.cleanup();
}

Fixed version (ground truth):
@AfterClass(alwaysRun=true) public void destroy() throws Exception {
  super.cleanUp();
}
Program: 114930
Project: 114930
Buggy source:
@AfterClass(alwaysRun=true) public void tearDown() throws Exception {
  TestUtil.cleanUp(gatewayContext.getContextTenant().getContextUser().getUserName(),gatewayContext.getContextTenant().getContextUser().getPassword(),storeUrls.getWebAppURLHttp(),publisherUrls.getWebAppURLHttp());
  driver.quit();
}

Fixed version (ground truth):
@AfterClass(alwaysRun=true) public void tearDown() throws Exception {
  super.cleanUp();
  driver.quit();
}
Program: 114931
Project: 114931
Buggy source:
@AfterClass(alwaysRun=true) public void tearDown() throws Exception {
  TestUtil.cleanUp(gatewayContext.getContextTenant().getContextUser().getUserName(),gatewayContext.getContextTenant().getContextUser().getPassword(),storeUrls.getWebAppURLHttp(),publisherUrls.getWebAppURLHttp());
  driver.quit();
}

Fixed version (ground truth):
@AfterClass(alwaysRun=true) public void tearDown() throws Exception {
  super.cleanUp();
  driver.quit();
}
Program: 114932
Project: 114932
Buggy source:
@Test(groups="String_Node_Str",description="String_Node_Str") public void testLogin() throws Exception {
  driver.get(publisherURL + "String_Node_Str");
  WebElement userNameField=driver.findElement(By.id("String_Node_Str"));
  WebElement passwordField=driver.findElement(By.id("String_Node_Str"));
  userNameField.sendKeys(gatewayContext.getContextTenant().getContextUser().getUserName());
  passwordField.sendKeys(gatewayContext.getContextTenant().getContextUser().getPassword());
  driver.findElement(By.id("String_Node_Str")).click();
  for (int i=0; i < 13; i++) {
    publishAPI("String_Node_Str" + i,"String_Node_Str" + i);
  }
  driver.get(storeURL + "String_Node_Str");
  WebElement searchTxtBox=driver.findElement(By.name("String_Node_Str"));
  searchTxtBox.sendKeys("String_Node_Str");
  driver.findElement(By.className("String_Node_Str")).click();
  wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("String_Node_Str")));
  int searchResultCount=driver.findElements(By.cssSelector("String_Node_Str")).size();
  Boolean result;
  if (searchResultCount == 10) {
    result=true;
  }
 else {
    result=false;
  }
  Assert.assertTrue(result,"String_Node_Str");
}

Fixed version (ground truth):
@Test(groups="String_Node_Str",description="String_Node_Str") public void testLogin() throws Exception {
  driver.get(publisherURL + "String_Node_Str");
  WebElement userNameField=driver.findElement(By.id("String_Node_Str"));
  WebElement passwordField=driver.findElement(By.id("String_Node_Str"));
  userNameField.sendKeys(gatewayContextMgt.getContextTenant().getContextUser().getUserName());
  passwordField.sendKeys(gatewayContextMgt.getContextTenant().getContextUser().getPassword());
  driver.findElement(By.id("String_Node_Str")).click();
  for (int i=0; i < 13; i++) {
    publishAPI("String_Node_Str" + i,"String_Node_Str" + i);
  }
  driver.get(storeURL + "String_Node_Str");
  WebElement searchTxtBox=driver.findElement(By.name("String_Node_Str"));
  searchTxtBox.sendKeys("String_Node_Str");
  driver.findElement(By.className("String_Node_Str")).click();
  wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("String_Node_Str")));
  int searchResultCount=driver.findElements(By.cssSelector("String_Node_Str")).size();
  Boolean result;
  if (searchResultCount == 10) {
    result=true;
  }
 else {
    result=false;
  }
  Assert.assertTrue(result,"String_Node_Str");
}
Program: 114933
Project: 114933
Buggy source:
@AfterClass(alwaysRun=true) public void tearDown() throws Exception {
  TestUtil.cleanUp(gatewayContext.getContextTenant().getContextUser().getUserName(),gatewayContext.getContextTenant().getContextUser().getPassword(),storeUrls.getWebAppURLHttp(),publisherUrls.getWebAppURLHttp());
  driver.quit();
}

Fixed version (ground truth):
@AfterClass(alwaysRun=true) public void tearDown() throws Exception {
  TestUtil.cleanUp(gatewayContextMgt.getContextTenant().getContextUser().getUserName(),gatewayContextMgt.getContextTenant().getContextUser().getPassword(),storeUrls.getWebAppURLHttp(),publisherUrls.getWebAppURLHttp());
  driver.quit();
}
Program: 114935
Project: 114935
Buggy source:
@BeforeClass(alwaysRun=true) protected void setEnvironment() throws Exception {
  super.init();
  if (!editStoreConfig(externalLogoutPage)) {
    throw new TestException("String_Node_Str");
  }
  driver=BrowserManager.getWebDriver();
  apiStoreUrl=getStoreURL();
  this.logViewerClient=new LogViewerClient(gatewayContext.getContextUrls().getBackEndUrl(),TEST_DATA_USERNAME,TEST_DATA_PASSWORD);
}

Fixed version (ground truth):
@BeforeClass(alwaysRun=true) protected void setEnvironment() throws Exception {
  super.init();
  if (!editStoreConfig(externalLogoutPage)) {
    throw new TestException("String_Node_Str");
  }
  driver=BrowserManager.getWebDriver();
  apiStoreUrl=getStoreURL();
  this.logViewerClient=new LogViewerClient(gatewayContextMgt.getContextUrls().getBackEndUrl(),TEST_DATA_USERNAME,TEST_DATA_PASSWORD);
}
Program: 114936
Project: 114936
Buggy source:
@AfterClass(alwaysRun=true) public void tearDown() throws Exception {
  TestUtil.cleanUp(gatewayContext.getContextTenant().getContextUser().getUserName(),gatewayContext.getContextTenant().getContextUser().getPassword(),storeUrls.getWebAppURLHttp(),publisherUrls.getWebAppURLHttp());
  driver.quit();
}

Fixed version (ground truth):
@AfterClass(alwaysRun=true) public void tearDown() throws Exception {
  TestUtil.cleanUp(gatewayContextMgt.getContextTenant().getContextUser().getUserName(),gatewayContextMgt.getContextTenant().getContextUser().getPassword(),storeUrls.getWebAppURLHttp(),publisherUrls.getWebAppURLHttp());
  driver.quit();
}
Program: 114937
Project: 114937
Buggy source:
@AfterClass(alwaysRun=true) public void tearDown() throws Exception {
  TestUtil.cleanUp(gatewayContext.getContextTenant().getContextUser().getUserName(),gatewayContext.getContextTenant().getContextUser().getPassword(),storeUrls.getWebAppURLHttp(),publisherUrls.getWebAppURLHttp());
  driver.quit();
}

Fixed version (ground truth):
@AfterClass(alwaysRun=true) public void tearDown() throws Exception {
  super.cleanUp();
  driver.quit();
}
Program: 114939
Project: 114939
Buggy source:
@AfterClass(alwaysRun=true) public void tearDown() throws Exception {
  TestUtil.cleanUp(gatewayContext.getContextTenant().getContextUser().getUserName(),gatewayContext.getContextTenant().getContextUser().getPassword(),storeUrls.getWebAppURLHttp(),publisherUrls.getWebAppURLHttp());
  driver.quit();
}

Fixed version (ground truth):
@AfterClass(alwaysRun=true) public void tearDown() throws Exception {
  TestUtil.cleanUp(gatewayContextMgt.getContextTenant().getContextUser().getUserName(),gatewayContextMgt.getContextTenant().getContextUser().getPassword(),storeUrls.getWebAppURLHttp(),publisherUrls.getWebAppURLHttp());
  driver.quit();
}
Program: 114940
Project: 114940
Buggy source:
@Test(groups="String_Node_Str",description="String_Node_Str") public void createTenantAndAPI() throws Exception {
  LoginPage login=new LoginPage(driver);
  login.loginAs(gatewayContext.getContextTenant().getContextUser().getUserName(),gatewayContext.getContextTenant().getContextUser().getPassword());
  TenantHomePage addNewTenantHome=new TenantHomePage(driver);
  String firstName="String_Node_Str";
  String lastName="String_Node_Str";
  String email="String_Node_Str";
  addNewTenantHome.addNewTenant(TEST_DATA_TENANT,firstName,lastName,TEST_DATA_TENANT_ADMIN_USER,TEST_DATA_TENANT_ADMIN_PASSWORD,email);
  TenantListpage tenantListpage=new TenantListpage(driver);
  tenantListpage.checkOnUplodedTenant(TEST_DATA_TENANT);
  publisherURL=getPublisherURL();
  HttpContext httpContext=TestUtil.login(TEST_DATA_TENANT_PUBLISHER,TEST_DATA_TENANT_ADMIN_PASSWORD,publisherURL);
  assertTrue(TestUtil.addAPI(TEST_DATA_TENANT_PUBLISHER,TEST_DATA_API_NAME,TEST_DATA_API_VERSION,httpContext,publisherURL));
  assertTrue(TestUtil.publishAPI(TEST_DATA_TENANT_PUBLISHER,TEST_DATA_API_NAME,TEST_DATA_API_VERSION,httpContext,publisherURL));
}

Fixed version (ground truth):
@Test(groups="String_Node_Str",description="String_Node_Str") public void createTenantAndAPI() throws Exception {
  LoginPage login=new LoginPage(driver);
  login.loginAs(gatewayContextMgt.getContextTenant().getContextUser().getUserName(),gatewayContextMgt.getContextTenant().getContextUser().getPassword());
  TenantHomePage addNewTenantHome=new TenantHomePage(driver);
  String firstName="String_Node_Str";
  String lastName="String_Node_Str";
  String email="String_Node_Str";
  addNewTenantHome.addNewTenant(TEST_DATA_TENANT,firstName,lastName,TEST_DATA_TENANT_ADMIN_USER,TEST_DATA_TENANT_ADMIN_PASSWORD,email);
  TenantListpage tenantListpage=new TenantListpage(driver);
  tenantListpage.checkOnUplodedTenant(TEST_DATA_TENANT);
  publisherURL=getPublisherURL();
  HttpContext httpContext=TestUtil.login(TEST_DATA_TENANT_PUBLISHER,TEST_DATA_TENANT_ADMIN_PASSWORD,publisherURL);
  assertTrue(TestUtil.addAPI(TEST_DATA_TENANT_PUBLISHER,TEST_DATA_API_NAME,TEST_DATA_API_VERSION,httpContext,publisherURL));
  assertTrue(TestUtil.publishAPI(TEST_DATA_TENANT_PUBLISHER,TEST_DATA_API_NAME,TEST_DATA_API_VERSION,httpContext,publisherURL));
}
Program: 114944
Project: 114944
Buggy source:
@AfterClass(alwaysRun=true) public void tearDown() throws Exception {
  TestUtil.cleanUp(gatewayContext.getContextTenant().getContextUser().getUserName(),gatewayContext.getContextTenant().getContextUser().getPassword(),storeUrls.getWebAppURLHttp(),publisherUrls.getWebAppURLHttp());
  driver.quit();
}

Fixed version (ground truth):
@AfterClass(alwaysRun=true) public void tearDown() throws Exception {
  TestUtil.cleanUp(gatewayContextMgt.getContextTenant().getContextUser().getUserName(),gatewayContextMgt.getContextTenant().getContextUser().getPassword(),storeUrls.getWebAppURLHttp(),publisherUrls.getWebAppURLHttp());
  driver.quit();
}
Program: 114946
Project: 114946
Buggy source:
@AfterClass(alwaysRun=true) public void tearDown() throws Exception {
  TestUtil.cleanUp(gatewayContext.getContextTenant().getContextUser().getUserName(),gatewayContext.getContextTenant().getContextUser().getPassword(),storeUrls.getWebAppURLHttp(),publisherUrls.getWebAppURLHttp());
  driver.quit();
}

Fixed version (ground truth):
@AfterClass(alwaysRun=true) public void tearDown() throws Exception {
  TestUtil.cleanUp(gatewayContextMgt.getContextTenant().getContextUser().getUserName(),gatewayContextMgt.getContextTenant().getContextUser().getPassword(),storeUrls.getWebAppURLHttp(),publisherUrls.getWebAppURLHttp());
  driver.quit();
}
Program: 114948
Project: 114948
Buggy source:
protected String getAdminDashboardURL() throws Exception {
  return gatewayUrls.getWebAppURLHttps() + "String_Node_Str";
}

Fixed version (ground truth):
protected String getAdminDashboardURL() throws Exception {
  return publisherUrls.getWebAppURLHttps() + "String_Node_Str";
}
Program: 114949
Project: 114949
Buggy source:
protected String getLoginURL() throws XPathExpressionException {
  return UrlGenerationUtil.getLoginURL(gatewayContext.getInstance());
}

Fixed version (ground truth):
protected String getLoginURL() throws XPathExpressionException {
  return UrlGenerationUtil.getLoginURL(publisherContext.getInstance());
}
Program: 114951
Project: 114951
Buggy source:
@Test(groups="String_Node_Str",description="String_Node_Str") public void testCreateAndPublishAPI() throws Exception {
  String loginURL=getPublisherURL();
  HttpContext httpContext=TestUtil.login(gatewayContext.getContextTenant().getContextUser().getUserName(),gatewayContext.getContextTenant().getContextUser().getPassword(),loginURL);
  assertTrue(TestUtil.addAPI(gatewayContext.getContextTenant().getContextUser().getUserName(),TEST_DATA_API_NAME,TEST_DATA_API_VERSION,httpContext,loginURL));
  assertTrue(TestUtil.publishAPI(gatewayContext.getContextTenant().getContextUser().getUserName(),TEST_DATA_API_NAME,TEST_DATA_API_VERSION,httpContext,loginURL));
  System.out.println("String_Node_Str");
}

Fixed version (ground truth):
@Test(groups="String_Node_Str",description="String_Node_Str") public void testCreateAndPublishAPI() throws Exception {
  String loginURL=getPublisherURL();
  HttpContext httpContext=TestUtil.login(publisherContext.getContextTenant().getContextUser().getUserName(),publisherContext.getContextTenant().getContextUser().getPassword(),loginURL);
  assertTrue(TestUtil.addAPI(publisherContext.getContextTenant().getContextUser().getUserName(),TEST_DATA_API_NAME,TEST_DATA_API_VERSION,httpContext,loginURL));
  assertTrue(TestUtil.publishAPI(publisherContext.getContextTenant().getContextUser().getUserName(),TEST_DATA_API_NAME,TEST_DATA_API_VERSION,httpContext,loginURL));
  System.out.println("String_Node_Str");
}
Program: 114953
Project: 114953
Buggy source:
@Test(groups="String_Node_Str",description="String_Node_Str",enabled=false) public void testAdminDashboardAnalyticsPage() throws Exception {
  AdminDashboardLoginPage adminDashboardLoginPage=new AdminDashboardLoginPage(driver);
  ConfigureAnalyticsPage configureAnalyticsPage=adminDashboardLoginPage.getConfigureAnalyticsPage(gatewayContext.getContextTenant().getContextUser().getUserName(),gatewayContext.getContextTenant().getContextUser().getPassword());
  String configSavedMessage=configureAnalyticsPage.addConfigurations(EVENT_RECEIVER_URL,EVENT_RECEIVER_USERNAME,EVENT_RECEIVER_PASSWORD,DATA_ANALYZER_URL,DATA_ANALYZER_USERNAME,DATA_ANALYZER_PASSWORD,STAT_DS_URL,STAT_DS_CLASS_NAME,STAT_DS_USERNAME,STAT_DS_PASSWORD);
  assertEquals(configSavedMessage,"String_Node_Str");
  configureAnalyticsPage.logOut();
}

Fixed version (ground truth):
@Test(groups="String_Node_Str",description="String_Node_Str",enabled=false) public void testAdminDashboardAnalyticsPage() throws Exception {
  AdminDashboardLoginPage adminDashboardLoginPage=new AdminDashboardLoginPage(driver);
  ConfigureAnalyticsPage configureAnalyticsPage=adminDashboardLoginPage.getConfigureAnalyticsPage(gatewayContextMgt.getContextTenant().getContextUser().getUserName(),gatewayContextMgt.getContextTenant().getContextUser().getPassword());
  String configSavedMessage=configureAnalyticsPage.addConfigurations(EVENT_RECEIVER_URL,EVENT_RECEIVER_USERNAME,EVENT_RECEIVER_PASSWORD,DATA_ANALYZER_URL,DATA_ANALYZER_USERNAME,DATA_ANALYZER_PASSWORD,STAT_DS_URL,STAT_DS_CLASS_NAME,STAT_DS_USERNAME,STAT_DS_PASSWORD);
  assertEquals(configSavedMessage,"String_Node_Str");
  configureAnalyticsPage.logOut();
}
Program: 114954
Project: 114954
Buggy source:
@AfterClass(alwaysRun=true) public void destroy() throws Exception {
  super.cleanUp(gatewayContext.getContextTenant().getTenantAdmin().getUserName(),gatewayContext.getContextTenant().getContextUser().getPassword(),storeUrls.getWebAppURLHttp(),publisherUrls.getWebAppURLHttp());
}

Fixed version (ground truth):
@AfterClass(alwaysRun=true) public void destroy() throws Exception {
  super.cleanUp();
}
Program: 114955
Project: 114955
Buggy source:
@BeforeClass(alwaysRun=true) public void setEnvironment(){
  try {
    super.init();
    publisherURLHttp=publisherUrls.getWebAppURLHttp();
    TenantManagementServiceClient tenantManagementServiceClient=new TenantManagementServiceClient(gatewayContext.getContextUrls().getBackEndUrl(),createSession(gatewayContext));
    tenantManagementServiceClient.addTenant(tenantDomain,gatewayContext.getContextTenant().getTenantAdmin().getPassword(),gatewayContext.getContextTenant().getTenantAdmin().getUserName(),"String_Node_Str");
  }
 catch (  XPathExpressionException e) {
    assertTrue(false,"String_Node_Str");
  }
catch (  APIManagerIntegrationTestException e) {
    assertTrue(false,"String_Node_Str");
  }
catch (  RemoteException e) {
    assertTrue(false,"String_Node_Str");
  }
catch (  TenantMgtAdminServiceExceptionException e) {
    assertTrue(false,"String_Node_Str");
  }
}

Fixed version (ground truth):
@BeforeClass(alwaysRun=true) public void setEnvironment(){
  try {
    super.init();
    publisherURLHttp=publisherUrls.getWebAppURLHttp();
    TenantManagementServiceClient tenantManagementServiceClient=new TenantManagementServiceClient(keyManagerContext.getContextUrls().getBackEndUrl(),createSession(keyManagerContext));
    tenantManagementServiceClient.addTenant(tenantDomain,keyManagerContext.getContextTenant().getTenantAdmin().getPassword(),keyManagerContext.getContextTenant().getTenantAdmin().getUserName(),"String_Node_Str");
  }
 catch (  XPathExpressionException e) {
    assertTrue(false,"String_Node_Str");
  }
catch (  APIManagerIntegrationTestException e) {
    assertTrue(false,"String_Node_Str");
  }
catch (  RemoteException e) {
    assertTrue(false,"String_Node_Str");
  }
catch (  TenantMgtAdminServiceExceptionException e) {
    assertTrue(false,"String_Node_Str");
  }
}
Program: 114956
Project: 114956
Buggy source:
/** 
 * This method is used to get the number of APIs to be displayed in each page
 * @param storeUrl url of the API store
 * @param loginResponseCookie login response
 * @param start starting index of the API list
 * @param offset offset from the starting index of the API list
 * @return number of APIs in each page
 */
private int getPaginationElementsCount(String storeUrl,String loginResponseCookie,int start,int offset){
  String paginationUrl=storeUrl + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ tenantDomain+ "String_Node_Str"+ Integer.toString(start)+ "String_Node_Str"+ Integer.toString(offset);
  int numberOfAPIsInCurrentPage=0;
  Map<String,String> paginationRequestHeaders=new HashMap<String,String>();
  paginationRequestHeaders.put("String_Node_Str",loginResponseCookie);
  HttpResponse paginationFetchResponse=null;
  try {
    paginationFetchResponse=HttpRequestUtil.doGet(paginationUrl,paginationRequestHeaders);
  }
 catch (  IOException e) {
    assertTrue(false,"String_Node_Str");
  }
  String dataText="String_Node_Str";
  if (paginationFetchResponse != null) {
    dataText=paginationFetchResponse.getData();
  }
  JsonElement paginationDataElement=new JsonParser().parse(dataText);
  JsonObject paginationDataObject=paginationDataElement.getAsJsonObject();
  if ("String_Node_Str".equals(paginationDataObject.get("String_Node_Str").toString())) {
    numberOfAPIsInCurrentPage=paginationDataObject.get("String_Node_Str").getAsJsonArray().size();
  }
  return numberOfAPIsInCurrentPage;
}

Fixed version (ground truth):
/** 
 * This method is used to get the number of APIs to be displayed in each page
 * @param storeUrl url of the API store
 * @param loginResponseCookie login response
 * @param start starting index of the API list
 * @param offset offset from the starting index of the API list
 * @return number of APIs in each page
 */
private int getPaginationElementsCount(String storeUrl,String loginResponseCookie,int start,int offset) throws JSONException {
  String paginationUrl=storeUrl + "String_Node_Str" + "String_Node_Str"+ "String_Node_Str"+ tenantDomain+ "String_Node_Str"+ Integer.toString(start)+ "String_Node_Str"+ Integer.toString(offset);
  int numberOfAPIsInCurrentPage=0;
  Map<String,String> paginationRequestHeaders=new HashMap<String,String>();
  paginationRequestHeaders.put("String_Node_Str",loginResponseCookie);
  HttpResponse paginationFetchResponse=null;
  try {
    paginationFetchResponse=HttpRequestUtil.doGet(paginationUrl,paginationRequestHeaders);
  }
 catch (  IOException e) {
    assertTrue(false,"String_Node_Str");
  }
  String dataText="String_Node_Str";
  if (paginationFetchResponse != null) {
    dataText=paginationFetchResponse.getData();
  }
  JSONObject paginationDataObject=new JSONObject(dataText);
  if ("String_Node_Str".equals(paginationDataObject.get("String_Node_Str").toString())) {
    numberOfAPIsInCurrentPage=paginationDataObject.getJSONArray("String_Node_Str").length();
  }
  return numberOfAPIsInCurrentPage;
}
Program: 114958
Project: 114958
Buggy source:
@AfterClass(alwaysRun=true) public void destroy() throws Exception {
  super.cleanup();
}

Fixed version (ground truth):
@AfterClass(alwaysRun=true) public void destroy() throws Exception {
  super.cleanUp();
}
Program: 114959
Project: 114959
Buggy source:
@SetEnvironment(executionEnvironments={ExecutionEnvironment.ALL}) @org.testng.annotations.Test(groups="String_Node_Str",description="String_Node_Str") public void testHeaderSplitting() throws Exception {
  String apiInvocationUrl=gatewayUrls.getWebAppURLNhttp() + "String_Node_Str";
  Map<String,String> headers=new HashMap<String,String>();
  headers.put("String_Node_Str","String_Node_Str");
  HttpResponse httpResponse=doGet(apiInvocationUrl,headers);
  if (httpResponse.getHeaders() != null) {
    Assert.assertNull(httpResponse.getHeaders().get("String_Node_Str"),"String_Node_Str");
  }
 else {
    Assert.assertFalse(true,"String_Node_Str");
  }
}

Fixed version (ground truth):
@SetEnvironment(executionEnvironments={ExecutionEnvironment.ALL}) @org.testng.annotations.Test(groups="String_Node_Str",description="String_Node_Str") public void testHeaderSplitting() throws Exception {
  String apiInvocationUrl=getAPIInvocationURLHttp("String_Node_Str");
  Map<String,String> headers=new HashMap<String,String>();
  headers.put("String_Node_Str","String_Node_Str");
  HttpResponse httpResponse=doGet(apiInvocationUrl,headers);
  if (httpResponse.getHeaders() != null) {
    Assert.assertNull(httpResponse.getHeaders().get("String_Node_Str"),"String_Node_Str");
  }
 else {
    Assert.assertFalse(true,"String_Node_Str");
  }
}
Program: 114960
Project: 114960
Buggy source:
@AfterClass(alwaysRun=true) public void destroy() throws Exception {
  if (serverConfigurationManager != null) {
    serverConfigurationManager.restoreToLastConfiguration();
  }
  super.cleanup();
}

Fixed version (ground truth):
@AfterClass(alwaysRun=true) public void destroy() throws Exception {
  if (serverConfigurationManager != null) {
    serverConfigurationManager.restoreToLastConfiguration();
  }
  super.cleanUp();
}
Program: 114961
Project: 114961
Buggy source:
@BeforeClass(alwaysRun=true) public void testChangeTransportMechanism() throws Exception {
  init();
  serverConfigurationManager=new ServerConfigurationManager(apimContext);
  String carbonHome=System.getProperty(ServerConstants.CARBON_HOME);
  File axis2xmlFile=new File(carbonHome + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str");
  File sourceAxis2xmlFile=new File(TestConfigurationProvider.getResourceLocation() + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str");
  if (!axis2xmlFile.exists() || !sourceAxis2xmlFile.exists()) {
    throw new IOException("String_Node_Str");
  }
  serverConfigurationManager.applyConfiguration(sourceAxis2xmlFile,axis2xmlFile);
}

Fixed version (ground truth):
@BeforeClass(alwaysRun=true) public void testChangeTransportMechanism() throws Exception {
  init();
  serverConfigurationManager=new ServerConfigurationManager(gatewayContextWrk);
  String carbonHome=System.getProperty(ServerConstants.CARBON_HOME);
  File axis2xmlFile=new File(carbonHome + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str");
  File sourceAxis2xmlFile=new File(TestConfigurationProvider.getResourceLocation() + File.separator + "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str"+ File.separator+ "String_Node_Str");
  if (!axis2xmlFile.exists() || !sourceAxis2xmlFile.exists()) {
    throw new IOException("String_Node_Str");
  }
  serverConfigurationManager.applyConfiguration(sourceAxis2xmlFile,axis2xmlFile);
}
Program: 114962
Project: 114962
Buggy source:
public static void main(String[] args){
}

Fixed version (ground truth):
public static void main(String[] args){
  System.out.println("String_Node_Str");
  CommandHandler.setInputs(args);
  _authenticator=new NegotiateAuthenticator();
  String securityPackage="String_Node_Str";
  boolean autoGenerate=CommandHandler.isTokenAutoGenerated();
  String clientToken="String_Node_Str";
  if (autoGenerate) {
    IWindowsCredentialsHandle clientCredentials=null;
    WindowsSecurityContextImpl clientContext=null;
    clientCredentials=WindowsCredentialsHandleImpl.getCurrent(securityPackage);
    clientCredentials.initialize();
    clientContext=new WindowsSecurityContextImpl();
    clientContext.setPrincipalName(WindowsAccountImpl.getCurrentUsername());
    System.out.println("String_Node_Str" + WindowsAccountImpl.getCurrentUsername());
    clientContext.setCredentialsHandle(clientCredentials.getHandle());
    clientContext.setSecurityPackage(securityPackage);
    clientContext.initialize(null,null,WindowsAccountImpl.getCurrentUsername());
    clientToken=Base64.encode(clientContext.getToken());
    System.out.println("String_Node_Str" + clientToken);
  }
 else {
    clientToken=CommandHandler.getNTLMToken();
    System.out.println("String_Node_Str" + clientToken);
  }
  try {
    Thread.sleep(4000);
    HttpClient httpclient=new DefaultHttpClient();
    byte[] userKey=(CommandHandler.getConsumerKey() + "String_Node_Str" + CommandHandler.getConsumerSecret()).getBytes();
    String encoding=Base64Utils.encode(userKey);
    HttpPost httppost=new HttpPost(CommandHandler.getTokenendpoint());
    httppost.setHeader("String_Node_Str","String_Node_Str" + encoding);
    List<NameValuePair> paramVals=new ArrayList<NameValuePair>();
    paramVals.add(new BasicNameValuePair("String_Node_Str","String_Node_Str"));
    paramVals.add(new BasicNameValuePair("String_Node_Str",clientToken));
    System.out.println("String_Node_Str" + httppost.getRequestLine());
    HttpResponse response=null;
    httppost.setEntity(new UrlEncodedFormEntity(paramVals,"String_Node_Str"));
    response=httpclient.execute(httppost);
    HttpEntity entity=response.getEntity();
    String responseString=EntityUtils.toString(entity,"String_Node_Str");
    System.out.println(responseString);
    System.out.println("String_Node_Str");
    System.exit(0);
  }
 catch (  IOException e) {
    System.out.print("String_Node_Str" + e.getMessage());
  }
catch (  InterruptedException e) {
    System.out.print("String_Node_Str" + e.getMessage());
  }
}
Program: 114964
Project: 114964
Buggy source:
/** 
 * generate request params to send in http request, with given action
 * @param actionName - Request action name
 * @return - request params
 */
public String generateRequestParameters(String actionName){
  parameterMap.clear();
  setAction();
  init();
  String requestParams=ACTION_PARAMETER_VALUE + "String_Node_Str" + actionName;
  for (  String key : (Iterable<String>)parameterMap.keySet()) {
    requestParams=requestParams + "String_Node_Str" + key+ "String_Node_Str"+ parameterMap.get(key);
  }
  return requestParams;
}

Fixed version (ground truth):
/** 
 * generate request params to send in http request, with given action
 * @param actionName - Request action name
 * @return - request params
 */
public String generateRequestParameters(String actionName){
  parameterMap.clear();
  setAction();
  init();
  String requestParams=ACTION_PARAMETER_VALUE + "String_Node_Str" + actionName;
  StringBuilder bufferAppender=new StringBuilder();
  bufferAppender.append(requestParams);
  for (  Object o : parameterMap.keySet()) {
    String key=(String)o;
    bufferAppender.append("String_Node_Str");
    bufferAppender.append(key);
    bufferAppender.append("String_Node_Str");
    bufferAppender.append(parameterMap.get(key));
  }
  return bufferAppender.toString();
}